Package org.apache.axis.encoding
Class TypeMappingDelegate
- java.lang.Object
-
- org.apache.axis.encoding.TypeMappingDelegate
-
- All Implemented Interfaces:
java.io.Serializable,TypeMapping,TypeMapping
public class TypeMappingDelegate extends java.lang.Object implements TypeMapping
The TypeMapping delegate is used to simply delegate to the indicated type mapping. It is used by the TypeMappingRegistry to assist with chaining.- Author:
- Rich Scheuerle (scheu@us.ibm.com)
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class[]getAllClasses()Returns an array of all the classes contained within this mappingjava.lang.ClassgetClassForQName(QName xmlType)Gets the Class mapped to QName.java.lang.ClassgetClassForQName(QName xmlType, java.lang.Class javaType)Gets the Class mapped to QName, preferring the passed Class if possibleDeserializerFactorygetDeserializer(java.lang.Class javaType, QName xmlType)Gets the DeserializerFactory registered for the specified pair of Java type and XML data type.DeserializerFactorygetDeserializer(java.lang.Class javaType, QName xmlType, TypeMappingDelegate start)DeserializerFactorygetDeserializer(QName xmlType)Gets the DeserializerFactory registered for the specified XML data type.TypeMappingDelegategetNext()getDelegate gets the new Delegate TypeMappingSerializerFactorygetSerializer(java.lang.Class javaType)Gets the SerializerFactory registered for the specified pair of Java type and XML data type.SerializerFactorygetSerializer(java.lang.Class javaType, QName xmlType)Gets the SerializerFactory registered for the specified pair of Java type and XML data type.java.lang.String[]getSupportedEncodings()JAX-RPC Compliant Method DefinitionsQNamegetTypeQName(java.lang.Class javaType)Gets the QName for the type mapped to Class.QNamegetTypeQNameExact(java.lang.Class javaType)Get the QName for this Java class, but only return a specific mapping if there is one.QNamegetXMLType(java.lang.Class javaType, QName xmlType, boolean encoded)Get the exact XML type QName which will be used when serializing a given Class to a given type QName.booleanisRegistered(java.lang.Class javaType, QName xmlType)Checks whether or not type mapping between specified XML type and Java type is registered.voidregister(java.lang.Class javaType, QName xmlType, SerializerFactory sf, DeserializerFactory dsf)always throws an exceptionvoidremoveDeserializer(java.lang.Class javaType, QName xmlType)Removes the DeserializerFactory registered for the specified pair of Java type and XML data type.voidremoveSerializer(java.lang.Class javaType, QName xmlType)Removes the SerializerFactory registered for the specified pair of Java type and XML data type.voidsetDoAutoTypes(boolean doAutoTypes)voidsetNext(TypeMappingDelegate next)setDelegate sets the new Delegate TypeMappingvoidsetSupportedEncodings(java.lang.String[] namespaceURIs)Sets the encodingStyle URIs supported by this TypeMapping instance.
-
-
-
Method Detail
-
getSupportedEncodings
public java.lang.String[] getSupportedEncodings()
JAX-RPC Compliant Method Definitions- Specified by:
getSupportedEncodingsin interfaceTypeMapping- Returns:
- Array of encodingStyle URIs for the supported encoding styles
-
setSupportedEncodings
public void setSupportedEncodings(java.lang.String[] namespaceURIs)
Description copied from interface:TypeMappingSets the encodingStyle URIs supported by this TypeMapping instance. A TypeMapping that contains only encoding independent serializers and deserializers requiresnullas the parameter for this method.- Specified by:
setSupportedEncodingsin interfaceTypeMapping- Parameters:
namespaceURIs- Array of encodingStyle URIs for the supported encoding styles
-
register
public void register(java.lang.Class javaType, QName xmlType, SerializerFactory sf, DeserializerFactory dsf) throws JAXRPCExceptionalways throws an exception- Specified by:
registerin interfaceTypeMapping- Parameters:
javaType-xmlType-sf-dsf-- Throws:
JAXRPCException
-
getSerializer
public SerializerFactory getSerializer(java.lang.Class javaType, QName xmlType) throws JAXRPCException
Description copied from interface:TypeMappingGets the SerializerFactory registered for the specified pair of Java type and XML data type.- Specified by:
getSerializerin interfaceTypeMapping- Parameters:
javaType- Class of the Java typexmlType- Qualified name of the XML data type- Returns:
- Registered SerializerFactory or
nullif there is no registered factory - Throws:
JAXRPCException
-
getSerializer
public SerializerFactory getSerializer(java.lang.Class javaType) throws JAXRPCException
Description copied from interface:TypeMappingGets the SerializerFactory registered for the specified pair of Java type and XML data type.- Specified by:
getSerializerin interfaceTypeMapping- Parameters:
javaType- - Class of the Java type- Returns:
- Registered SerializerFactory
- Throws:
JAXRPCException- - If there is no registered SerializerFactory for this pair of Java type and XML data type java.lang.IllegalArgumentException If invalid or unsupported XML/Java type is specified
-
getDeserializer
public DeserializerFactory getDeserializer(java.lang.Class javaType, QName xmlType) throws JAXRPCException
Description copied from interface:TypeMappingGets the DeserializerFactory registered for the specified pair of Java type and XML data type.- Specified by:
getDeserializerin interfaceTypeMapping- Parameters:
javaType- Class of the Java typexmlType- Qualified name of the XML data type- Returns:
- Registered SerializerFactory or
nullif there is no registered factory - Throws:
JAXRPCException
-
getDeserializer
public DeserializerFactory getDeserializer(java.lang.Class javaType, QName xmlType, TypeMappingDelegate start) throws JAXRPCException
- Throws:
JAXRPCException
-
getDeserializer
public DeserializerFactory getDeserializer(QName xmlType) throws JAXRPCException
Description copied from interface:TypeMappingGets the DeserializerFactory registered for the specified XML data type.- Specified by:
getDeserializerin interfaceTypeMapping- Parameters:
xmlType- - Qualified name of the XML data type- Returns:
- Registered DeserializerFactory
- Throws:
JAXRPCException- - If there is no registered DeserializerFactory for this pair of Java type and XML data type java.lang.IllegalArgumentException - If invalid or unsupported XML/Java type is specified
-
removeSerializer
public void removeSerializer(java.lang.Class javaType, QName xmlType) throws JAXRPCExceptionDescription copied from interface:TypeMappingRemoves the SerializerFactory registered for the specified pair of Java type and XML data type.- Specified by:
removeSerializerin interfaceTypeMapping- Parameters:
javaType- Class of the Java typexmlType- Qualified name of the XML data type- Throws:
JAXRPCException- if there is any error that prevents removal of the registered SerializerFactory
-
removeDeserializer
public void removeDeserializer(java.lang.Class javaType, QName xmlType) throws JAXRPCExceptionDescription copied from interface:TypeMappingRemoves the DeserializerFactory registered for the specified pair of Java type and XML data type.- Specified by:
removeDeserializerin interfaceTypeMapping- Parameters:
javaType- Class of the Java typexmlType- Qualified name of the XML data type- Throws:
JAXRPCException- if there is any error in removing the registered DeserializerFactory
-
isRegistered
public boolean isRegistered(java.lang.Class javaType, QName xmlType)Description copied from interface:TypeMappingChecks whether or not type mapping between specified XML type and Java type is registered.- Specified by:
isRegisteredin interfaceTypeMapping- Parameters:
javaType- Class of the Java typexmlType- Qualified name of the XML data type- Returns:
- boolean;
trueif type mapping between the specified XML type and Java type is registered; otherwisefalse
-
getTypeQName
public QName getTypeQName(java.lang.Class javaType)
Gets the QName for the type mapped to Class.- Specified by:
getTypeQNamein interfaceTypeMapping- Parameters:
javaType- class or type- Returns:
- xmlType qname or null
-
getClassForQName
public java.lang.Class getClassForQName(QName xmlType)
Gets the Class mapped to QName.- Specified by:
getClassForQNamein interfaceTypeMapping- Parameters:
xmlType- qname or null- Returns:
- javaType class for type or null for no mappingor delegate
-
getClassForQName
public java.lang.Class getClassForQName(QName xmlType, java.lang.Class javaType)
Gets the Class mapped to QName, preferring the passed Class if possible- Specified by:
getClassForQNamein interfaceTypeMapping- Parameters:
xmlType- qname or nulljavaType- a Java class- Returns:
- javaType class for type or null for no mappingor delegate
-
getTypeQNameExact
public QName getTypeQNameExact(java.lang.Class javaType)
Get the QName for this Java class, but only return a specific mapping if there is one. In other words, don't do special array processing, etc.- Specified by:
getTypeQNameExactin interfaceTypeMapping- Parameters:
javaType-- Returns:
-
setNext
public void setNext(TypeMappingDelegate next)
setDelegate sets the new Delegate TypeMapping
-
getNext
public TypeMappingDelegate getNext()
getDelegate gets the new Delegate TypeMapping
-
getAllClasses
public java.lang.Class[] getAllClasses()
Returns an array of all the classes contained within this mapping- Specified by:
getAllClassesin interfaceTypeMapping
-
getXMLType
public QName getXMLType(java.lang.Class javaType, QName xmlType, boolean encoded) throws JAXRPCException
Get the exact XML type QName which will be used when serializing a given Class to a given type QName. In other words, if we have: Class TypeQName ---------------------- Base myNS:Base Child myNS:Child and call getXMLType(Child.class, BASE_QNAME), we should get CHILD_QNAME.- Specified by:
getXMLTypein interfaceTypeMapping- Parameters:
javaType-xmlType-- Returns:
- the type's QName
- Throws:
JAXRPCException
-
setDoAutoTypes
public void setDoAutoTypes(boolean doAutoTypes)
-
-