Package org.jibx.binding.def
Class OptionalStructureWrapper
- java.lang.Object
-
- org.jibx.binding.def.PassThroughComponent
-
- org.jibx.binding.def.OptionalStructureWrapper
-
- All Implemented Interfaces:
IComponent,ILinkable
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
Fields Modifier and Type Field Description private booleanm_loadMarshalLoad object for marshalling code generation flag.private PropertyDefinitionm_propertyProperty definition.-
Fields inherited from class org.jibx.binding.def.PassThroughComponent
m_component
-
-
Constructor Summary
Constructors Constructor Description OptionalStructureWrapper(IComponent wrap, PropertyDefinition prop, boolean load)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidgenAttributeMarshal(ContextMethodBuilder mb)Generate attribute marshalling code.voidgenContentMarshal(ContextMethodBuilder mb)Generate element or text marshalling code.voidprint(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
-
-
-
-
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 componentload- flag for need to load object for marshalling code
-
-
Method Detail
-
genAttributeMarshal
public void genAttributeMarshal(ContextMethodBuilder mb) throws JiBXException
Description copied from interface:IComponentGenerate 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:
genAttributeMarshalin interfaceIComponent- Overrides:
genAttributeMarshalin classPassThroughComponent- Parameters:
mb- method builder- Throws:
JiBXException- if error in configuration
-
genContentMarshal
public void genContentMarshal(ContextMethodBuilder mb) throws JiBXException
Description copied from interface:IComponentGenerate 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:
genContentMarshalin interfaceIComponent- Overrides:
genContentMarshalin classPassThroughComponent- Parameters:
mb- method builder- Throws:
JiBXException- if error in configuration
-
print
public void print(int depth)
- Specified by:
printin interfaceIComponent- Overrides:
printin classPassThroughComponent
-
-