Package org.jibx.binding.def
Class PrecompiledConcreteMapping
java.lang.Object
org.jibx.binding.def.PrecompiledConcreteMapping
Concrete mapping defined by a precompiled binding. This is constructed from
the binding factory information for a binding which is referenced using a
precompiled='true' attribute.
- Author:
- Dennis M. Sosnoski
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClassFileClass linked to mapping.private final IContainerContaining context for definition.private final StringBinding factory name used for activating namespace translation on marshalling (nullif translation not required).private final StringName of this mapping in binding..private ClassFileMarshaller class.private final NameDefinitionMapped element name.private ClassFileUnmarshaller class. -
Constructor Summary
ConstructorsConstructorDescriptionPrecompiledConcreteMapping(String mapname, String type, NameDefinition name, String marname, String umarname, IContainer parent, boolean xlated, String factname) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd extension to abstract mapping.voidAdd namespace.buildRef(IContainer parent, IContextObj objc, String type, PropertyDefinition prop) Build reference to mapping.voidgenerateCode(boolean force) Generate required code for mapping.Get the actual binding for a mapping.Get class name handled by mapping.Get binding component implementing mapping.Get the mapping name used in binding tables.Get marshaller class used for mapping.getName()Get mapped element name.Get namespaces defined for mapping.Get class name of type to be assumed for references to this mapping.Get type name.Get unmarshaller class used for mapping.booleanCheck if mapping is abstract.booleanisBase()Check if mapping has extensions.voidLinks extension mappings to their base mappings.voidprint(int depth) voidEstablish and validate linkages between binding components.
-
Field Details
-
m_class
Class linked to mapping. -
m_mappingName
Name of this mapping in binding.. -
m_name
Mapped element name. -
m_container
Containing context for definition. -
m_factoryName
Binding factory name used for activating namespace translation on marshalling (nullif translation not required). -
m_marshaller
Marshaller class. -
m_unmarshaller
Unmarshaller class.
-
-
Constructor Details
-
PrecompiledConcreteMapping
public PrecompiledConcreteMapping(String mapname, String type, NameDefinition name, String marname, String umarname, IContainer parent, boolean xlated, String factname) throws JiBXException Constructor.- Parameters:
mapname- mapping name in bindingtype- bound class namename- element name definitionmarname- marshaller class name (nullif none)umarname- unmarshaller class name (nullif none)parent- containing contextxlated- translated namespaces for binding flagfactname- binding factory name- Throws:
JiBXException- if class definition not found
-
-
Method Details
-
linkMappings
Links extension mappings to their base mappings. For precompiled mappings this does nothing.- Throws:
JiBXException- if error in linking
-
getBoundType
Description copied from interface:IMappingGet class name handled by mapping.- Specified by:
getBoundTypein interfaceIMapping- Returns:
- name of class bound by mapping
-
getReferenceType
Description copied from interface:IMappingGet class name of type to be assumed for references to this mapping.- Specified by:
getReferenceTypein interfaceIMapping- Returns:
- reference type class name name
-
getImplComponent
Description copied from interface:IMappingGet binding component implementing mapping. This call is only valid for mappings with child components, not for mappings defined using marshallers or unmarshallers.- Specified by:
getImplComponentin interfaceIMapping- Returns:
- binding component implementing this mapping
-
getMarshaller
Description copied from interface:IMappingGet marshaller class used for mapping.- Specified by:
getMarshallerin interfaceIMapping- Returns:
- marshaller class information
-
getUnmarshaller
Description copied from interface:IMappingGet unmarshaller class used for mapping.- Specified by:
getUnmarshallerin interfaceIMapping- Returns:
- unmarshaller class information
-
getName
Description copied from interface:IMappingGet mapped element name. -
addNamespace
Description copied from interface:IMappingAdd namespace. This adds a namespace definition to those active for the mapping.- Specified by:
addNamespacein interfaceIMapping- Parameters:
ns- namespace definition to be added- Throws:
JiBXException- if error in defining namespace
-
isAbstract
public boolean isAbstract()Description copied from interface:IMappingCheck if mapping is abstract.- Specified by:
isAbstractin interfaceIMapping- Returns:
trueif an abstract mapping,falseif not
-
isBase
public boolean isBase()Description copied from interface:IMappingCheck if mapping has extensions. -
addExtension
Description copied from interface:IMappingAdd extension to abstract mapping. This call is only valid for abstract mappings.- Specified by:
addExtensionin interfaceIMapping- Parameters:
mdef- extension mapping definition- Throws:
JiBXException- if configuration error
-
buildRef
public IComponent buildRef(IContainer parent, IContextObj objc, String type, PropertyDefinition prop) throws JiBXException Description copied from interface:IMappingBuild reference to mapping. Constructs and returns the component for handling the mapping.- Specified by:
buildRefin interfaceIMapping- Parameters:
parent- containing binding definition structureobjc- current object contexttype- mapped value typeprop- property definition (may benull)- Returns:
- constructed mapping reference component
- Throws:
JiBXException- if configuration error
-
getNamespaces
Description copied from interface:IMappingGet namespaces defined for mapping.- Specified by:
getNamespacesin interfaceIMapping- Returns:
- namespace definitions (may be
nullif none)
-
generateCode
Description copied from interface:IMappingGenerate required code for mapping.- Specified by:
generateCodein interfaceIMapping- Parameters:
force- add marshaller/unmarshaller classes for abstract non-base mappings flag (not passed on to children)- Throws:
JiBXException- if error in transformation
-
getWrapperName
-
getBinding
Description copied from interface:IMappingGet the actual binding for a mapping. This is only usable with mappings defined by a binding; if the mapping is instead defined by specifying marshaller and unmarshaller classes this will just return null.- Specified by:
getBindingin interfaceIMapping- Returns:
- binding structure, or
nullif none
-
getMappingName
Description copied from interface:IMappingGet the mapping name used in binding tables.- Specified by:
getMappingNamein interfaceIMapping- Returns:
- name
-
getTypeName
Description copied from interface:IMappingGet type name.- Specified by:
getTypeNamein interfaceIMapping- Returns:
- qualified type name, in text form (
nullif unnamed)
-
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- Throws:
JiBXException- if error in configuration
-
print
public void print(int depth)
-