Package org.jibx.binding.def
Class ComponentProperty
- java.lang.Object
-
- org.jibx.binding.def.PassThroughComponent
-
- org.jibx.binding.def.ComponentProperty
-
- All Implemented Interfaces:
IComponent,ILinkable
public class ComponentProperty extends PassThroughComponent
Property reference with binding defined by component. This handles loading and storing the property value, calling the wrapped component methods for everything else.- Author:
- Dennis M. Sosnoski
-
-
Field Summary
-
Fields inherited from class org.jibx.binding.def.PassThroughComponent
m_component
-
-
Constructor Summary
Constructors Constructor Description ComponentProperty(PropertyDefinition prop, IComponent impl, boolean skip)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidgenAttributeMarshal(ContextMethodBuilder mb)Generate attribute marshalling code.voidgenAttributeUnmarshal(ContextMethodBuilder mb)Generate attribute unmarshalling code.voidgenContentMarshal(ContextMethodBuilder mb)Generate element or text marshalling code.voidgenContentUnmarshal(ContextMethodBuilder mb)Generate element or text unmarshalling code.PropertyDefinitiongetProperty()Get the property information.booleanhasContent()Check if component defines one or more elements or text values as children of the containing element.booleanisOptional()Check if component is an optional item.voidprint(int depth)voidsetForceUnmarshal(boolean force)Set flag to force unmarshalling to create an object.voidsetSkipping(boolean skip)Set flag for skipping marshalling presence test code generation.-
Methods inherited from class org.jibx.binding.def.PassThroughComponent
genAttrPresentTest, genContentPresentTest, genLoadId, genNewInstance, getType, getWrapperName, hasAttribute, hasId, setLinkages, setWrappedComponent
-
-
-
-
Constructor Detail
-
ComponentProperty
public ComponentProperty(PropertyDefinition prop, IComponent impl, boolean skip)
Constructor.- Parameters:
prop- actual property definitionimpl- component that defines marshalling and unmarshallingskip- flag for marshalling code tests to be skipped
-
-
Method Detail
-
setSkipping
public void setSkipping(boolean skip)
Set flag for skipping marshalling presence test code generation.- Parameters:
skip-trueif skipping,falseif not
-
setForceUnmarshal
public void setForceUnmarshal(boolean force)
Set flag to force unmarshalling to create an object.- Parameters:
force-trueif skipping,falseif not
-
getProperty
public PropertyDefinition getProperty()
Get the property information. This is a kludge used by the ElementWrapper code to store anullvalue directly to the property when unmarshalling a missing or xsi:nil element.- Returns:
- property information
-
isOptional
public boolean isOptional()
Description copied from interface:IComponentCheck if component is an optional item.- Specified by:
isOptionalin interfaceIComponent- Overrides:
isOptionalin classPassThroughComponent- Returns:
trueif optional,falseif required
-
hasContent
public boolean hasContent()
Description copied from interface:IComponentCheck if component defines one or more elements or text values as children of the containing element. This method is only valid after the call toILinkable.setLinkages().- Specified by:
hasContentin interfaceIComponent- Overrides:
hasContentin classPassThroughComponent- Returns:
trueif one or more content values defined for containing element,falseif not
-
genAttributeUnmarshal
public void genAttributeUnmarshal(ContextMethodBuilder mb) throws org.jibx.runtime.JiBXException
Description copied from interface:IComponentGenerate attribute unmarshalling code. This is called within the code generation for the unmarshaller of the class associated with the containing element. It needs to generate the necessary code for handling the unmarshalling operation, leaving the unmarshalled object reference on the stack.- Specified by:
genAttributeUnmarshalin interfaceIComponent- Overrides:
genAttributeUnmarshalin classPassThroughComponent- Parameters:
mb- method builder- Throws:
org.jibx.runtime.JiBXException- if error in configuration
-
genAttributeMarshal
public void genAttributeMarshal(ContextMethodBuilder mb) throws org.jibx.runtime.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:
org.jibx.runtime.JiBXException- if error in configuration
-
genContentUnmarshal
public void genContentUnmarshal(ContextMethodBuilder mb) throws org.jibx.runtime.JiBXException
Description copied from interface:IComponentGenerate element or text unmarshalling code. This is called within the code generation for the unmarshaller of the class associated with the containing element. It needs to generate the necessary code for handling the unmarshalling operation, leaving the unmarshalled object reference on the stack.- Specified by:
genContentUnmarshalin interfaceIComponent- Overrides:
genContentUnmarshalin classPassThroughComponent- Parameters:
mb- method builder- Throws:
org.jibx.runtime.JiBXException- if error in configuration
-
genContentMarshal
public void genContentMarshal(ContextMethodBuilder mb) throws org.jibx.runtime.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:
org.jibx.runtime.JiBXException- if error in configuration
-
print
public void print(int depth)
- Specified by:
printin interfaceIComponent- Overrides:
printin classPassThroughComponent
-
-