org.apache.woden.wsdl20.xml
Interface DescriptionElement

All Superinterfaces:
AttributeExtensible, DocumentableElement, ElementExtensible, WSDLElement
All Known Implementing Classes:
DescriptionImpl

public interface DescriptionElement
extends DocumentableElement

Represents the WSDL 2.0 <description> element.

Author:
John Kaputin (jkaputin@apache.org)

Method Summary
 BindingElement addBindingElement()
          Create a BindingElement with this DescriptionElement as its parent and return a reference to it.
 ImportElement addImportElement()
          Create an ImportElement with this DescriptionElement as its parent and return a reference to it.
 IncludeElement addIncludeElement()
          Create an IncludeElement with this DescriptionElement as its parent and return a reference to it.
 InterfaceElement addInterfaceElement()
          Create an InterfaceElement with this DescriptionElement as its parent and return a reference to it.
 void addNamespace(java.lang.String prefix, java.net.URI namespace)
          Associate the specified prefix with the specified namespace URI.
 ServiceElement addServiceElement()
          Create a ServiceElement with this DescriptionElement as its parent and return a reference to it.
 BindingElement[] getBindingElements()
          Return the set of BindingElements within this DescriptionElement.
 java.net.URI getDocumentBaseURI()
          Return the document base URI that was used to locate the <description> element that this DescriptionElement corresponds to.
 ExtensionRegistry getExtensionRegistry()
          Return the ExtensionRegistry used handle WSDL extensions defined by this DescriptionElement and by any WSDL elements nested within it.
 ImportElement[] getImportElements()
          Return the set of ImportElements within this DescriptionElement.
 IncludeElement[] getIncludeElements()
          Return the set of IncludeElements within this DescriptionElement.
 InterfaceElement[] getInterfaceElements()
          Return the set of InterfaceElements within this DescriptionElement.
 java.net.URI getNamespace(java.lang.String prefix)
          Return the namespace URI associated with the specified prefix.
 java.util.Map getNamespaces()
          Deprecated. in M7, to be replaced in M8 with a type-safe return type (WODEN-140)
 ServiceElement[] getServiceElements()
          Return the set of ServiceElements within this DescriptionElement.
 java.net.URI getTargetNamespace()
          Return the target namespace URI.
 TypesElement getTypesElement()
          Return the TypesElement within this DescriptionElement.
 void removeNamespace(java.lang.String prefix)
          Remove the namespace URI associated with the specified prefix.
 void setDocumentBaseURI(java.net.URI documentBaseURI)
          Set the document base URI to the specified URI.
 void setExtensionRegistry(ExtensionRegistry extReg)
          Specify the ExtensionRegistry to be used handle WSDL extensions defined by this DescriptionElement and by any WSDL elements nested within it.
 void setTargetNamespace(java.net.URI namespaceURI)
          Set the target namespace to the specified URI.
 Description toComponent()
          Return the Description component derived from this DescriptionElement.
 
Methods inherited from interface org.apache.woden.wsdl20.xml.DocumentableElement
addDocumentationElement, getDocumentationElements
 
Methods inherited from interface org.apache.woden.wsdl20.extensions.AttributeExtensible
getExtensionAttribute, getExtensionAttributes, getExtensionAttributesForNamespace, hasExtensionAttributesForNamespace, setExtensionAttribute
 
Methods inherited from interface org.apache.woden.wsdl20.extensions.ElementExtensible
addExtensionElement, getExtensionElements, getExtensionElementsOfType, hasExtensionElementsForNamespace, removeExtensionElement
 

Method Detail

setDocumentBaseURI

void setDocumentBaseURI(java.net.URI documentBaseURI)
Set the document base URI to the specified URI. This is the base URI used to locate the <description> element that this DescriptionElement corresponds to. This is used to resolve relative paths specified within this WSDL description that refer to other WSDL or Schema documents. For example, via <xs:import>, <wsdl:import> or <wsdl:include> elements.

Parameters:
documentBaseURI - the base URI of the WSDL

getDocumentBaseURI

java.net.URI getDocumentBaseURI()
Return the document base URI that was used to locate the <description> element that this DescriptionElement corresponds to. This is used to resolve relative paths within this WSDL description that refer to other WSDL or Schema documents.

Returns:
the document base URI

setTargetNamespace

void setTargetNamespace(java.net.URI namespaceURI)
Set the target namespace to the specified URI. This corresponds to the targetNamespace attribute of the <description> element.

Parameters:
namespaceURI - the target namespace URI

getTargetNamespace

java.net.URI getTargetNamespace()
Return the target namespace URI. This corresponds to the targetNamespace attribute of the <description> element.

Returns:
the target namespace URI.

addNamespace

void addNamespace(java.lang.String prefix,
                  java.net.URI namespace)
Associate the specified prefix with the specified namespace URI. This equates to adding an xmlns namespace declaration to the <description> element. To define the default namespace, specify null or the empty string "" for the prefix. If null is specified for the namespace URI, the prefix/namespace association will be removed (i.e. the same behaviour as the removeNamespace method). If the specified prefix is already associated with a namespace URI, that association will be replaced by the specified prefix/namespace association.

Parameters:
prefix - the prefix String associated with namespace
namespace - the namespace URI associated with prefix

removeNamespace

void removeNamespace(java.lang.String prefix)
Remove the namespace URI associated with the specified prefix. This equates to removing an xmlns namespace declaration from the <description> element. To remove the default namespace, specify null or the empty string "" for the prefix. If the specified prefix is not associated with a namespace, no action is performed.

Parameters:
prefix - the prefix String associated with a namespace

getNamespace

java.net.URI getNamespace(java.lang.String prefix)
Return the namespace URI associated with the specified prefix. This equates to an xmlns namespace declaration on the <description> element. To return the default namespace, specify null or the empty string "" for the prefix. If the specified prefix is not associated with a namespace, null is returned.

Parameters:
prefix - the prefix String associated with a namespace

getNamespaces

java.util.Map getNamespaces()
Deprecated. in M7, to be replaced in M8 with a type-safe return type (WODEN-140)

Return the set of all prefix/namespace URI associations. This equates to all of the xmlns namespace declaration on the <description> element.

Returns:
a Map of prefix String / namespace URI pairs

addImportElement

ImportElement addImportElement()
Create an ImportElement with this DescriptionElement as its parent and return a reference to it. This equates to adding an <import> element to the <description> element.

Returns:
the ImportElement

addIncludeElement

IncludeElement addIncludeElement()
Create an IncludeElement with this DescriptionElement as its parent and return a reference to it. This equates to adding an <include> element to the <description> element.

Returns:
the IncludeElement

addInterfaceElement

InterfaceElement addInterfaceElement()
Create an InterfaceElement with this DescriptionElement as its parent and return a reference to it. This equates to adding an <interface> element to the <description> element.

Returns:
the InterfaceElement

addBindingElement

BindingElement addBindingElement()
Create a BindingElement with this DescriptionElement as its parent and return a reference to it. This equates to adding an <binding> element to the <description> element.

Returns:
the BindingElement

addServiceElement

ServiceElement addServiceElement()
Create a ServiceElement with this DescriptionElement as its parent and return a reference to it. This equates to adding an <service> element to the <description> element.

Returns:
the ServiceElement

getImportElements

ImportElement[] getImportElements()
Return the set of ImportElements within this DescriptionElement. This equates to the set of <import> elements within the <description> element. If no ImportElements exist, an empty array is returned.

Returns:
an array of ImportElement

getIncludeElements

IncludeElement[] getIncludeElements()
Return the set of IncludeElements within this DescriptionElement. This equates to the set of <include> elements within the <description> element. If no IncludeElements exist, an empty array is returned.

Returns:
an array of IncludeElement

getTypesElement

TypesElement getTypesElement()
Return the TypesElement within this DescriptionElement. This corresponds to the <types> element within the <description> element. If no TypesElement exists, one will be created with this DescriptionElement as its parent.

TODO modify this behaviour to return null if none exists and define a new factory method called createTypesElement() WODEN-141

Returns:
the TypesElement

getInterfaceElements

InterfaceElement[] getInterfaceElements()
Return the set of InterfaceElements within this DescriptionElement. This equates to the set of <interface> elements within the <description> element. If no InterfaceElements exist, an empty array is returned.

Returns:
an array of InterfaceElement

getBindingElements

BindingElement[] getBindingElements()
Return the set of BindingElements within this DescriptionElement. This equates to the set of <binding> elements within the <description> element. If no BindingElements exist, an empty array is returned.

Returns:
an array of BindingElement

getServiceElements

ServiceElement[] getServiceElements()
Return the set of ServiceElements within this DescriptionElement. This equates to the set of <service> elements within the <description> element. If no ServiceElements exist, an empty array is returned.

Returns:
an array of ServiceElement

setExtensionRegistry

void setExtensionRegistry(ExtensionRegistry extReg)
Specify the ExtensionRegistry to be used handle WSDL extensions defined by this DescriptionElement and by any WSDL elements nested within it.

Parameters:
extReg - the ExtensionRegistry used with this description

getExtensionRegistry

ExtensionRegistry getExtensionRegistry()
Return the ExtensionRegistry used handle WSDL extensions defined by this DescriptionElement and by any WSDL elements nested within it.

Returns:
the ExtensionRegistry used with this description

toComponent

Description toComponent()
Return the Description component derived from this DescriptionElement.

The Description component is unlike other WSDL components which map neatly to a single WSDL element. Description represents a 'flattened' view of the entire WSDL infoset tree, including the WSDL components from any imported or included WSDL documents, so it could contain the content of multiple <description> elements.

If this DescriptionElement imports or includes other DescriptionElements (that is, if it is the root of a composite WSDL document), the behaviour of this method is equivalent to traversing the WSDL tree recursively and aggregating the WSDL content of each DescriptionElement into a single Description component.

This equates to retrieving the root <description> element and traversing any <wsdl:import> or <wsdl:include> elements to retrieve WSDL content of any nested <description> elements.

The toComponent() method is only defined for DescriptionElement, not for other WSDL Element interfaces. This is because the WSDL 2.0 Component model is a nested hierarchy with a single Description component at the top. To access WSDL components, we must start at the Description and traverse the component model from there.

Returns:
the Description component derived from this DescriptionElement


Copyright © 2007. All Rights Reserved.