Class 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 Details

  • Constructor Details

    • MappingBase

      public MappingBase(IContainer contain, String type, 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, String type, 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 Details

    • 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 String getMappingName()
      Description copied from interface: IMapping
      Get the mapping name used in binding tables.
      Specified by:
      getMappingName in interface IMapping
      Returns:
      name
    • getTypeName

      public 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)