org.jibx.custom.classes
Class GlobalCustom.Mapper

java.lang.Object
  extended by org.jibx.custom.classes.GlobalCustom.Mapper
All Implemented Interfaces:
IUnmarshaller
Enclosing class:
GlobalCustom

public static class GlobalCustom.Mapper
extends java.lang.Object
implements IUnmarshaller

Unmarshaller implementation for class. This handles the nested structure of packages and classes, using the abstract mappings defined by the binding to handle all the actual details.


Constructor Summary
GlobalCustom.Mapper()
           
 
Method Summary
private  java.lang.String buildFullName(PackageCustom contain, UnmarshallingContext ctx)
          Build the fully-qualified name for a package or class by appending the supplied name attribute value to the fully-qualified name of the containing package.
 boolean isPresent(IUnmarshallingContext ictx)
          Check if instance present in XML.
 java.lang.Object unmarshal(java.lang.Object obj, IUnmarshallingContext ictx)
          Unmarshal root element of customizations.
private  ClassCustom unmarshalClass(GlobalCustom global, PackageCustom contain, UnmarshallingContext ctx)
          Unmarshal class element.
private  PackageCustom unmarshalPackage(GlobalCustom global, PackageCustom contain, UnmarshallingContext ctx)
          Unmarshal package element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GlobalCustom.Mapper

public GlobalCustom.Mapper()
Method Detail

isPresent

public boolean isPresent(IUnmarshallingContext ictx)
                  throws JiBXException
Description copied from interface: IUnmarshaller
Check if instance present in XML. This method can be called when the unmarshalling context is positioned at or just before the start of the data corresponding to an instance of this mapping. It verifies that the expected data is present.

Specified by:
isPresent in interface IUnmarshaller
Parameters:
ictx - unmarshalling context
Returns:
true if expected parse data found, false if not
Throws:
JiBXException - on error in unmarshalling process

buildFullName

private java.lang.String buildFullName(PackageCustom contain,
                                       UnmarshallingContext ctx)
                                throws JiBXException
Build the fully-qualified name for a package or class by appending the supplied name attribute value to the fully-qualified name of the containing package.

Parameters:
contain -
ctx -
Throws:
JiBXException

unmarshalPackage

private PackageCustom unmarshalPackage(GlobalCustom global,
                                       PackageCustom contain,
                                       UnmarshallingContext ctx)
                                throws JiBXException
Unmarshal package element. This calls itself recursively to handle nested package elements, and calls unmarshalClass(GlobalCustom, PackageCustom, UnmarshallingContext) to handle nested class elements.

Parameters:
global - root customizations
contain - containing package
ctx - unmarshalling context
Returns:
unmarshalled package data
Throws:
JiBXException

unmarshalClass

private ClassCustom unmarshalClass(GlobalCustom global,
                                   PackageCustom contain,
                                   UnmarshallingContext ctx)
                            throws JiBXException
Unmarshal class element. This calls itself recursively to handle nested class elements, and calls unmarshalClass(GlobalCustom, PackageCustom, UnmarshallingContext) to handle nested class elements.

Parameters:
global - root customizations
contain - containing package
ctx - unmarshalling context
Returns:
unmarshalled class data
Throws:
JiBXException

unmarshal

public java.lang.Object unmarshal(java.lang.Object obj,
                                  IUnmarshallingContext ictx)
                           throws JiBXException
Unmarshal root element of customizations. This expects to handle the actual root element of the binding directly, meaning it should always be invoked by using the IUnmarshallable.unmarshal(IUnmarshallingContext) method. The actual root element may be anything, allowing the unmarshaller to be used for subclasses (with different names) of the outer class.

Specified by:
unmarshal in interface IUnmarshaller
Parameters:
obj - root element object (must be an instance of the GlobalCustom type)
ictx - unmarshalling context
Returns:
unmarshalled root object element
Throws:
JiBXException


Project Web Site