org.apache.axis.encoding
Class DefaultTypeMappingImpl
java.lang.Object
|
+--org.apache.axis.encoding.TypeMappingImpl
|
+--org.apache.axis.encoding.DefaultTypeMappingImpl
- All Implemented Interfaces:
- TypeMapping, TypeMapping
- Direct Known Subclasses:
- DefaultSOAP12TypeMappingImpl
- public class DefaultTypeMappingImpl
- extends TypeMappingImpl
- Author:
- Rich Scheuerle (scheu@us.ibm.com)
This is the implementation of the axis Default TypeMapping (which extends
the JAX-RPC TypeMapping interface) for SOAP 1.1. If you want the JAX-RPC
SOAP 1.2 Type Mapping the use DefaultJAXRPCTypeMapping.
A TypeMapping is obtained from the singleton TypeMappingRegistry using
the namespace of the webservice. The TypeMapping contains the tuples
{Java type, SerializerFactory, DeserializerFactory, Type QName)
So if you have a Web Service with the namespace "XYZ", you call
the TypeMappingRegistry.getTypeMapping("XYZ").
The wsdl in your web service will use a number of types. The tuple
information for each of these will be accessed via the TypeMapping.
Because every web service uses the soap, schema, wsdl primitives, we could
pre-populate the TypeMapping with these standard tuples. Instead, if requested
namespace/class matches is not found in the TypeMapping but matches one these
known primitives, the request is delegated to this Default TypeMapping.
Method Summary |
static TypeMapping |
getSingleton()
Obtain the singleton default typemapping. |
QName |
getTypeQName(java.lang.Class javaType)
Gets the QName for the type mapped to Class. |
protected void |
myRegister(QName xmlType,
java.lang.Class javaType,
SerializerFactory sf,
DeserializerFactory df,
boolean primitive)
Construct TypeMapping for all the [xmlType, javaType] for all of the
known xmlType namespaces |
protected void |
myRegister(QName xmlType,
java.lang.Class javaType,
SerializerFactory sf,
DeserializerFactory df,
boolean primitive,
boolean onlyDeserFactory)
Construct TypeMapping for all the [xmlType, javaType] for all of the
known xmlType namespaces |
void |
register(java.lang.Class javaType,
QName xmlType,
SerializerFactory sf,
DeserializerFactory dsf)
Registers SerializerFactory and DeserializerFactory for a
specific type mapping between an XML type and Java type. |
void |
removeDeserializer(java.lang.Class javaType,
QName xmlType)
Removes the DeserializerFactory registered for the specified
pair of Java type and XML data type. |
void |
removeSerializer(java.lang.Class javaType,
QName xmlType)
Removes the SerializerFactory registered for the specified
pair of Java type and XML data type. |
void |
setSupportedNamespaces(java.lang.String[] namespaceURIs)
Sets the list of encoding styles supported by this TypeMapping object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultTypeMappingImpl
protected DefaultTypeMappingImpl()
getSingleton
public static TypeMapping getSingleton()
- Obtain the singleton default typemapping.
myRegister
protected void myRegister(QName xmlType,
java.lang.Class javaType,
SerializerFactory sf,
DeserializerFactory df,
boolean primitive)
- Construct TypeMapping for all the [xmlType, javaType] for all of the
known xmlType namespaces
- Parameters:
xmlType
- is the QName typejavaType
- is the java typesf
- is the ser factory (if null, the simple factory is used)df
- is the deser factory (if null, the simple factory is used)primitive
- indicates whether serializers can be shared
myRegister
protected void myRegister(QName xmlType,
java.lang.Class javaType,
SerializerFactory sf,
DeserializerFactory df,
boolean primitive,
boolean onlyDeserFactory)
- Construct TypeMapping for all the [xmlType, javaType] for all of the
known xmlType namespaces
- Parameters:
xmlType
- is the QName typejavaType
- is the java typesf
- is the ser factory (if null, the simple factory is used)df
- is the deser factory (if null, the simple factory is used)primitive
- indicates whether serializers can be sharedonlyDeserFactory
- indicates if only deserialization is desired.
getTypeQName
public QName getTypeQName(java.lang.Class javaType)
- Gets the QName for the type mapped to Class.
- Overrides:
getTypeQName
in class TypeMappingImpl
- Parameters:
javaType
- class or type- Returns:
- xmlType qname or null
register
public void register(java.lang.Class javaType,
QName xmlType,
SerializerFactory sf,
DeserializerFactory dsf)
throws JAXRPCException
- Description copied from class:
TypeMappingImpl
- Registers SerializerFactory and DeserializerFactory for a
specific type mapping between an XML type and Java type.
- Overrides:
register
in class TypeMappingImpl
- Following copied from class:
org.apache.axis.encoding.TypeMappingImpl
- Parameters:
javaType
- - Class of the Java typexmlType
- - Qualified name of the XML data typesf
- - SerializerFactorydsf
- - DeserializerFactory- Throws:
JAXRPCException
- - If any error during the registration
removeSerializer
public void removeSerializer(java.lang.Class javaType,
QName xmlType)
throws JAXRPCException
- Description copied from class:
TypeMappingImpl
- Removes the SerializerFactory registered for the specified
pair of Java type and XML data type.
- Overrides:
removeSerializer
in class TypeMappingImpl
- Following copied from class:
org.apache.axis.encoding.TypeMappingImpl
- Parameters:
javaType
- - Class of the Java typexmlType
- - Qualified name of the XML data type- Throws:
JAXRPCException
- - If there is error in
removing the registered SerializerFactory
java.lang.IllegalArgumentException -
If invalid or unsupported XML/Java type is specified
removeDeserializer
public void removeDeserializer(java.lang.Class javaType,
QName xmlType)
throws JAXRPCException
- Description copied from class:
TypeMappingImpl
- Removes the DeserializerFactory registered for the specified
pair of Java type and XML data type.
- Overrides:
removeDeserializer
in class TypeMappingImpl
- Following copied from class:
org.apache.axis.encoding.TypeMappingImpl
- Parameters:
javaType
- - Class of the Java typexmlType
- - Qualified name of the XML data type- Throws:
JAXRPCException
- - If there is error in
removing the registered DeserializerFactory
java.lang.IllegalArgumentException -
If invalid or unsupported XML/Java type is specified
setSupportedNamespaces
public void setSupportedNamespaces(java.lang.String[] namespaceURIs)
- Description copied from class:
TypeMappingImpl
- Sets the list of encoding styles supported by this TypeMapping object.
(Not sure why this is useful...this information is automatically updated
during registration.
- Overrides:
setSupportedNamespaces
in class TypeMappingImpl
- Following copied from class:
org.apache.axis.encoding.TypeMappingImpl
- Parameters:
namespaceURIs
- String[] of namespace URI's
Copyright © 2001 Apache XML Project. All Rights Reserved.