javax.wsdl.extensions
Class ExtensionRegistry
java.lang.Object
javax.wsdl.extensions.ExtensionRegistry
- java.io.Serializable
public class ExtensionRegistry
extends java.lang.Object
implements java.io.Serializable
This class is used to associate serializers, deserializers, and
Java implementation types with extensibility elements.
- Matthew J. Duftler (duftler@us.ibm.com)
- Serialized Form
ExtensionRegistry() - Creates the extension registry, and sets the defaultSerializer
and defaultDeserializer properties to instances of an
UnknownExtensionSerializer, and an UnknownExtensionDeserializer,
respectively.
|
ExtensibilityElement | createExtension(Class parentType, QName elementType) - Create an instance of the type which was declared to be used to
represent extensibility elements with qnames matching elementType,
when intended to exist as children of the specified parentType.
|
Set | getAllowableExtensions(Class parentType) - Returns a set of QNames representing the extensibility elements
that are allowed as children of the specified parent type.
|
ExtensionDeserializer | getDefaultDeserializer() - Get the deserializer to be used when none is found for an encountered
element.
|
ExtensionSerializer | getDefaultSerializer() - Get the serializer to be used when none is found for an extensibility
element.
|
void | mapExtensionTypes(Class parentType, QName elementType, Class extensionType) - Declare that the specified extensionType is the concrete
class which should be used to represent extensibility elements
with qnames matching elementType, that are intended to exist as
children of the specified parentType.
|
ExtensionDeserializer | queryDeserializer(Class parentType, QName elementType) - Look up the deserializer for the extensibility element with the
qname elementType, which was encountered as an immediate child
of the element represented by the specified parentType.
|
int | queryExtensionAttributeType(Class parentType, QName attrName) - Look up the type of the extensibility attribute with the qname attrName,
which was defined on an element represented by the specified parentType.
|
ExtensionSerializer | querySerializer(Class parentType, QName elementType) - Look up the serializer to use for the extensibility element with
the qname elementType, which was encountered as a child of the
specified parentType.
|
void | registerDeserializer(Class parentType, QName elementType, ExtensionDeserializer ed) - Declare that the specified deserializer should be used to deserialize
all extensibility elements with a qname matching elementType, when
encountered as immediate children of the element represented by the
specified parentType.
|
void | registerExtensionAttributeType(Class parentType, QName attrName, int attrType) - Declare that the type of the specified extension attribute, when it occurs
as an attribute of the specified parent type, should be assumed to be
attrType.
|
void | registerSerializer(Class parentType, QName elementType, ExtensionSerializer es) - Declare that the specified serializer should be used to serialize
all extensibility elements with a qname matching elementType, when
encountered as children of the specified parentType.
|
void | setDefaultDeserializer(ExtensionDeserializer defaultDeser) - Set the deserializer to be used when none is found for an encountered
element.
|
void | setDefaultSerializer(ExtensionSerializer defaultSer) - Set the serializer to be used when none is found for an extensibility
element.
|
deserializerReg
protected Map deserializerReg
extensionAttributeTypeReg
protected Map extensionAttributeTypeReg
extensionTypeReg
protected Map extensionTypeReg
serialVersionUID
public static final long serialVersionUID
- 1L
serializerReg
protected Map serializerReg
ExtensionRegistry
public ExtensionRegistry()
Creates the extension registry, and sets the defaultSerializer
and defaultDeserializer properties to instances of an
UnknownExtensionSerializer, and an UnknownExtensionDeserializer,
respectively.
createExtension
public ExtensibilityElement createExtension(Class parentType,
QName elementType)
throws WSDLException
Create an instance of the type which was declared to be used to
represent extensibility elements with qnames matching elementType,
when intended to exist as children of the specified parentType.
This method allows a user to instantiate an extensibility element
without having to know the implementing type.
parentType
- a class object indicating where in the WSDL
definition this extension will exist. For example,
javax.wsdl.Binding.class would be used to indicate
this extensibility element is going to be added to the list of
extensibility elements belonging to a javax.wsdl.Binding,
after being instantiated.elementType
- the qname of the extensibility element
- a new instance of the type used to represent the
specified extension
mapExtensionTypes(Class,QName,Class)
getAllowableExtensions
public Set getAllowableExtensions(Class parentType)
Returns a set of QNames representing the extensibility elements
that are allowed as children of the specified parent type.
Basically, this method returns the keys associated with the set
of extension deserializers registered for this parent type.
Returns null if no extension deserializers are registered for
this parent type.
getDefaultDeserializer
public ExtensionDeserializer getDefaultDeserializer()
Get the deserializer to be used when none is found for an encountered
element. Default value is an instance of UnknownExtensionDeserializer.
UnknownExtensionDeserializer
getDefaultSerializer
public ExtensionSerializer getDefaultSerializer()
Get the serializer to be used when none is found for an extensibility
element. Default value is an instance of UnknownExtensionSerializer.
UnknownExtensionSerializer
mapExtensionTypes
public void mapExtensionTypes(Class parentType,
QName elementType,
Class extensionType)
Declare that the specified extensionType is the concrete
class which should be used to represent extensibility elements
with qnames matching elementType, that are intended to exist as
children of the specified parentType.
parentType
- a class object indicating where in the WSDL
definition this extension would exist. For example,
javax.wsdl.Binding.class would be used to indicate
this extensibility element would be added to the list of
extensibility elements belonging to a javax.wsdl.Binding,
after being instantiated.elementType
- the qname of the extensibility elementextensionType
- the concrete class which should be instantiated
createExtension(Class,QName)
queryDeserializer
public ExtensionDeserializer queryDeserializer(Class parentType,
QName elementType)
throws WSDLException
Look up the deserializer for the extensibility element with the
qname elementType, which was encountered as an immediate child
of the element represented by the specified parentType.
parentType
- a class object indicating where in the WSDL
document this extensibility element was encountered. For
example, javax.wsdl.Binding.class would be used to indicate
this element was encountered as an immediate child of
a <wsdl:binding> element.elementType
- the qname of the extensibility element
- the extension deserializer, if one was found. If none was
found, the behavior depends on the value of the defaultDeserializer
property. If the defaultDeserializer property is set to a non-null
value, that value is returned; otherwise, a WSDLException is thrown.
registerDeserializer(Class,QName,ExtensionDeserializer)
, setDefaultDeserializer(ExtensionDeserializer)
queryExtensionAttributeType
public int queryExtensionAttributeType(Class parentType,
QName attrName)
Look up the type of the extensibility attribute with the qname attrName,
which was defined on an element represented by the specified parentType.
parentType
- a class object indicating where in the WSDL
document this extensibility attribute was encountered. For
example, javax.wsdl.Binding.class would be used to indicate
this attribute was defined on a <wsdl:binding> element.attrName
- the qname of the extensibility attribute
- one of the constants defined on the AttributeExtensible class
registerExtensionAttributeType(Class,QName,int)
, AttributeExtensible
querySerializer
public ExtensionSerializer querySerializer(Class parentType,
QName elementType)
throws WSDLException
Look up the serializer to use for the extensibility element with
the qname elementType, which was encountered as a child of the
specified parentType.
parentType
- a class object indicating where in the WSDL
definition this extension was encountered. For
example, javax.wsdl.Binding.class would be used to indicate
this extensibility element was found in the list of
extensibility elements belonging to a javax.wsdl.Binding.elementType
- the qname of the extensibility element
- the extension serializer, if one was found. If none was
found, the behavior depends on the value of the defaultSerializer
property. If the defaultSerializer property is set to a non-null
value, that value is returned; otherwise, a WSDLException is
thrown.
registerSerializer(Class,QName,ExtensionSerializer)
, setDefaultSerializer(ExtensionSerializer)
registerDeserializer
public void registerDeserializer(Class parentType,
QName elementType,
ExtensionDeserializer ed)
Declare that the specified deserializer should be used to deserialize
all extensibility elements with a qname matching elementType, when
encountered as immediate children of the element represented by the
specified parentType.
parentType
- a class object indicating where in the WSDL
document this extensibility element was encountered. For
example, javax.wsdl.Binding.class would be used to indicate
this element was encountered as an immediate child of
a <wsdl:binding> element.elementType
- the qname of the extensibility elemented
- the extension deserializer to use
queryDeserializer(Class,QName)
registerExtensionAttributeType
public void registerExtensionAttributeType(Class parentType,
QName attrName,
int attrType)
Declare that the type of the specified extension attribute, when it occurs
as an attribute of the specified parent type, should be assumed to be
attrType.
parentType
- a class object indicating where in the WSDL
document this extensibility attribute was encountered. For
example, javax.wsdl.Binding.class would be used to indicate
this attribute was defined on a <wsdl:binding> element.attrName
- the qname of the extensibility attributeattrType
- one of the constants defined on the AttributeExtensible
class
queryExtensionAttributeType(Class,QName)
, AttributeExtensible
registerSerializer
public void registerSerializer(Class parentType,
QName elementType,
ExtensionSerializer es)
Declare that the specified serializer should be used to serialize
all extensibility elements with a qname matching elementType, when
encountered as children of the specified parentType.
parentType
- a class object indicating where in the WSDL
definition this extension was encountered. For
example, javax.wsdl.Binding.class would be used to indicate
this extensibility element was found in the list of
extensibility elements belonging to a javax.wsdl.Binding.elementType
- the qname of the extensibility elementes
- the extension serializer to use
querySerializer(Class,QName)
setDefaultDeserializer
public void setDefaultDeserializer(ExtensionDeserializer defaultDeser)
Set the deserializer to be used when none is found for an encountered
element. Set this to null to have an exception thrown when
unexpected extensibility elements are encountered. Default value is
an instance of UnknownExtensionDeserializer.
UnknownExtensionDeserializer
setDefaultSerializer
public void setDefaultSerializer(ExtensionSerializer defaultSer)
Set the serializer to be used when none is found for an extensibility
element. Set this to null to have an exception thrown when
unexpected extensibility elements are encountered. Default value is
an instance of UnknownExtensionSerializer.
UnknownExtensionSerializer
Copyright B) 2003,2005 IBM. All Rights Reserved.