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.DocumentableImpl
          extended by org.apache.woden.internal.wsdl20.WSDLComponentImpl
              extended by org.apache.woden.internal.wsdl20.DescriptionImpl
All Implemented Interfaces:
Description, AttributeExtensible, ElementExtensible, PropertyExtensible, WSDLComponent, DescriptionElement, DocumentableElement, WSDLElement

public class DescriptionImpl
extends WSDLComponentImpl
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(WSDLContext wsdlContext)
           
 
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.
 ServiceElement addServiceElement()
          Create a ServiceElement with this DescriptionElement as its parent and return a reference to it.
 TypesElement addTypesElement()
          Create a TypesElement with this DescriptionElement as its parent and return a reference to it.
 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.
 FragmentIdentifier getFragmentIdentifier()
          Returns the fragment identifier for this WSDL 2.0 component.
 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.
 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 setDocumentBaseURI(java.net.URI documentBaseURI)
          Set the document base URI to the specified URI.
 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.WSDLComponentImpl
containsComponent, equals, getComponentExtensionContext, getExtensionProperties, getExtensionProperties, getExtensionProperty, setComponentExtensionContext, toString
 
Methods inherited from class org.apache.woden.internal.wsdl20.DocumentableImpl
addDocumentationElement, getDocumentationElements
 
Methods inherited from class org.apache.woden.internal.wsdl20.WSDLElementImpl
addExtensionElement, addNamespace, getDeclaredNamespaces, getExtensionAttribute, getExtensionAttributes, getExtensionAttributesForNamespace, getExtensionElements, getExtensionElementsOfType, getInScopeNamespaces, getNamespacePrefix, getNamespaceURI, hasExtensionAttributesForNamespace, hasExtensionElementsForNamespace, removeExtensionElement, removeNamespace, setExtensionAttribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.woden.wsdl20.WSDLComponent
equals, getComponentExtensionContext, setComponentExtensionContext, toString
 
Methods inherited from interface org.apache.woden.wsdl20.extensions.PropertyExtensible
getExtensionProperties, getExtensionProperties, getExtensionProperty
 
Methods inherited from interface org.apache.woden.wsdl20.xml.DocumentableElement
addDocumentationElement, getDocumentationElements
 
Methods inherited from interface org.apache.woden.wsdl20.xml.WSDLElement
addNamespace, getDeclaredNamespaces, getInScopeNamespaces, getNamespacePrefix, getNamespaceURI, removeNamespace
 
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(WSDLContext wsdlContext)
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.

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, this method will return null.

Specified by:
getTypesElement in interface DescriptionElement
Returns:
the TypesElement

addTypesElement

public TypesElement addTypesElement()
                             throws WSDLException
Description copied from interface: DescriptionElement
Create a TypesElement with this DescriptionElement as its parent and return a reference to it. If a TypesElement already exists for this DescriptionElement a WSDLException will be thrown.

Specified by:
addTypesElement in interface DescriptionElement
Returns:
the TypesElement
Throws:
WSDLException

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

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

getFragmentIdentifier

public FragmentIdentifier getFragmentIdentifier()
Description copied from interface: WSDLComponent
Returns the fragment identifier for this WSDL 2.0 component.

Specified by:
getFragmentIdentifier in interface WSDLComponent
Returns:
a FragmentIdentifier for this WSDL 2.0 component.


Copyright © 2005-2010 Apache Software Foundation. All Rights Reserved.