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 inherited from class org.jibx.binding.def.PassThroughComponent
m_component
-
-
Constructor Summary
Constructors Constructor Description MappingBase(IContainer contain, String type, String tname)Constructor.MappingBase(IContainer contain, String type, 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.StringgetMappingName()Get the mapping name used in binding tables.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 String IMARSHALLABLE_INTERFACE
- See Also:
- Constant Field Values
-
MARSHALLABLE_METHODNAME
protected static final String MARSHALLABLE_METHODNAME
- See Also:
- Constant Field Values
-
MARSHALLABLE_SIGNATURE
protected static final String MARSHALLABLE_SIGNATURE
- See Also:
- Constant Field Values
-
GETINDEX_METHODNAME
protected static final String GETINDEX_METHODNAME
- See Also:
- Constant Field Values
-
GETINDEX_SIGNATURE
protected static final String GETINDEX_SIGNATURE
- See Also:
- Constant Field Values
-
GETNAME_METHODNAME
protected static final String GETNAME_METHODNAME
- See Also:
- Constant Field Values
-
GETNAME_SIGNATURE
protected static final String GETNAME_SIGNATURE
- See Also:
- Constant Field Values
-
CHECKEXTENDS_METHODNAME
protected static final String CHECKEXTENDS_METHODNAME
- See Also:
- Constant Field Values
-
CHECKEXTENDS_FULLNAME
protected static final String CHECKEXTENDS_FULLNAME
- See Also:
- Constant Field Values
-
CHECKEXTENDS_SIGNATURE
protected static final String CHECKEXTENDS_SIGNATURE
- See Also:
- Constant Field Values
-
IUNMARSHALLABLE_INTERFACE
protected static final String IUNMARSHALLABLE_INTERFACE
- See Also:
- Constant Field Values
-
UNMARSHALLABLE_METHODNAME
protected static final String UNMARSHALLABLE_METHODNAME
- See Also:
- Constant Field Values
-
UNMARSHALLABLE_SIGNATURE
protected static final String UNMARSHALLABLE_SIGNATURE
- See Also:
- Constant Field Values
-
UNMARSHALLER_INTERFACE
protected static final String UNMARSHALLER_INTERFACE
- See Also:
- Constant Field Values
-
UNMARSHALLERUNMARSHAL_METHOD
protected static final String UNMARSHALLERUNMARSHAL_METHOD
- See Also:
- Constant Field Values
-
UNMARSHALLERUNMARSHAL_SIGNATURE
protected static final String UNMARSHALLERUNMARSHAL_SIGNATURE
- See Also:
- Constant Field Values
-
MARSHALLER_INTERFACE
protected static final String MARSHALLER_INTERFACE
- See Also:
- Constant Field Values
-
ABSTRACTMARSHALLER_INTERFACE
protected static final String ABSTRACTMARSHALLER_INTERFACE
- See Also:
- Constant Field Values
-
MARSHALLERMARSHAL_METHOD
protected static final String MARSHALLERMARSHAL_METHOD
- See Also:
- Constant Field Values
-
MARSHALLERMARSHAL_SIGNATURE
protected static final String MARSHALLERMARSHAL_SIGNATURE
- See Also:
- Constant Field Values
-
GETMARSHALLER_METHOD
protected static final String GETMARSHALLER_METHOD
- See Also:
- Constant Field Values
-
GETMARSHALLER_SIGNATURE
protected static final String GETMARSHALLER_SIGNATURE
- See Also:
- Constant Field Values
-
GETUNMARSHALLER_METHOD
protected static final String GETUNMARSHALLER_METHOD
- See Also:
- Constant Field Values
-
GETUNMARSHALLER_SIGNATURE
protected static final String GETUNMARSHALLER_SIGNATURE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MappingBase
public MappingBase(IContainer contain, String type, 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, String type, 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 org.jibx.runtime.JiBXExceptionGenerate marshallable interface methods for this mapping. This is not applicable to abstract mappings, since they cannot be marshalled as separate items.- Throws:
org.jibx.runtime.JiBXException- if error in generating code
-
addIUnmarshallableMethod
protected void addIUnmarshallableMethod() throws org.jibx.runtime.JiBXExceptionGenerate unmarshallable interface method for this mapping. This is not applicable to abstract mappings, since they cannot be unmarshalled as separate items.- Throws:
org.jibx.runtime.JiBXException- if error in generating code
-
getMappingName
public String getMappingName()
Description copied from interface:IMappingGet the mapping name used in binding tables.- Specified by:
getMappingNamein interfaceIMapping- Returns:
- name
-
getTypeName
public String getTypeName()
Description copied from interface:IMappingGet type name.- Specified by:
getTypeNamein interfaceIMapping- Returns:
- qualified type name, in text form (
nullif unnamed)
-
-