org.jibx.binding.def
Class OptionalStructureWrapper

java.lang.Object
  extended byorg.jibx.binding.def.PassThroughComponent
      extended byorg.jibx.binding.def.OptionalStructureWrapper
All Implemented Interfaces:
IComponent

public class OptionalStructureWrapper
extends PassThroughComponent

Component decorator for optional structure with associated property. This just handles necessary glue code generation for the marshalling operations, where the presence of the structure needs to be tested before actually handling tag generation.


Field Summary
private  boolean m_loadMarshal
          Load object for marshalling code generation flag.
private  PropertyDefinition m_property
          Property definition.
 
Fields inherited from class org.jibx.binding.def.PassThroughComponent
m_component
 
Constructor Summary
OptionalStructureWrapper(IComponent wrap, PropertyDefinition prop, boolean load)
          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)
           
 
Methods inherited from class org.jibx.binding.def.PassThroughComponent
genAttributeUnmarshal, genAttrPresentTest, genContentPresentTest, genContentUnmarshal, genLoadId, genNewInstance, getType, getWrapperName, hasAttribute, hasContent, hasId, isOptional, setLinkages, setWrappedComponent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_property

private final PropertyDefinition m_property
Property definition.


m_loadMarshal

private final boolean m_loadMarshal
Load object for marshalling code generation flag.

Constructor Detail

OptionalStructureWrapper

public OptionalStructureWrapper(IComponent wrap,
                                PropertyDefinition prop,
                                boolean load)
Constructor.

Parameters:
wrap - wrapped binding component
load - flag for need to load object for marshalling code
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
Throws:
JiBXException

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
Throws:
JiBXException

print

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


Project Web Site