Apache CXF API

org.apache.cxf.aegis.type
Class DefaultTypeMapping

java.lang.Object
  extended by org.apache.cxf.aegis.type.DefaultTypeMapping
All Implemented Interfaces:
TypeMapping

public class DefaultTypeMapping
extends Object
implements TypeMapping

The implementation of the Aegis type map. It maintains a map from Java types Type and AegisType objects, also indexed by the XML Schema QName of each type.


Field Summary
static String DEFAULT_MAPPING_URI
           
 
Constructor Summary
DefaultTypeMapping()
           
DefaultTypeMapping(String identifierURI)
           
DefaultTypeMapping(String identifierURI, TypeMapping defaultTM)
           
 
Method Summary
static DefaultTypeMapping createDefaultTypeMapping(boolean defaultNillable, boolean enableMtomXmime)
           
static DefaultTypeMapping createDefaultTypeMapping(boolean defaultNillable, boolean enableMtomXmime, boolean enableJDOM)
          Create a set of default type mappings.
static DefaultTypeMapping createSoap11TypeMapping(boolean defaultNillable, boolean enableMtomXmime)
           
static DefaultTypeMapping createSoap11TypeMapping(boolean defaultNillable, boolean enableMtomXmime, boolean enableJDOM)
          Create a type mapping object with a stock set of mappings, including the SOAP 1.1 'encoded' types.
 String getMappingIdentifierURI()
          Each mapping has a URI that identifies it.
 TypeMapping getParent()
           
 AegisType getType(QName xmlType)
           
 AegisType getType(Type javaType)
           
 TypeCreator getTypeCreator()
           
 QName getTypeQName(Type clazz)
           
 boolean isRegistered(QName xmlType)
          Returns a flag indicating if this type mapping has a mapping for a particular XML Schema QName.
 boolean isRegistered(Type javaType)
          Returns a flag indicating if this type mapping has a mapping for a particular Java class.
 void register(AegisType type)
          Register a type that self-describes the schema type and the Java class.
 void register(Type javaType, QName xmlType, AegisType type)
          Register a type, manually specifying the java class, the schema type, and the Aegis type object that provides serialization, deserialization, and schema.
 void removeType(AegisType type)
           
 void setMappingIdentifierURI(String uri)
          This exists only to deal with an initialization order problem.
 void setTypeCreator(TypeCreator typeCreator)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MAPPING_URI

public static final String DEFAULT_MAPPING_URI
See Also:
Constant Field Values
Constructor Detail

DefaultTypeMapping

public DefaultTypeMapping(String identifierURI,
                          TypeMapping defaultTM)

DefaultTypeMapping

public DefaultTypeMapping()

DefaultTypeMapping

public DefaultTypeMapping(String identifierURI)
Method Detail

isRegistered

public boolean isRegistered(Type javaType)
Description copied from interface: TypeMapping
Returns a flag indicating if this type mapping has a mapping for a particular Java class.

Specified by:
isRegistered in interface TypeMapping
Parameters:
javaType - the class.
Returns:
true if there is a mapping for the type.

isRegistered

public boolean isRegistered(QName xmlType)
Description copied from interface: TypeMapping
Returns a flag indicating if this type mapping has a mapping for a particular XML Schema QName.

Specified by:
isRegistered in interface TypeMapping
Parameters:
xmlType - the QName.
Returns:
true if there is a mapping for the type.

register

public void register(Type javaType,
                     QName xmlType,
                     AegisType type)
Description copied from interface: TypeMapping
Register a type, manually specifying the java class, the schema type, and the Aegis type object that provides serialization, deserialization, and schema.

Specified by:
register in interface TypeMapping
Parameters:
javaType - Java class.
xmlType - XML Schema type QName.
type - Aegis type object.

register

public void register(AegisType type)
Register a type that self-describes the schema type and the Java class.

Specified by:
register in interface TypeMapping
Parameters:
type - Aegis type object that

removeType

public void removeType(AegisType type)
Specified by:
removeType in interface TypeMapping

getType

public AegisType getType(Type javaType)
Specified by:
getType in interface TypeMapping

getType

public AegisType getType(QName xmlType)
Specified by:
getType in interface TypeMapping

getTypeQName

public QName getTypeQName(Type clazz)
Specified by:
getTypeQName in interface TypeMapping

getTypeCreator

public TypeCreator getTypeCreator()
Specified by:
getTypeCreator in interface TypeMapping

setTypeCreator

public void setTypeCreator(TypeCreator typeCreator)

getParent

public TypeMapping getParent()

createSoap11TypeMapping

public static DefaultTypeMapping createSoap11TypeMapping(boolean defaultNillable,
                                                         boolean enableMtomXmime)

createSoap11TypeMapping

public static DefaultTypeMapping createSoap11TypeMapping(boolean defaultNillable,
                                                         boolean enableMtomXmime,
                                                         boolean enableJDOM)
Create a type mapping object with a stock set of mappings, including the SOAP 1.1 'encoded' types.

Parameters:
defaultNillable - whether elements are nillable by default.
enableMtomXmime - whether to enable XMIME annotations with MTOM.
enableJDOM - whether to add mappings for JDOM.
Returns:

createDefaultTypeMapping

public static DefaultTypeMapping createDefaultTypeMapping(boolean defaultNillable,
                                                          boolean enableMtomXmime)

createDefaultTypeMapping

public static DefaultTypeMapping createDefaultTypeMapping(boolean defaultNillable,
                                                          boolean enableMtomXmime,
                                                          boolean enableJDOM)
Create a set of default type mappings.

Parameters:
defaultNillable - whether elements are nillable by default.
enableMtomXmime - whether to enable XMIME annotations on MTOM.
enableJDOM - whether to map JDOM types.
Returns:

getMappingIdentifierURI

public String getMappingIdentifierURI()
Description copied from interface: TypeMapping
Each mapping has a URI that identifies it. The mapping for a service uses the service URI. XML files can choose to only contribute mappings that match.

Specified by:
getMappingIdentifierURI in interface TypeMapping
Returns:
the URI.

setMappingIdentifierURI

public void setMappingIdentifierURI(String uri)
Description copied from interface: TypeMapping
This exists only to deal with an initialization order problem.

Specified by:
setMappingIdentifierURI in interface TypeMapping

Apache CXF API

Apache CXF