Package javax.xml.rpc.encoding
Interface TypeMapping
public interface TypeMapping
The
javax.xml.rpc.encoding.TypeMapping is the base
interface for the representation of a type mapping. A TypeMapping
implementation class may support one or more encoding styles.
For its supported encoding styles, a TypeMapping instance
maintains a set of tuples of the type {Java type,
SerializerFactory,
DeserializerFactory, XML type}.
- Version:
- 1.0
- Author:
- Rahul Sharma
-
Method Summary
Modifier and TypeMethodDescriptiongetDeserializer(Class javaType, QName xmlType) Gets the DeserializerFactory registered for the specified pair of Java type and XML data type.getSerializer(Class javaType, QName xmlType) Gets the SerializerFactory registered for the specified pair of Java type and XML data type.String[]Returns the encodingStyle URIs (as String[]) supported by this TypeMapping instance.booleanisRegistered(Class javaType, QName xmlType) Checks whether or not type mapping between specified XML type and Java type is registered.voidregister(Class javaType, QName xmlType, SerializerFactory sf, DeserializerFactory dsf) Registers SerializerFactory and DeserializerFactory for a specific type mapping between an XML type and Java type.voidremoveDeserializer(Class javaType, QName xmlType) Removes the DeserializerFactory registered for the specified pair of Java type and XML data type.voidremoveSerializer(Class javaType, QName xmlType) Removes the SerializerFactory registered for the specified pair of Java type and XML data type.voidsetSupportedEncodings(String[] encodingStyleURIs) Sets the encodingStyle URIs supported by this TypeMapping instance.
-
Method Details
-
getSupportedEncodings
String[] getSupportedEncodings()Returns the encodingStyle URIs (as String[]) supported by this TypeMapping instance. A TypeMapping that contains only encoding style independent serializers and deserializers returnsnullfrom this method.- Returns:
- Array of encodingStyle URIs for the supported encoding styles
-
setSupportedEncodings
Sets the encodingStyle URIs supported by this TypeMapping instance. A TypeMapping that contains only encoding independent serializers and deserializers requiresnullas the parameter for this method.- Parameters:
encodingStyleURIs- Array of encodingStyle URIs for the supported encoding styles
-
isRegistered
Checks whether or not type mapping between specified XML type and Java type is registered.- 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
-
register
Registers SerializerFactory and DeserializerFactory for a specific type mapping between an XML type and Java type. This method replaces any existing registered SerializerFactory DeserializerFactory instances.- Parameters:
javaType- Class of the Java typexmlType- Qualified name of the XML data typesf- SerializerFactorydsf- DeserializerFactory- Throws:
JAXRPCException- If any error during the registration
-
getSerializer
Gets the SerializerFactory registered for the specified pair of Java type and XML data type.- Parameters:
javaType- Class of the Java typexmlType- Qualified name of the XML data type- Returns:
- Registered SerializerFactory or
nullif there is no registered factory
-
getDeserializer
Gets the DeserializerFactory registered for the specified pair of Java type and XML data type.- Parameters:
javaType- Class of the Java typexmlType- Qualified name of the XML data type- Returns:
- Registered DeserializerFactory or
nullif there is no registered factory
-
removeSerializer
Removes the SerializerFactory registered for the specified pair of Java type and XML data type.- Parameters:
javaType- class to remove the Serializer forxmlType- Qualified Name of the XML type- Throws:
JAXRPCException- If there is error in removing the registered SerializerFactory
-
removeDeserializer
Removes the DeserializerFactory registered for the specified pair of Java type and XML data type.- Parameters:
javaType- class to remove the Deserializer forxmlType- Qualified Name of the XML type- Throws:
JAXRPCException- If there is error in removing the registered DeserializerFactory
-