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.String
ABSTRACTMARSHALLER_INTERFACE
protected static java.lang.String
CHECKEXTENDS_FULLNAME
protected static java.lang.String
CHECKEXTENDS_METHODNAME
protected static java.lang.String
CHECKEXTENDS_SIGNATURE
protected static java.lang.String
GETINDEX_METHODNAME
protected static java.lang.String
GETINDEX_SIGNATURE
protected static java.lang.String
GETMARSHALLER_METHOD
protected static java.lang.String
GETMARSHALLER_SIGNATURE
protected static java.lang.String
GETNAME_METHODNAME
protected static java.lang.String
GETNAME_SIGNATURE
protected static java.lang.String
GETUNMARSHALLER_METHOD
protected static java.lang.String
GETUNMARSHALLER_SIGNATURE
protected static java.lang.String
IMARSHALLABLE_INTERFACE
protected static java.lang.String
IUNMARSHALLABLE_INTERFACE
private java.lang.String
m_mappingName
Name used for mapping in binding tables.private java.lang.String
m_typeName
Qualified type name, in text form.protected static java.lang.String
MARSHALLABLE_METHODNAME
protected static java.lang.String
MARSHALLABLE_SIGNATURE
protected static java.lang.String
MARSHALLER_INTERFACE
protected static java.lang.String
MARSHALLERMARSHAL_METHOD
protected static java.lang.String
MARSHALLERMARSHAL_SIGNATURE
protected static java.lang.String
UNMARSHALLABLE_METHODNAME
protected static java.lang.String
UNMARSHALLABLE_SIGNATURE
protected static java.lang.String
UNMARSHALLER_INTERFACE
protected static java.lang.String
UNMARSHALLERUNMARSHAL_METHOD
protected static java.lang.String
UNMARSHALLERUNMARSHAL_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 void
addIMarshallableMethod()
Generate marshallable interface methods for this mapping.protected void
addIUnmarshallableMethod()
Generate unmarshallable interface method for this mapping.abstract BoundClass
getBoundClass()
Get the mapped class information.java.lang.String
getMappingName()
Get the mapping name used in binding tables.java.lang.String
getTypeName()
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 JiBXException
Generate 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 JiBXException
Generate 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:IMapping
Get the mapping name used in binding tables.- Specified by:
getMappingName
in interfaceIMapping
- Returns:
- name
-
getTypeName
public java.lang.String getTypeName()
Description copied from interface:IMapping
Get type name.- Specified by:
getTypeName
in interfaceIMapping
- Returns:
- qualified type name, in text form (
null
if unnamed)
-
-