com.sun.xml.ws.model.wsdl
Class AbstractExtensibleImpl

java.lang.Object
  extended by com.sun.xml.ws.model.wsdl.AbstractObjectImpl
      extended by com.sun.xml.ws.model.wsdl.AbstractExtensibleImpl
All Implemented Interfaces:
WSDLExtensible, WSDLObject
Direct Known Subclasses:
AbstractFeaturedObjectImpl, WSDLBoundFaultImpl, WSDLBoundOperationImpl, WSDLFaultImpl, WSDLInputImpl, WSDLMessageImpl, WSDLModelImpl, WSDLOperationImpl, WSDLOutputImpl, WSDLPortTypeImpl, WSDLServiceImpl

abstract class AbstractExtensibleImpl
extends AbstractObjectImpl
implements WSDLExtensible

All the WSDL 1.1 elements that are extensible should subclass from this abstract implementation of WSDLExtensible interface.


Nested Class Summary
protected  class AbstractExtensibleImpl.UnknownWSDLExtension
           
 
Field Summary
protected  Set<WSDLExtension> extensions
           
protected  List<AbstractExtensibleImpl.UnknownWSDLExtension> notUnderstoodExtensions
           
 
Constructor Summary
protected AbstractExtensibleImpl(String systemId, int lineNumber)
           
protected AbstractExtensibleImpl(javax.xml.stream.XMLStreamReader xsr)
           
 
Method Summary
 void addExtension(WSDLExtension ex)
          Adds a new WSDLExtension to this object.
 void addNotUnderstoodExtension(QName extnEl, Locator locator)
          This can be used if a WSDL extension element that has wsdl:required=true is not understood
 boolean areRequiredExtensionsUnderstood()
          This method should be called after freezing the WSDLModel
<T extends WSDLExtension>
T
getExtension(Class<T> type)
          Gets the extension that is assignable to the given type.
 Iterable<WSDLExtension> getExtensions()
          Gets all the WSDLExtensions added through WSDLExtensible.addExtension(WSDLExtension).
<T extends WSDLExtension>
Iterable<T>
getExtensions(Class<T> type)
          Gets all the extensions that is assignable to the given type.
 
Methods inherited from class com.sun.xml.ws.model.wsdl.AbstractObjectImpl
getLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sun.xml.ws.api.model.wsdl.WSDLObject
getLocation
 

Field Detail

extensions

protected final Set<WSDLExtension> extensions

notUnderstoodExtensions

protected List<AbstractExtensibleImpl.UnknownWSDLExtension> notUnderstoodExtensions
Constructor Detail

AbstractExtensibleImpl

protected AbstractExtensibleImpl(javax.xml.stream.XMLStreamReader xsr)

AbstractExtensibleImpl

protected AbstractExtensibleImpl(String systemId,
                                 int lineNumber)
Method Detail

getExtensions

public final Iterable<WSDLExtension> getExtensions()
Description copied from interface: WSDLExtensible
Gets all the WSDLExtensions added through WSDLExtensible.addExtension(WSDLExtension).

Specified by:
getExtensions in interface WSDLExtensible
Returns:
never null.

getExtensions

public final <T extends WSDLExtension> Iterable<T> getExtensions(Class<T> type)
Description copied from interface: WSDLExtensible
Gets all the extensions that is assignable to the given type.

This allows clients to find specific extensions in a type-safe and convenient way.

Specified by:
getExtensions in interface WSDLExtensible
Parameters:
type - The type of the extension to obtain. Must not be null.
Returns:
Can be an empty fromjava.collection but never null.

getExtension

public <T extends WSDLExtension> T getExtension(Class<T> type)
Description copied from interface: WSDLExtensible
Gets the extension that is assignable to the given type.

This is just a convenient version that does

 Iterator itr = getExtensions(type);
 if(itr.hasNext())  return itr.next();
 else               return null;
 

Specified by:
getExtension in interface WSDLExtensible
Returns:
null if the extension was not found.

addExtension

public void addExtension(WSDLExtension ex)
Description copied from interface: WSDLExtensible
Adds a new WSDLExtension to this object.

Specified by:
addExtension in interface WSDLExtensible
Parameters:
ex - must not be null.

addNotUnderstoodExtension

public void addNotUnderstoodExtension(QName extnEl,
                                      Locator locator)
This can be used if a WSDL extension element that has wsdl:required=true is not understood

Parameters:
extnEl -
locator -

areRequiredExtensionsUnderstood

public boolean areRequiredExtensionsUnderstood()
This method should be called after freezing the WSDLModel

Returns:
true if all wsdl required extensions on Port and Binding are understood