org.jibx.binding.def
Class MappingReference

java.lang.Object
  extended by org.jibx.binding.def.PassThroughComponent
      extended by org.jibx.binding.def.MappingReference
All Implemented Interfaces:
IComponent

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.

Version:
1.0
Author:
Dennis M. Sosnoski

Field Summary
private  IContainer m_container
          Containing binding definition structure.
private  IContextObj m_contextObject
          Context object.
private  boolean m_isSynthetic
          Synthetic reference added to empty collection flag
private  NameDefinition m_name
          Name from reference (only allowed with abstract mappings)
private  PropertyDefinition m_property
          Property definition.
private  java.lang.String m_type
          Fully qualified name of mapped type, or type name for mapping.
 
Fields inherited from class org.jibx.binding.def.PassThroughComponent
m_component
 
Constructor Summary
MappingReference(IContainer contain, PropertyDefinition prop, java.lang.String type, IContextObj objc, NameDefinition name, boolean synth)
          Constructor from property and type.
 
Method Summary
 java.lang.String getType()
          Get type expected by component.
 void print(int depth)
           
 void setLinkages()
          Establish and validate linkages between binding components.
 
Methods inherited from class org.jibx.binding.def.PassThroughComponent
checkContentSequence, genAttributeMarshal, genAttributeUnmarshal, genAttrPresentTest, genContentMarshal, genContentPresentTest, genContentUnmarshal, genLoadId, genNewInstance, hasAttribute, hasContent, hasId, isOptional, setWrappedComponent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_container

private final IContainer m_container
Containing binding definition structure.


m_property

private final PropertyDefinition m_property
Property definition.


m_type

private java.lang.String m_type
Fully qualified name of mapped type, or type name for mapping.


m_contextObject

private final IContextObj m_contextObject
Context object.


m_name

private final NameDefinition m_name
Name from reference (only allowed with abstract mappings)


m_isSynthetic

private final boolean m_isSynthetic
Synthetic reference added to empty collection flag

Constructor Detail

MappingReference

public MappingReference(IContainer contain,
                        PropertyDefinition prop,
                        java.lang.String type,
                        IContextObj objc,
                        NameDefinition name,
                        boolean synth)
Constructor from property and type.

Parameters:
contain - containing binding definition structure
prop - property definition
type - fully qualified name of mapped type (may also be type name for abstract mapping)
objc - current object context
name - reference name definition (only allowed with abstract mappings)
synth - sythentic reference added to empty collection flag
Method Detail

getType

public java.lang.String getType()
Description copied from interface: IComponent
Get type expected by component.

Specified by:
getType in interface IComponent
Overrides:
getType in class PassThroughComponent
Returns:
fully qualified class name of expected type

setLinkages

public void setLinkages()
                 throws JiBXException
Description copied from interface: IComponent
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 IComponent
Overrides:
setLinkages in class PassThroughComponent
Throws:
JiBXException - if error in configuration

print

public void print(int depth)
Specified by:
print in interface IComponent
Overrides:
print in class PassThroughComponent


Project Web Site