org.jibx.binding.classes
Class UnmarshalBuilder

java.lang.Object
  extended by org.jibx.binding.classes.BindingMethod
      extended by org.jibx.binding.classes.MethodBuilder
          extended by org.jibx.binding.classes.ExceptionMethodBuilder
              extended by org.jibx.binding.classes.ContextMethodBuilder
                  extended by org.jibx.binding.classes.MarshalUnmarshalBuilder
                      extended by org.jibx.binding.classes.UnmarshalBuilder

public class UnmarshalBuilder
extends MarshalUnmarshalBuilder

Unmarshalling method builder. Tracks the creation of an unmarshalling method, including special handling of exceptions that may be generated by object accesses during the unmarshalling process.

Version:
1.0
Author:
Dennis M. Sosnoski

Field Summary
protected static org.apache.bcel.generic.Type[] SINGLE_STRING_ARGS
           
protected static java.lang.String UNMARSHAL_EXCEPTION_TEXT
           
protected static org.apache.bcel.generic.Type[] UNMARSHAL_METHOD_ARGS
           
private static java.lang.String UNMARSHALCONTEXT_CLASS
           
protected static java.lang.String UNMARSHALLING_POSITION_METHOD
           
protected static java.lang.String UNMARSHALLING_POSITION_SIGNATURE
           
 
Fields inherited from class org.jibx.binding.classes.MethodBuilder
EMPTY_STRING_ARRAY, EXCEPTION_CONSTRUCTOR_SIGNATURE1, EXCEPTION_CONSTRUCTOR_SIGNATURE2, FRAMEWORK_EXCEPTION_CLASS, m_exceptions, m_generator, m_hashCode, m_instructionBuilder, m_item, m_method, m_targetBranches, m_valueMap, s_argNameLists, SYNTHETIC_ACCESS_FLAG
 
Constructor Summary
UnmarshalBuilder(java.lang.String name, ClassFile cf, ClassFile mf)
          Constructor.
 
Method Summary
 org.apache.bcel.generic.InstructionHandle genExceptionHandler()
          Add exception handler code.
 
Methods inherited from class org.jibx.binding.classes.MarshalUnmarshalBuilder
handleExceptions
 
Methods inherited from class org.jibx.binding.classes.ContextMethodBuilder
isStaticMethod, loadContext, loadContext, loadObject, loadObject, setObjectSlot, storeObject
 
Methods inherited from class org.jibx.binding.classes.ExceptionMethodBuilder
defineSlot, freeSlot, getSlot
 
Methods inherited from class org.jibx.binding.classes.MethodBuilder
addException, addLocal, addMethod, addMethodExceptions, appendAASTORE, appendACONST_NULL, appendALOAD, appendARRAYLENGTH, appendASTORE, appendCall, appendCallInit, appendCallInterface, appendCallStatic, appendCallVirtual, appendCreateArray, appendCreateCast, appendCreateCast, appendCreateNew, appendDCMPG, appendDUP_X1, appendDUP, appendDUP2, appendFCMPG, appendGet, appendGetField, appendGetStatic, appendIASTORE, appendICONST_0, appendICONST_1, appendIF_ICMPNE, appendIFEQ, appendIFGE, appendIFLT, appendIFNE, appendIFNONNULL, appendIFNULL, appendIncrementLocal, appendInstanceOf, appendISUB, appendIXOR, appendLCMP, appendLoadConstant, appendLoadConstant, appendLoadConstant, appendLoadLocal, appendPOP, appendPOP2, appendPut, appendPutField, appendPutStatic, appendReturn, appendReturn, appendReturn, appendStoreLocal, appendSWAP, appendSWAP1For2, appendTargetACONST_NULL, appendTargetCreateNew, appendTargetLoadConstant, appendTargetLoadConstant, appendTargetNOP, appendThrow, appendUnconditionalBranch, codeComplete, createLocal, getAccessFlags, getFirstInstruction, getItem, getKeyValue, getLastInstruction, getMethod, getName, getSignature, hashCode, initStackState, initStackState, initStackState, internalAppendCreateNew, isStackTopLong, setAccessFlags, setKeyValue, setTarget, targetNext, targetNext
 
Methods inherited from class org.jibx.binding.classes.BindingMethod
computeMethodHash, equals, getClassFile, makeAccessible
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNMARSHALCONTEXT_CLASS

private static final java.lang.String UNMARSHALCONTEXT_CLASS
See Also:
Constant Field Values

UNMARSHAL_EXCEPTION_TEXT

protected static final java.lang.String UNMARSHAL_EXCEPTION_TEXT
See Also:
Constant Field Values

UNMARSHALLING_POSITION_METHOD

protected static final java.lang.String UNMARSHALLING_POSITION_METHOD
See Also:
Constant Field Values

UNMARSHALLING_POSITION_SIGNATURE

protected static final java.lang.String UNMARSHALLING_POSITION_SIGNATURE
See Also:
Constant Field Values

UNMARSHAL_METHOD_ARGS

protected static final org.apache.bcel.generic.Type[] UNMARSHAL_METHOD_ARGS

SINGLE_STRING_ARGS

protected static final org.apache.bcel.generic.Type[] SINGLE_STRING_ARGS
Constructor Detail

UnmarshalBuilder

public UnmarshalBuilder(java.lang.String name,
                        ClassFile cf,
                        ClassFile mf)
                 throws JiBXException
Constructor. This sets up for constructing a virtual unmarshalling method with public access and wrapped exception handling. If the method is being generated directly to the class being unmarshalled it's built as a virtual method; otherwise, it's done as a static method.

Parameters:
name - method name to be built
cf - unmarshal class file information
mf - method generation class file information
Throws:
JiBXException - on error in initializing method construction
Method Detail

genExceptionHandler

public org.apache.bcel.generic.InstructionHandle genExceptionHandler()
                                                              throws JiBXException
Add exception handler code. The implementation of this abstract base class method provides handling specific to an unmarshalling method.

Specified by:
genExceptionHandler in class MarshalUnmarshalBuilder
Returns:
handle for first instruction in handler
Throws:
JiBXException - on error in creating exception handler


Project Web Site