org.jibx.binding.def
Class StructureReference

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

public class StructureReference
extends PassThroughComponent

Reference to a structure definition. This is used as a placeholder when building the component structure of a binding definition. It's necessary because the referenced structure may not have been parsed yet. During the linkage phase that follows parsing this looks up the appropriate structure 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

Field Summary
 
Fields inherited from class org.jibx.binding.def.PassThroughComponent
m_component
 
Constructor Summary
StructureReference(IContainer contain, String label, PropertyDefinition prop, boolean hasname, IContextObj cobj)
          Constructor.
 
Method Summary
 void genAttributeMarshal(ContextMethodBuilder mb)
          Generate attribute marshalling code.
 void genContentMarshal(ContextMethodBuilder mb)
          Generate element or text marshalling code.
 void print(int depth)
           
 void setLinkages()
          Establish and validate linkages between binding components.
 
Methods inherited from class org.jibx.binding.def.PassThroughComponent
genAttributeUnmarshal, genAttrPresentTest, 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
 

Constructor Detail

StructureReference

public StructureReference(IContainer contain,
                          String label,
                          PropertyDefinition prop,
                          boolean hasname,
                          IContextObj cobj)
Constructor.

Parameters:
contain - containing binding component
label - reference structure identifier
prop - property definition (may be null)
hasname - element name used with reference flag
cobj - context object
Method Detail

genAttributeMarshal

public void genAttributeMarshal(ContextMethodBuilder mb)
                         throws JiBXException
Description copied from interface: IComponent
Generate attribute marshalling code. This is called within the code generation for the marshaller of the class associated with the containing element. It needs to generate the necessary code for handling the marshalling operation, consuming the marshalled object reference from the stack.

Specified by:
genAttributeMarshal in interface IComponent
Overrides:
genAttributeMarshal in class PassThroughComponent
Parameters:
mb - method builder
Throws:
JiBXException - if error in configuration

genContentMarshal

public void genContentMarshal(ContextMethodBuilder mb)
                       throws JiBXException
Description copied from interface: IComponent
Generate element or text marshalling code. This is called within the code generation for the marshaller of the class associated with the containing element. It needs to generate the necessary code for handling the marshalling operation, consuming the marshalled object reference from the stack.

Specified by:
genContentMarshal in interface IComponent
Overrides:
genContentMarshal in class PassThroughComponent
Parameters:
mb - method builder
Throws:
JiBXException - if error in configuration

setLinkages

public void setLinkages()
                 throws 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:
JiBXException - if error in configuration

print

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


Copyright © 2005-2011 jibx.org. All Rights Reserved.