Package org.jibx.binding.def
Interface IMapping
-
- All Superinterfaces:
ILinkable
- All Known Implementing Classes:
MappingBase
,MappingDefinition
,MappingDirect
,PrecompiledAbstractMapping
,PrecompiledConcreteMapping
public interface IMapping extends ILinkable
Interface for mapping definitions.- Author:
- Dennis M. Sosnoski
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addExtension(MappingDefinition mdef)
Add extension to abstract mapping.void
addNamespace(NamespaceDefinition ns)
Add namespace.IComponent
buildRef(IContainer parent, IContextObj objc, String type, PropertyDefinition prop)
Build reference to mapping.void
generateCode(boolean force)
Generate required code for mapping.ITypeBinding
getBinding()
Get the actual binding for a mapping.String
getBoundType()
Get class name handled by mapping.IComponent
getImplComponent()
Get binding component implementing mapping.String
getMappingName()
Get the mapping name used in binding tables.ClassFile
getMarshaller()
Get marshaller class used for mapping.NameDefinition
getName()
Get mapped element name.ArrayList
getNamespaces()
Get namespaces defined for mapping.String
getReferenceType()
Get class name of type to be assumed for references to this mapping.String
getTypeName()
Get type name.ClassFile
getUnmarshaller()
Get unmarshaller class used for mapping.boolean
isAbstract()
Check if mapping is abstract.boolean
isBase()
Check if mapping has extensions.-
Methods inherited from interface org.jibx.binding.def.ILinkable
setLinkages
-
-
-
-
Method Detail
-
getBoundType
String getBoundType()
Get class name handled by mapping.- Returns:
- name of class bound by mapping
-
getReferenceType
String getReferenceType()
Get class name of type to be assumed for references to this mapping.- Returns:
- reference type class name name
-
getImplComponent
IComponent getImplComponent()
Get binding component implementing mapping. This call is only valid for mappings with child components, not for mappings defined using marshallers or unmarshallers.- Returns:
- binding component implementing this mapping
-
getMarshaller
ClassFile getMarshaller() throws org.jibx.runtime.JiBXException
Get marshaller class used for mapping.- Returns:
- marshaller class information
- Throws:
org.jibx.runtime.JiBXException
- if error in configuration
-
getUnmarshaller
ClassFile getUnmarshaller() throws org.jibx.runtime.JiBXException
Get unmarshaller class used for mapping.- Returns:
- unmarshaller class information
- Throws:
org.jibx.runtime.JiBXException
- if error in configuration
-
getName
NameDefinition getName()
Get mapped element name.- Returns:
- mapped element name information (may be
null
if no element name defined for mapping)
-
getTypeName
String getTypeName()
Get type name.- Returns:
- qualified type name, in text form (
null
if unnamed)
-
getMappingName
String getMappingName()
Get the mapping name used in binding tables.- Returns:
- name
-
addNamespace
void addNamespace(NamespaceDefinition ns) throws org.jibx.runtime.JiBXException
Add namespace. This adds a namespace definition to those active for the mapping.- Parameters:
ns
- namespace definition to be added- Throws:
org.jibx.runtime.JiBXException
- if error in defining namespace
-
isAbstract
boolean isAbstract()
Check if mapping is abstract.- Returns:
true
if an abstract mapping,false
if not
-
isBase
boolean isBase()
Check if mapping has extensions.- Returns:
true
if one or more mappings extend this mapping,false
if not
-
addExtension
void addExtension(MappingDefinition mdef) throws org.jibx.runtime.JiBXException
Add extension to abstract mapping. This call is only valid for abstract mappings.- Parameters:
mdef
- extension mapping definition- Throws:
org.jibx.runtime.JiBXException
- if configuration error
-
buildRef
IComponent buildRef(IContainer parent, IContextObj objc, String type, PropertyDefinition prop) throws org.jibx.runtime.JiBXException
Build reference to mapping. Constructs and returns the component for handling the mapping.- Parameters:
parent
- containing binding definition structureobjc
- current object contexttype
- mapped value typeprop
- property definition (may benull
)- Returns:
- constructed mapping reference component
- Throws:
org.jibx.runtime.JiBXException
- if configuration error
-
getNamespaces
ArrayList getNamespaces()
Get namespaces defined for mapping.- Returns:
- namespace definitions (may be
null
if none)
-
generateCode
void generateCode(boolean force) throws org.jibx.runtime.JiBXException
Generate required code for mapping.- Parameters:
force
- add marshaller/unmarshaller classes for abstract non-base mappings flag (not passed on to children)- Throws:
org.jibx.runtime.JiBXException
- if error in transformation
-
getBinding
ITypeBinding getBinding()
Get 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.- Returns:
- binding structure, or
null
if none
-
-