ataspectj.instrumentation
Class PrimitiveTypesFactory

java.lang.Object
  extended by ataspectj.AtAspectjComponent
      extended by ataspectj.instrumentation.PrimitiveTypesFactory

public class PrimitiveTypesFactory
extends AtAspectjComponent

Used to create the instructions to wrap the primitive types into object, so we can pass them to the new method by reference and not by value

Author:
Marco Poggi

Field Summary
 
Fields inherited from class ataspectj.AtAspectjComponent
barrier, CODEPRINT, DEBUG, VERBOSE
 
Constructor Summary
PrimitiveTypesFactory()
           
 
Method Summary
static org.apache.bcel.generic.InstructionList makeInitInstructionListForWrapper(org.apache.bcel.generic.ConstantPoolGen cp, org.apache.bcel.generic.Type t, int newIndex)
          It cretates the instrucion list to create the new Wrapper Object of the primitive type local variable.
static org.apache.bcel.generic.InstructionList makeInitWrapper(java.lang.Class wrapperClass, java.lang.String wrapper, org.apache.bcel.generic.ConstantPoolGen cg, int newIndex)
          It creates the instrcution list to create the specified wrapper object.
static org.apache.bcel.generic.InstructionList makeObjectRefToPrimitive(org.apache.bcel.generic.ConstantPoolGen cp, org.apache.bcel.generic.Type t, int oldIndex, int objRefIndex)
          It cretates the instrucion list to create restore the value from the Wrapper Object to the primitive type local variable.
static org.apache.bcel.generic.InstructionList makePrimitiveToWrapperPrimitive(org.apache.bcel.generic.ConstantPoolGen cg, IndexRepository indexRep)
          It creates the instrcution list to store the value of the primitive variable into the wrapper obejct.
static org.apache.bcel.generic.InstructionList makeWrapperBooleanToBoolean(org.apache.bcel.generic.ConstantPoolGen cg, int primIndex, int objIndex)
          It creates the instrcution list to retrieve the value from a Wrapper Object to the boolean local variable
static org.apache.bcel.generic.InstructionList makeWrapperByteToByte(org.apache.bcel.generic.ConstantPoolGen cg, int primIndex, int objIndex)
          It creates the instrcution list to retrieve the value from a Wrapper Object to the byte local variable
static org.apache.bcel.generic.InstructionList makeWrapperCharToChar(org.apache.bcel.generic.ConstantPoolGen cg, int primIndex, int objIndex)
          It creates the instrcution list to retrieve the value from a Wrapper Object to the char local variable
static org.apache.bcel.generic.InstructionList makeWrapperDoubleToDouble(org.apache.bcel.generic.ConstantPoolGen cg, int primIndex, int objIndex)
          It creates the instrcution list to retrieve the value from a Wrapper Object to the double local variable
static org.apache.bcel.generic.InstructionList makeWrapperFloatToFloat(org.apache.bcel.generic.ConstantPoolGen cg, int primIndex, int objIndex)
          It creates the instrcution list to retrieve the value from a Wrapper Object to the float local variable
static org.apache.bcel.generic.InstructionList makeWrapperIntToInt(org.apache.bcel.generic.ConstantPoolGen cg, int primIndex, int objIndex)
          It creates the instrcution list to retrieve the value from a Wrapper Object to the int local variable
static org.apache.bcel.generic.InstructionList makeWrapperLongToLong(org.apache.bcel.generic.ConstantPoolGen cg, int primIndex, int objIndex)
          It creates the instrcution list to retrieve the value from a Wrapper Object to the long local variable
static org.apache.bcel.generic.InstructionList makeWrapperShortToShort(org.apache.bcel.generic.ConstantPoolGen cg, int primIndex, int objIndex)
          It creates the instrcution list to retrieve the value from a Wrapper Object to the short local variable
 
Methods inherited from class ataspectj.AtAspectjComponent
done
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrimitiveTypesFactory

public PrimitiveTypesFactory()
Method Detail

makePrimitiveToWrapperPrimitive

public static org.apache.bcel.generic.InstructionList makePrimitiveToWrapperPrimitive(org.apache.bcel.generic.ConstantPoolGen cg,
                                                                                      IndexRepository indexRep)
It creates the instrcution list to store the value of the primitive variable into the wrapper obejct.

Parameters:
cg - The current ConstantPoolGen.
indexRep - the IndexRepository
Returns:
The Instruction List created.

makeObjectRefToPrimitive

public static org.apache.bcel.generic.InstructionList makeObjectRefToPrimitive(org.apache.bcel.generic.ConstantPoolGen cp,
                                                                               org.apache.bcel.generic.Type t,
                                                                               int oldIndex,
                                                                               int objRefIndex)
It cretates the instrucion list to create restore the value from the Wrapper Object to the primitive type local variable.

Parameters:
cp - The current constant pool.
t - The primitive type to restore
oldIndex - The index of the primitive type local variable.
objRefIndex - The index where retrieve
Returns:
The instruction list created.

makeInitInstructionListForWrapper

public static org.apache.bcel.generic.InstructionList makeInitInstructionListForWrapper(org.apache.bcel.generic.ConstantPoolGen cp,
                                                                                        org.apache.bcel.generic.Type t,
                                                                                        int newIndex)
It cretates the instrucion list to create the new Wrapper Object of the primitive type local variable.

Parameters:
cp - The current constant pool.
t - The primitive type to wrap.
newIndex - The index of the new object.
Returns:
The instruction list created.

makeInitWrapper

public static org.apache.bcel.generic.InstructionList makeInitWrapper(java.lang.Class wrapperClass,
                                                                      java.lang.String wrapper,
                                                                      org.apache.bcel.generic.ConstantPoolGen cg,
                                                                      int newIndex)
It creates the instrcution list to create the specified wrapper object.

Parameters:
wrapperClass - the class of the new wrapper object.
wrapper - The long name of the class of new wrapper object.
cg - The current ConstantPoolGen.
newIndex - the new wrap object index.
Returns:
The Instruction List created.

makeWrapperIntToInt

public static org.apache.bcel.generic.InstructionList makeWrapperIntToInt(org.apache.bcel.generic.ConstantPoolGen cg,
                                                                          int primIndex,
                                                                          int objIndex)
It creates the instrcution list to retrieve the value from a Wrapper Object to the int local variable

Parameters:
cg - The current ConstantPoolGen.
primIndex - the primitive type local variable index.
objIndex - the wrap object index.
Returns:
The Instruction List created.

makeWrapperDoubleToDouble

public static org.apache.bcel.generic.InstructionList makeWrapperDoubleToDouble(org.apache.bcel.generic.ConstantPoolGen cg,
                                                                                int primIndex,
                                                                                int objIndex)
It creates the instrcution list to retrieve the value from a Wrapper Object to the double local variable

Parameters:
cg - The current ConstantPoolGen.
primIndex - the primitive type local variable index.
objIndex - the wrap object index.
Returns:
The Instruction List created.

makeWrapperByteToByte

public static org.apache.bcel.generic.InstructionList makeWrapperByteToByte(org.apache.bcel.generic.ConstantPoolGen cg,
                                                                            int primIndex,
                                                                            int objIndex)
It creates the instrcution list to retrieve the value from a Wrapper Object to the byte local variable

Parameters:
cg - The current ConstantPoolGen.
primIndex - the primitive type local variable index.
objIndex - the wrap object index.
Returns:
The Instruction List created.

makeWrapperCharToChar

public static org.apache.bcel.generic.InstructionList makeWrapperCharToChar(org.apache.bcel.generic.ConstantPoolGen cg,
                                                                            int primIndex,
                                                                            int objIndex)
It creates the instrcution list to retrieve the value from a Wrapper Object to the char local variable

Parameters:
cg - The current ConstantPoolGen.
primIndex - the primitive type local variable index.
objIndex - the wrap object index.
Returns:
The Instruction List created.

makeWrapperShortToShort

public static org.apache.bcel.generic.InstructionList makeWrapperShortToShort(org.apache.bcel.generic.ConstantPoolGen cg,
                                                                              int primIndex,
                                                                              int objIndex)
It creates the instrcution list to retrieve the value from a Wrapper Object to the short local variable

Parameters:
cg - The current ConstantPoolGen.
primIndex - the primitive type local variable index.
objIndex - the wrap object index.
Returns:
The Instruction List created.

makeWrapperBooleanToBoolean

public static org.apache.bcel.generic.InstructionList makeWrapperBooleanToBoolean(org.apache.bcel.generic.ConstantPoolGen cg,
                                                                                  int primIndex,
                                                                                  int objIndex)
It creates the instrcution list to retrieve the value from a Wrapper Object to the boolean local variable

Parameters:
cg - The current ConstantPoolGen.
primIndex - the primitive type local variable index.
objIndex - the wrap object index.
Returns:
The Instruction List created.

makeWrapperFloatToFloat

public static org.apache.bcel.generic.InstructionList makeWrapperFloatToFloat(org.apache.bcel.generic.ConstantPoolGen cg,
                                                                              int primIndex,
                                                                              int objIndex)
It creates the instrcution list to retrieve the value from a Wrapper Object to the float local variable

Parameters:
cg - The current ConstantPoolGen.
primIndex - the primitive type local variable index.
objIndex - the wrap object index.
Returns:
The Instruction List created.

makeWrapperLongToLong

public static org.apache.bcel.generic.InstructionList makeWrapperLongToLong(org.apache.bcel.generic.ConstantPoolGen cg,
                                                                            int primIndex,
                                                                            int objIndex)
It creates the instrcution list to retrieve the value from a Wrapper Object to the long local variable

Parameters:
cg - The current ConstantPoolGen.
primIndex - the primitive type local variable index.
objIndex - the wrap object index.
Returns:
The Instruction List created.