org.apache.woden.internal.wsdl20
Class DescriptionImpl

java.lang.Object
  extended by org.apache.woden.internal.wsdl20.WSDLElementImpl
      extended by org.apache.woden.internal.wsdl20.WSDLObjectImpl
          extended by org.apache.woden.internal.wsdl20.DocumentableImpl
              extended by org.apache.woden.internal.wsdl20.DescriptionImpl
All Implemented Interfaces:
Description, AttributeExtensible, ElementExtensible, WSDLComponent, DescriptionElement, DocumentableElement, WSDLElement

public class DescriptionImpl
extends DocumentableImpl
implements Description, DescriptionElement

This class provides the implementation for a Description component from the WSDL Component Model, as described in the WSDL 2.0 specification.

Note: this class is different to the other WSDL implementation classes, which all implement two Java interfaces; a component model interface and the interface for the corresponding WSDL element. Different implementations are used for the Description component and for the <wsdl:description> element because the latter exposes the composite structure of imported and included WSDL documents, while the Description component 'flattens' this structure into an abstract view of the WSDL. A separate implementation class, DescriptionElementImpl, exists to represent the <wsdl:description> element.

Author:
jkaputin@apache.org

Constructor Summary
DescriptionImpl()
           
 
Method Summary
 BindingElement addBindingElement()
          Create a BindingElement with this DescriptionElement as its parent and return a reference to it.
 void addElementDeclaration(ElementDeclaration elDec)
           
 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.
 void addTypeDefinition(TypeDefinition typeDef)
           
 Binding getBinding(QName name)
          Returns a Binding with the specified name from the {bindings} property of this Description.
 BindingElement[] getBindingElements()
          Return the set of BindingElements within this DescriptionElement.
 Binding[] getBindings()
          Represents the {bindings} property of the Description component.
 java.net.URI getDocumentBaseURI()
          Return the document base URI that was used to locate the <description> element that this DescriptionElement corresponds to.
 ElementDeclaration getElementDeclaration(QName qname)
          Returns the ElementDeclaration with the specified name from the set of ElementDeclarations represented by the {element declarations} property of this Description.
 ElementDeclaration[] getElementDeclarations()
          Represents the {element declarations} property of the Description component.
 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.
 Interface getInterface(QName name)
          Returns an Interface with the specified name from the {interfaces} property of this Description.
 InterfaceElement[] getInterfaceElements()
          Return the set of InterfaceElements within this DescriptionElement.
 Interface[] getInterfaces()
          Represents the {interfaces} property of the Description component.
 java.net.URI getNamespace(java.lang.String prefix)
          Return the namespace URI associated with the specified prefix.
 java.util.Map getNamespaces()
          Return the set of all prefix/namespace URI associations.
 Service getService(QName name)
          Returns a Service with the specified name from the {services} property of this Description.
 ServiceElement[] getServiceElements()
          Return the set of ServiceElements within this DescriptionElement.
 Service[] getServices()
          Represents the {services} property of the Description component.
 java.net.URI getTargetNamespace()
          Return the target namespace URI.
 TypeDefinition getTypeDefinition(QName qname)
          Returns the TypeDefinition with the specified name from the set of TypeDefinitions represented by the {type definitions} property of this Description.
 TypeDefinition[] getTypeDefinitions()
          Represents the {type definitions} property of the Description component.
 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 namespace)
          Set the target namespace to the specified URI.
 Description toComponent()
          Return the Description component derived from this DescriptionElement.
 DescriptionElement toElement()
          Returns a WSDLElement that represents the element information item from the WSDL 2.0 infoset that maps to this WSDLComponent.
 
Methods inherited from class org.apache.woden.internal.wsdl20.DocumentableImpl
addDocumentationElement, getDocumentationElements
 
Methods inherited from class org.apache.woden.internal.wsdl20.WSDLObjectImpl
containsComponent, equals, getComponentExtensionsForNamespace, setComponentExtensions
 
Methods inherited from class org.apache.woden.internal.wsdl20.WSDLElementImpl
addExtensionElement, getExtensionAttribute, getExtensionAttributes, getExtensionAttributesForNamespace, getExtensionElements, getExtensionElementsOfType, hasExtensionAttributesForNamespace, hasExtensionElementsForNamespace, removeExtensionElement, setExtensionAttribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.woden.wsdl20.WSDLComponent
equals, getComponentExtensionsForNamespace
 
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
 

Constructor Detail

DescriptionImpl

public DescriptionImpl()
Method Detail

getInterfaces

public Interface[] getInterfaces()
Description copied from interface: Description
Represents the {interfaces} property of the Description component. This is the set of all interfaces available to the Description, including those that are declared in the root WSDL document and any declared in included or imported WSDL documents.

Specified by:
getInterfaces in interface Description
Returns:
an array of Interface objects

getInterface

public Interface getInterface(QName name)
Description copied from interface: Description
Returns an Interface with the specified name from the {interfaces} property of this Description.

Specified by:
getInterface in interface Description
Parameters:
name - the QName of the required Interface
Returns:
an Interface with the specified name

getBindings

public Binding[] getBindings()
Description copied from interface: Description
Represents the {bindings} property of the Description component. This is the set of all bindings available to the Description, including those that are declared in the root WSDL document and any declared in included or imported WSDL documents.

Specified by:
getBindings in interface Description
Returns:
an array of Binding objects

getBinding

public Binding getBinding(QName name)
Description copied from interface: Description
Returns a Binding with the specified name from the {bindings} property of this Description.

Specified by:
getBinding in interface Description
Parameters:
name - the QName of the required Binding
Returns:
a Binding with the specified name

getServices

public Service[] getServices()
Description copied from interface: Description
Represents the {services} property of the Description component. This is the set of all services available to the Description, including those that are declared in the root WSDL document and any declared in included or imported WSDL documents.

Specified by:
getServices in interface Description
Returns:
an array of Service objects

getService

public Service getService(QName name)
Description copied from interface: Description
Returns a Service with the specified name from the {services} property of this Description.

Specified by:
getService in interface Description
Parameters:
name - the QName of the required Service
Returns:
a Service with the specified name

getElementDeclarations

public ElementDeclaration[] getElementDeclarations()
Description copied from interface: Description
Represents the {element declarations} property of the Description component. This is the set of all global element declarations available to the Description, including those that are declared by schemas inlined or imported by the root WSDL document and those declared by schemas inlined or imported by WSDL documents that the root WSDL document includes or imports, directly or indirectly.

Specified by:
getElementDeclarations in interface Description
Returns:
an array of ElementDeclaration objects

getElementDeclaration

public ElementDeclaration getElementDeclaration(QName qname)
Description copied from interface: Description
Returns the ElementDeclaration with the specified name from the set of ElementDeclarations represented by the {element declarations} property of this Description.

Specified by:
getElementDeclaration in interface Description
Parameters:
qname - the QName of the required ElementDeclaration
Returns:
the named ElementDeclaration

getTypeDefinitions

public TypeDefinition[] getTypeDefinitions()
Description copied from interface: Description
Represents the {type definitions} property of the Description component. This is the set of all global type definitions available to the Description, including those that are defined by schemas inlined or imported by the root WSDL document and those defined by schemas inlined or imported by WSDL documents that the root WSDL document includes or imports, directly or indirectly.

Specified by:
getTypeDefinitions in interface Description
Returns:
an array of TypeDefinition objects

getTypeDefinition

public TypeDefinition getTypeDefinition(QName qname)
Description copied from interface: Description
Returns the TypeDefinition with the specified name from the set of TypeDefinitions represented by the {type definitions} property of this Description.

Specified by:
getTypeDefinition in interface Description
Parameters:
qname - the QName of the required TypeDefinition
Returns:
the named TypeDefinition

toElement

public DescriptionElement toElement()
Description copied from interface: Description
Returns a WSDLElement that represents the element information item from the WSDL 2.0 infoset that maps to this WSDLComponent.

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 <wsdl:description> elements.

If the Component model has been derived from such a composite WSDL infoset, the behaviour of this method is to return the DescriptionElement that represents the root <wsdl:description> element.

Specified by:
toElement in interface Description
Returns:
the DescriptionElement that maps to this Description

setDocumentBaseURI

public void setDocumentBaseURI(java.net.URI documentBaseURI)
Description copied from interface: DescriptionElement
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.

Specified by:
setDocumentBaseURI in interface DescriptionElement
Parameters:
documentBaseURI - the base URI of the WSDL

getDocumentBaseURI

public java.net.URI getDocumentBaseURI()
Description copied from interface: DescriptionElement
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.

Specified by:
getDocumentBaseURI in interface DescriptionElement
Returns:
the document base URI

setTargetNamespace

public void setTargetNamespace(java.net.URI namespace)
Description copied from interface: DescriptionElement
Set the target namespace to the specified URI. This corresponds to the targetNamespace attribute of the <description> element.

Specified by:
setTargetNamespace in interface DescriptionElement
Parameters:
namespace - the target namespace URI

getTargetNamespace

public java.net.URI getTargetNamespace()
Description copied from interface: DescriptionElement
Return the target namespace URI. This corresponds to the targetNamespace attribute of the <description> element.

Specified by:
getTargetNamespace in interface DescriptionElement
Returns:
the target namespace URI.

addNamespace

public void addNamespace(java.lang.String prefix,
                         java.net.URI namespace)
Description copied from interface: DescriptionElement
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.

Specified by:
addNamespace in interface DescriptionElement
Parameters:
prefix - the prefix String associated with namespace
namespace - the namespace URI associated with prefix

removeNamespace

public void removeNamespace(java.lang.String prefix)
Description copied from interface: DescriptionElement
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.

Specified by:
removeNamespace in interface DescriptionElement
Parameters:
prefix - the prefix String associated with a namespace

getNamespace

public java.net.URI getNamespace(java.lang.String prefix)
Description copied from interface: DescriptionElement
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.

Specified by:
getNamespace in interface DescriptionElement
Parameters:
prefix - the prefix String associated with a namespace

getNamespaces

public java.util.Map getNamespaces()
Description copied from interface: DescriptionElement
Return the set of all prefix/namespace URI associations. This equates to all of the xmlns namespace declaration on the <description> element.

Specified by:
getNamespaces in interface DescriptionElement
Returns:
a Map of prefix String / namespace URI pairs

getImportElements

public ImportElement[] getImportElements()
Description copied from interface: DescriptionElement
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.

Specified by:
getImportElements in interface DescriptionElement
Returns:
an array of ImportElement

getIncludeElements

public IncludeElement[] getIncludeElements()
Description copied from interface: DescriptionElement
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.

Specified by:
getIncludeElements in interface DescriptionElement
Returns:
an array of IncludeElement

getTypesElement

public TypesElement getTypesElement()
Description copied from interface: DescriptionElement
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

Specified by:
getTypesElement in interface DescriptionElement
Returns:
the TypesElement

getInterfaceElements

public InterfaceElement[] getInterfaceElements()
Description copied from interface: DescriptionElement
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.

Specified by:
getInterfaceElements in interface DescriptionElement
Returns:
an array of InterfaceElement

getBindingElements

public BindingElement[] getBindingElements()
Description copied from interface: DescriptionElement
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.

Specified by:
getBindingElements in interface DescriptionElement
Returns:
an array of BindingElement

getServiceElements

public ServiceElement[] getServiceElements()
Description copied from interface: DescriptionElement
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.

Specified by:
getServiceElements in interface DescriptionElement
Returns:
an array of ServiceElement

addImportElement

public ImportElement addImportElement()
Description copied from interface: DescriptionElement
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.

Specified by:
addImportElement in interface DescriptionElement
Returns:
the ImportElement

addIncludeElement

public IncludeElement addIncludeElement()
Description copied from interface: DescriptionElement
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.

Specified by:
addIncludeElement in interface DescriptionElement
Returns:
the IncludeElement

addInterfaceElement

public InterfaceElement addInterfaceElement()
Description copied from interface: DescriptionElement
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.

Specified by:
addInterfaceElement in interface DescriptionElement
Returns:
the InterfaceElement

addBindingElement

public BindingElement addBindingElement()
Description copied from interface: DescriptionElement
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.

Specified by:
addBindingElement in interface DescriptionElement
Returns:
the BindingElement

addServiceElement

public ServiceElement addServiceElement()
Description copied from interface: DescriptionElement
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.

Specified by:
addServiceElement in interface DescriptionElement
Returns:
the ServiceElement

setExtensionRegistry

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

Specified by:
setExtensionRegistry in interface DescriptionElement
Parameters:
extReg - the ExtensionRegistry used with this description

getExtensionRegistry

public ExtensionRegistry getExtensionRegistry()
Description copied from interface: DescriptionElement
Return the ExtensionRegistry used handle WSDL extensions defined by this DescriptionElement and by any WSDL elements nested within it.

Specified by:
getExtensionRegistry in interface DescriptionElement
Returns:
the ExtensionRegistry used with this description

toComponent

public Description toComponent()
Description copied from interface: DescriptionElement
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.

Specified by:
toComponent in interface DescriptionElement
Returns:
the Description component derived from this DescriptionElement

addElementDeclaration

public void addElementDeclaration(ElementDeclaration elDec)

addTypeDefinition

public void addTypeDefinition(TypeDefinition typeDef)


Copyright © 2007. All Rights Reserved.