Package org.jibx.binding.def
Class MappingReference
java.lang.Object
org.jibx.binding.def.PassThroughComponent
org.jibx.binding.def.MappingReference
- All Implemented Interfaces:
IComponent,ILinkable
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.
- Author:
- Dennis M. Sosnoski
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final IContainerContaining binding definition structure.private final IContextObjContext object.private final booleanFlag for nillable element.private final booleanSynthetic reference added to empty collection flagprivate IMappingReferenced mapping.private final NameDefinitionName from reference (only allowed with abstract mappings)private final PropertyDefinitionProperty definition.private StringQualified name of type for abstract mapping.private StringOrdinary name of type for abstract mapping.private StringFully qualified name of mapped type.private IComponentGenerated wrapped component, used when checking for both attributes and elements present.Fields inherited from class org.jibx.binding.def.PassThroughComponent
m_component -
Constructor Summary
ConstructorsConstructorDescriptionMappingReference(IContainer contain, PropertyDefinition prop, String type, String reftext, String refqname, IContextObj objc, NameDefinition name, boolean synth, boolean nillable) Constructor from property and type. -
Method Summary
Modifier and TypeMethodDescriptionvoidPatch the generated code to remove the unmarshalled object when it's a "this" reference with both elements and attributes.getType()Get type expected by component.booleanCheck if component is an optional item.voidprint(int depth) voidEstablish and validate linkages between binding components.Methods inherited from class org.jibx.binding.def.PassThroughComponent
genAttributeMarshal, genAttributeUnmarshal, genAttrPresentTest, genContentMarshal, genContentPresentTest, genLoadId, genNewInstance, getWrapperName, hasAttribute, hasContent, hasId, setWrappedComponent
-
Field Details
-
m_container
Containing binding definition structure. -
m_property
Property definition. -
m_isNillable
private final boolean m_isNillableFlag for nillable element. -
m_type
Fully qualified name of mapped type. -
m_referenceText
Ordinary name of type for abstract mapping. -
m_referenceQName
Qualified name of type for abstract mapping. -
m_contextObject
Context object. -
m_name
Name from reference (only allowed with abstract mappings) -
m_isSynthetic
private final boolean m_isSyntheticSynthetic reference added to empty collection flag -
m_mapping
Referenced mapping. -
m_wrappedReference
Generated wrapped component, used when checking for both attributes and elements present.
-
-
Constructor Details
-
MappingReference
public MappingReference(IContainer contain, PropertyDefinition prop, String type, String reftext, String refqname, IContextObj objc, NameDefinition name, boolean synth, boolean nillable) Constructor from property and type.- Parameters:
contain- containing binding definition structureprop- property definitiontype- fully qualified name of mapped typereftext- ordinary text name for abstract mapping reference (nullif not specified)refqname- qualified type name for abstract mapping reference (nullif not specified)objc- current object contextname- reference name definition (only allowed with abstract mappings)synth- sythentic reference added to empty collection flagnillable- flag for nillable element
-
-
Method Details
-
getMapping
-
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
-
getType
Description copied from interface:IComponentGet type expected by component.- Specified by:
getTypein interfaceIComponent- Overrides:
getTypein classPassThroughComponent- Returns:
- fully qualified class name of expected type
-
setLinkages
Description copied from interface:ILinkableEstablish 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:
setLinkagesin interfaceILinkable- Overrides:
setLinkagesin classPassThroughComponent- Throws:
JiBXException- if error in configuration
-
genContentUnmarshal
Patch the generated code to remove the unmarshalled object when it's a "this" reference with both elements and attributes.- Specified by:
genContentUnmarshalin interfaceIComponent- Overrides:
genContentUnmarshalin classPassThroughComponent- Parameters:
mb-- Throws:
JiBXException
-
print
public void print(int depth) - Specified by:
printin interfaceIComponent- Overrides:
printin classPassThroughComponent
-