org.jibx.binding.def
Class MappingBase

java.lang.Object
  extended by org.jibx.binding.def.PassThroughComponent
      extended by org.jibx.binding.def.LinkableBase
          extended by org.jibx.binding.def.MappingBase
All Implemented Interfaces:
IComponent, 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
protected static java.lang.String ABSTRACTMARSHALLER_INTERFACE
           
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 GETUNMARSHALLER_METHOD
           
protected static java.lang.String GETUNMARSHALLER_SIGNATURE
           
protected static java.lang.String IMARSHALLABLE_INTERFACE
           
protected static java.lang.String IUNMARSHALLABLE_INTERFACE
           
private  int m_indexNumber
          Index number for this particular binding definition.
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
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
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.
 int getIndex()
          Get mapped class index number.
 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.IMapping
addExtension, addNamespace, buildRef, generateCode, getBoundType, getImplComponent, getMarshaller, getName, getNamespaces, getReferenceType, getUnmarshaller, isAbstract, isBase
 
Methods inherited from interface org.jibx.binding.def.IComponent
genAttributeMarshal, genAttributeUnmarshal, genAttrPresentTest, genContentMarshal, genContentPresentTest, genContentUnmarshal, genLoadId, genNewInstance, getType, getWrapperName, hasAttribute, hasContent, hasId, isOptional, print, setLinkages
 

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

CHECKEXTENDS_METHODNAME

protected static final java.lang.String CHECKEXTENDS_METHODNAME
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_indexNumber

private final int m_indexNumber
Index number for this particular binding definition.


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 the PassThroughComponent.setWrappedComponent(org.jibx.binding.def.IComponent) method.

Parameters:
contain - containing binding definition structure
type - class name handled by mapping
tname - 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 structure
type - class name handled by mapping
tname - qualified type name, in text form
wrap - 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

getIndex

public int getIndex()
Description copied from interface: IMapping
Get mapped class index number.

Specified by:
getIndex in interface IMapping
Returns:
mapped class index number in context

getTypeName

public java.lang.String getTypeName()
Description copied from interface: IMapping
Get type name.

Specified by:
getTypeName in interface IMapping
Returns:
qualified type name, in text form (null if unnamed)


Project Web Site