org.jibx.binding.def
Interface IMapping

All Superinterfaces:
IComponent
All Known Implementing Classes:
MappingBase, MappingDefinition, MappingDirect

public interface IMapping
extends IComponent

Interface for mapping definitions. This defines the additional access methods used with mappings (beyond those used with ordinary components).

Version:
1.0
Author:
Dennis M. Sosnoski

Method Summary
 void addExtension(MappingDefinition mdef)
          Add extension to abstract mapping.
 void addNamespace(NamespaceDefinition ns)
          Add namespace.
 IComponent buildRef(IContainer parent, IContextObj objc, java.lang.String type, PropertyDefinition prop)
          Build reference to mapping.
 void generateCode(boolean force)
          Generate required code for mapping.
 java.lang.String getBoundType()
          Get class name handled by mapping.
 IComponent getImplComponent()
          Get binding component implementing mapping.
 int getIndex()
          Get mapped class index number.
 ClassFile getMarshaller()
          Get marshaller class used for mapping.
 NameDefinition getName()
          Get mapped element name.
 java.lang.String getReferenceType()
          Get class name of type to be assumed for references to this mapping.
 java.lang.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.IComponent
checkContentSequence, genAttributeMarshal, genAttributeUnmarshal, genAttrPresentTest, genContentMarshal, genContentPresentTest, genContentUnmarshal, genLoadId, genNewInstance, getType, hasAttribute, hasContent, hasId, isOptional, print, setLinkages
 

Method Detail

getBoundType

java.lang.String getBoundType()
Get class name handled by mapping.

Returns:
name of class bound by mapping

getReferenceType

java.lang.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 JiBXException
Get marshaller class used for mapping.

Returns:
marshaller class information
Throws:
JiBXException - if error in configuration

getUnmarshaller

ClassFile getUnmarshaller()
                          throws JiBXException
Get unmarshaller class used for mapping.

Returns:
unmarshaller class information
Throws:
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

java.lang.String getTypeName()
Get type name.

Returns:
type name (null if unnamed)

getIndex

int getIndex()
Get mapped class index number.

Returns:
mapped class index number in context

addNamespace

void addNamespace(NamespaceDefinition ns)
                  throws JiBXException
Add namespace. This adds a namespace definition to those active for the mapping.

Parameters:
ns - namespace definition to be added
Throws:
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 JiBXException
Add extension to abstract mapping. This call is only valid for abstract mappings.

Parameters:
mdef - extension mapping definition
Throws:
JiBXException - if configuration error

buildRef

IComponent buildRef(IContainer parent,
                    IContextObj objc,
                    java.lang.String type,
                    PropertyDefinition prop)
                    throws JiBXException
Build reference to mapping. Constructs and returns the component for handling the mapping.

Parameters:
parent - containing binding definition structure
objc - current object context
type - mapped value type
prop - property definition (may be null)
Returns:
constructed mapping reference component
Throws:
JiBXException - if configuration error

generateCode

void generateCode(boolean force)
                  throws JiBXException
Generate required code for mapping.

Parameters:
force - add marshaller/unmarshaller classes for abstract non-base mappings flag (not passed on to children)
Throws:
JiBXException - if error in transformation


Project Web Site