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.
    • Constructor Detail

      • 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 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.JiBXException
        Generate 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.JiBXException
        Generate 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: 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)