Class MappingReference

  • All Implemented Interfaces:
    IComponent, ILinkable

    public class MappingReference
    extends PassThroughComponent
    Reference to a mapping definition. This is used as a placeholder when building the component structure of a binding definition. It's necessary because the referenced mapping may not have been parsed yet. During the linkage phase that follows parsing this looks up the appropriate mapping definition and sets up the corresponding component structure. Thereafter it operates as a simple pass-through wrapper for the top child component.
    Author:
    Dennis M. Sosnoski
    • Constructor Detail

      • MappingReference

        public MappingReference​(IContainer contain,
                                PropertyDefinition prop,
                                String type,
                                String reftext,
                                String refqname,
                                IContextObj objc,
                                NameDefinition name,
                                boolean synth,
                                boolean nillable)
        Constructor from property and type.
        Parameters:
        contain - containing binding definition structure
        prop - property definition
        type - fully qualified name of mapped type
        reftext - ordinary text name for abstract mapping reference (null if not specified)
        refqname - qualified type name for abstract mapping reference (null if not specified)
        objc - current object context
        name - reference name definition (only allowed with abstract mappings)
        synth - sythentic reference added to empty collection flag
        nillable - flag for nillable element
    • Method Detail

      • getMapping

        public IMapping getMapping()
      • setLinkages

        public void setLinkages()
                         throws org.jibx.runtime.JiBXException
        Description copied from interface: ILinkable
        Establish and validate linkages between binding components. This is called after the basic binding structures have been set up. All linkages between components must be resolved by this method, in order to prevent problems due to the order of definitions between components. This implies that each component must in turn call the same method for each child component. None of the other method calls defined by this interface are valid until after this call.
        Specified by:
        setLinkages in interface ILinkable
        Overrides:
        setLinkages in class PassThroughComponent
        Throws:
        org.jibx.runtime.JiBXException - if error in configuration
      • genContentUnmarshal

        public void genContentUnmarshal​(ContextMethodBuilder mb)
                                 throws org.jibx.runtime.JiBXException
        Patch the generated code to remove the unmarshalled object when it's a "this" reference with both elements and attributes.
        Specified by:
        genContentUnmarshal in interface IComponent
        Overrides:
        genContentUnmarshal in class PassThroughComponent
        Parameters:
        mb - Context Method Builder
        Throws:
        org.jibx.runtime.JiBXException - If error