Package org.jibx.binding.def
Class MappingBase
- java.lang.Object
-
- org.jibx.binding.def.PassThroughComponent
-
- org.jibx.binding.def.LinkableBase
-
- org.jibx.binding.def.MappingBase
-
- All Implemented Interfaces:
IComponent,ILinkable,IMapping
- Direct Known Subclasses:
MappingDefinition,MappingDirect
public abstract class MappingBase extends LinkableBase implements IMapping
Base class for mapping definitions. This is used for both normal and custom mappings. It handles adding the appropriate marshalling and/or unmarshalling interfaces and methods to the classes.
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringABSTRACTMARSHALLER_INTERFACEprotected static java.lang.StringCHECKEXTENDS_FULLNAMEprotected static java.lang.StringCHECKEXTENDS_METHODNAMEprotected static java.lang.StringCHECKEXTENDS_SIGNATUREprotected static java.lang.StringGETINDEX_METHODNAMEprotected static java.lang.StringGETINDEX_SIGNATUREprotected static java.lang.StringGETMARSHALLER_METHODprotected static java.lang.StringGETMARSHALLER_SIGNATUREprotected static java.lang.StringGETNAME_METHODNAMEprotected static java.lang.StringGETNAME_SIGNATUREprotected static java.lang.StringGETUNMARSHALLER_METHODprotected static java.lang.StringGETUNMARSHALLER_SIGNATUREprotected static java.lang.StringIMARSHALLABLE_INTERFACEprotected static java.lang.StringIUNMARSHALLABLE_INTERFACEprivate java.lang.Stringm_mappingNameName used for mapping in binding tables.private java.lang.Stringm_typeNameQualified type name, in text form.protected static java.lang.StringMARSHALLABLE_METHODNAMEprotected static java.lang.StringMARSHALLABLE_SIGNATUREprotected static java.lang.StringMARSHALLER_INTERFACEprotected static java.lang.StringMARSHALLERMARSHAL_METHODprotected static java.lang.StringMARSHALLERMARSHAL_SIGNATUREprotected static java.lang.StringUNMARSHALLABLE_METHODNAMEprotected static java.lang.StringUNMARSHALLABLE_SIGNATUREprotected static java.lang.StringUNMARSHALLER_INTERFACEprotected static java.lang.StringUNMARSHALLERUNMARSHAL_METHODprotected static java.lang.StringUNMARSHALLERUNMARSHAL_SIGNATURE-
Fields inherited from class org.jibx.binding.def.PassThroughComponent
m_component
-
-
Constructor Summary
Constructors Constructor Description MappingBase(IContainer contain, java.lang.String type, java.lang.String tname)Constructor.MappingBase(IContainer contain, java.lang.String type, java.lang.String tname, IComponent wrap)Constructor with wrapped component supplied.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidaddIMarshallableMethod()Generate marshallable interface methods for this mapping.protected voidaddIUnmarshallableMethod()Generate unmarshallable interface method for this mapping.abstract BoundClassgetBoundClass()Get the mapped class information.java.lang.StringgetMappingName()Get the mapping name used in binding tables.java.lang.StringgetTypeName()Get type name.-
Methods inherited from class org.jibx.binding.def.LinkableBase
handleRecursion, isLinked, print, setLinkages
-
Methods inherited from class org.jibx.binding.def.PassThroughComponent
genAttributeMarshal, genAttributeUnmarshal, genAttrPresentTest, genContentMarshal, genContentPresentTest, genContentUnmarshal, genLoadId, genNewInstance, getType, getWrapperName, hasAttribute, hasContent, hasId, isOptional, setWrappedComponent
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jibx.binding.def.ILinkable
setLinkages
-
Methods inherited from interface org.jibx.binding.def.IMapping
addExtension, addNamespace, buildRef, generateCode, getBinding, getBoundType, getImplComponent, getMarshaller, getName, getNamespaces, getReferenceType, getUnmarshaller, isAbstract, isBase
-
-
-
-
Field Detail
-
IMARSHALLABLE_INTERFACE
protected static final java.lang.String IMARSHALLABLE_INTERFACE
- See Also:
- Constant Field Values
-
MARSHALLABLE_METHODNAME
protected static final java.lang.String MARSHALLABLE_METHODNAME
- See Also:
- Constant Field Values
-
MARSHALLABLE_SIGNATURE
protected static final java.lang.String MARSHALLABLE_SIGNATURE
- See Also:
- Constant Field Values
-
GETINDEX_METHODNAME
protected static final java.lang.String GETINDEX_METHODNAME
- See Also:
- Constant Field Values
-
GETINDEX_SIGNATURE
protected static final java.lang.String GETINDEX_SIGNATURE
- See Also:
- Constant Field Values
-
GETNAME_METHODNAME
protected static final java.lang.String GETNAME_METHODNAME
- See Also:
- Constant Field Values
-
GETNAME_SIGNATURE
protected static final java.lang.String GETNAME_SIGNATURE
- See Also:
- Constant Field Values
-
CHECKEXTENDS_METHODNAME
protected static final java.lang.String CHECKEXTENDS_METHODNAME
- See Also:
- Constant Field Values
-
CHECKEXTENDS_FULLNAME
protected static final java.lang.String CHECKEXTENDS_FULLNAME
- See Also:
- Constant Field Values
-
CHECKEXTENDS_SIGNATURE
protected static final java.lang.String CHECKEXTENDS_SIGNATURE
- See Also:
- Constant Field Values
-
IUNMARSHALLABLE_INTERFACE
protected static final java.lang.String IUNMARSHALLABLE_INTERFACE
- See Also:
- Constant Field Values
-
UNMARSHALLABLE_METHODNAME
protected static final java.lang.String UNMARSHALLABLE_METHODNAME
- See Also:
- Constant Field Values
-
UNMARSHALLABLE_SIGNATURE
protected static final java.lang.String UNMARSHALLABLE_SIGNATURE
- See Also:
- Constant Field Values
-
UNMARSHALLER_INTERFACE
protected static final java.lang.String UNMARSHALLER_INTERFACE
- See Also:
- Constant Field Values
-
UNMARSHALLERUNMARSHAL_METHOD
protected static final java.lang.String UNMARSHALLERUNMARSHAL_METHOD
- See Also:
- Constant Field Values
-
UNMARSHALLERUNMARSHAL_SIGNATURE
protected static final java.lang.String UNMARSHALLERUNMARSHAL_SIGNATURE
- See Also:
- Constant Field Values
-
MARSHALLER_INTERFACE
protected static final java.lang.String MARSHALLER_INTERFACE
- See Also:
- Constant Field Values
-
ABSTRACTMARSHALLER_INTERFACE
protected static final java.lang.String ABSTRACTMARSHALLER_INTERFACE
- See Also:
- Constant Field Values
-
MARSHALLERMARSHAL_METHOD
protected static final java.lang.String MARSHALLERMARSHAL_METHOD
- See Also:
- Constant Field Values
-
MARSHALLERMARSHAL_SIGNATURE
protected static final java.lang.String MARSHALLERMARSHAL_SIGNATURE
- See Also:
- Constant Field Values
-
GETMARSHALLER_METHOD
protected static final java.lang.String GETMARSHALLER_METHOD
- See Also:
- Constant Field Values
-
GETMARSHALLER_SIGNATURE
protected static final java.lang.String GETMARSHALLER_SIGNATURE
- See Also:
- Constant Field Values
-
GETUNMARSHALLER_METHOD
protected static final java.lang.String GETUNMARSHALLER_METHOD
- See Also:
- Constant Field Values
-
GETUNMARSHALLER_SIGNATURE
protected static final java.lang.String GETUNMARSHALLER_SIGNATURE
- See Also:
- Constant Field Values
-
m_mappingName
private final java.lang.String m_mappingName
Name used for mapping in binding tables.
-
m_typeName
private final java.lang.String m_typeName
Qualified type name, in text form.
-
-
Constructor Detail
-
MappingBase
public MappingBase(IContainer contain, java.lang.String type, java.lang.String tname)
Constructor. This version requires the component to be set later, using thePassThroughComponent.setWrappedComponent(org.jibx.binding.def.IComponent)method.- Parameters:
contain- containing binding definition structuretype- class name handled by mappingtname- qualified type name, in text form
-
MappingBase
public MappingBase(IContainer contain, java.lang.String type, java.lang.String tname, IComponent wrap)
Constructor with wrapped component supplied.- Parameters:
contain- containing binding definition structuretype- class name handled by mappingtname- qualified type name, in text formwrap- wrapped binding component
-
-
Method Detail
-
getBoundClass
public abstract BoundClass getBoundClass()
Get the mapped class information. This must be implemented in each subclass to return the type of the bound class.- Returns:
- information for mapped class
-
addIMarshallableMethod
protected void addIMarshallableMethod() throws JiBXExceptionGenerate marshallable interface methods for this mapping. This is not applicable to abstract mappings, since they cannot be marshalled as separate items.- Throws:
JiBXException- if error in generating code
-
addIUnmarshallableMethod
protected void addIUnmarshallableMethod() throws JiBXExceptionGenerate unmarshallable interface method for this mapping. This is not applicable to abstract mappings, since they cannot be unmarshalled as separate items.- Throws:
JiBXException- if error in generating code
-
getMappingName
public java.lang.String getMappingName()
Description copied from interface:IMappingGet the mapping name used in binding tables.- Specified by:
getMappingNamein interfaceIMapping- Returns:
- name
-
getTypeName
public java.lang.String getTypeName()
Description copied from interface:IMappingGet type name.- Specified by:
getTypeNamein interfaceIMapping- Returns:
- qualified type name, in text form (
nullif unnamed)
-
-