public class TypeMappingImpl extends Object implements Serializable
This is the implementation of the axis TypeMapping interface (which extends the JAX-RPC TypeMapping interface).
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 the namespace/class matches is not found in the TypeMapping the request is delegated to the Default TypeMapping or another TypeMapping
Modifier and Type | Class and Description |
---|---|
static class |
TypeMappingImpl.Pair |
Modifier and Type | Field and Description |
---|---|
protected Boolean |
doAutoTypes |
static boolean |
dotnet_soapenc_bugfix
Work around a .NET bug with soap encoded types.
|
protected static org.apache.commons.logging.Log |
log |
Constructor and Description |
---|
TypeMappingImpl()
Construct TypeMapping
|
Modifier and Type | Method and Description |
---|---|
DeserializerFactory |
finalGetDeserializer(Class javaType,
QName xmlType,
TypeMappingDelegate start) |
SerializerFactory |
finalGetSerializer(Class javaType) |
Class[] |
getAllClasses(TypeMappingDelegate next)
Returns an array of all the classes contained within this mapping
|
Class |
getClassForQName(QName xmlType,
Class javaType,
TypeMappingDelegate next) |
DeserializerFactory |
getDeserializer(Class javaType,
QName xmlType,
TypeMappingDelegate start)
Gets the DeserializerFactory registered for the specified pair
of Java type and XML data type.
|
SerializerFactory |
getSerializer(Class javaType,
QName xmlType)
Gets the SerializerFactory registered for the specified pair
of Java type and XML data type.
|
String[] |
getSupportedEncodings()
Gets the list of encoding styles supported by this TypeMapping object.
|
QName |
getTypeQName(Class javaType,
TypeMappingDelegate next) |
QName |
getTypeQNameExact(Class javaType,
TypeMappingDelegate next)
Get the QName for this Java class, but only return a specific
mapping if there is one.
|
QName |
getTypeQNameRecursive(Class javaType)
Gets the QName for the type mapped to Class.
|
QName |
getXMLType(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.
|
protected void |
internalRegister(Class javaType,
QName xmlType,
SerializerFactory sf,
DeserializerFactory dsf)
Internal version of register(), which allows null factories.
|
boolean |
isRegistered(Class javaType,
QName xmlType)
isRegistered returns true if the [javaType, xmlType]
pair is registered.
|
void |
register(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(Class javaType,
QName xmlType)
Removes the DeserializerFactory registered for the specified
pair of Java type and XML data type.
|
void |
removeSerializer(Class javaType,
QName xmlType)
Removes the SerializerFactory registered for the specified
pair of Java type and XML data type.
|
void |
setDoAutoTypes(boolean doAutoTypes) |
void |
setSupportedEncodings(String[] namespaceURIs)
Sets the list of encoding styles supported by this TypeMapping object.
|
boolean |
shouldDoAutoTypes() |
protected static org.apache.commons.logging.Log log
public static boolean dotnet_soapenc_bugfix
protected Boolean doAutoTypes
public String[] getSupportedEncodings()
public void setSupportedEncodings(String[] namespaceURIs)
namespaceURIs
- String[] of namespace URI'spublic boolean isRegistered(Class javaType, QName xmlType)
javaType
- - Class of the Java typexmlType
- - Qualified name of the XML data typepublic void register(Class javaType, QName xmlType, SerializerFactory sf, DeserializerFactory dsf) throws JAXRPCException
javaType
- - Class of the Java typexmlType
- - Qualified name of the XML data typesf
- - SerializerFactorydsf
- - DeserializerFactoryJAXRPCException
- - If any error during the registrationprotected void internalRegister(Class javaType, QName xmlType, SerializerFactory sf, DeserializerFactory dsf) throws JAXRPCException
javaType
- xmlType
- sf
- dsf
- JAXRPCException
public SerializerFactory getSerializer(Class javaType, QName xmlType) throws JAXRPCException
javaType
- - Class of the Java typexmlType
- - Qualified name of the XML data typeJAXRPCException
- - 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 specifiedpublic SerializerFactory finalGetSerializer(Class javaType)
public QName getXMLType(Class javaType, QName xmlType, boolean encoded) throws JAXRPCException
javaType
- xmlType
- JAXRPCException
public DeserializerFactory getDeserializer(Class javaType, QName xmlType, TypeMappingDelegate start) throws JAXRPCException
javaType
- - Class of the Java typexmlType
- - Qualified name of the XML data typeJAXRPCException
- - 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 specifiedpublic DeserializerFactory finalGetDeserializer(Class javaType, QName xmlType, TypeMappingDelegate start)
public void removeSerializer(Class javaType, QName xmlType) throws JAXRPCException
javaType
- - Class of the Java typexmlType
- - Qualified name of the XML data typeJAXRPCException
- - If there is error in
removing the registered SerializerFactorypublic void removeDeserializer(Class javaType, QName xmlType) throws JAXRPCException
javaType
- - Class of the Java typexmlType
- - Qualified name of the XML data typeJAXRPCException
- - If there is error in
removing the registered DeserializerFactorypublic QName getTypeQNameRecursive(Class javaType)
javaType
- class or typepublic QName getTypeQNameExact(Class javaType, TypeMappingDelegate next)
javaType
- public QName getTypeQName(Class javaType, TypeMappingDelegate next)
public Class getClassForQName(QName xmlType, Class javaType, TypeMappingDelegate next)
public void setDoAutoTypes(boolean doAutoTypes)
public boolean shouldDoAutoTypes()
public Class[] getAllClasses(TypeMappingDelegate next)
Copyright © The Apache Software Foundation. All Rights Reserved.