|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmultiverse.server.marshalling.InjectionGenerator
public class InjectionGenerator
| Nested Class Summary | |
|---|---|
static class |
InjectionGenerator.BranchFixup
|
static class |
InjectionGenerator.PrimitiveTypeInfo
|
| Field Summary | |
|---|---|
(package private) HashSet<MarshallingRuntime.ClassNameAndTypeNumber> |
classesToBeMarshalled
|
(package private) int |
currentStack
|
protected boolean |
generateClassFiles
|
protected static InjectionGenerator |
instance
|
protected boolean |
listGeneratedCode
|
(package private) static String |
marshallableClassName
|
(package private) static String |
marshallingRuntimeClassName
|
(package private) int |
maxStack
|
(package private) static String |
mvByteBufferClassName
|
(package private) org.apache.bcel.generic.ObjectType |
mvByteBufferType
|
(package private) org.apache.bcel.generic.ObjectType |
OBJBOOLEAN
|
(package private) org.apache.bcel.generic.ObjectType |
OBJBYTE
|
(package private) org.apache.bcel.generic.ObjectType |
OBJCHAR
|
(package private) org.apache.bcel.generic.ObjectType |
OBJDOUBLE
|
(package private) org.apache.bcel.generic.ObjectType |
OBJFLOAT
|
(package private) org.apache.bcel.generic.ObjectType |
OBJINT
|
(package private) org.apache.bcel.generic.ObjectType |
OBJLONG
|
(package private) org.apache.bcel.generic.ObjectType |
OBJSHORT
|
protected String |
outputDir
|
protected static InjectionGenerator.PrimitiveTypeInfo[] |
primitiveTypes
|
| Constructor Summary | |
|---|---|
InjectionGenerator(boolean generateClassFiles,
String outputDir,
boolean listGeneratedCode)
InjectionGenerator constructor |
|
| Method Summary | |
|---|---|
protected void |
addFieldFetch(org.apache.bcel.classfile.JavaClass clazz,
org.apache.bcel.generic.InstructionFactory factory,
org.apache.bcel.classfile.Field f,
org.apache.bcel.generic.InstructionList il)
|
protected void |
addMarshallingForField(org.apache.bcel.classfile.JavaClass clazz,
org.apache.bcel.classfile.Field f,
org.apache.bcel.generic.InstructionFactory factory,
org.apache.bcel.generic.InstructionList il)
|
protected void |
addMVByteBufferFieldGet(org.apache.bcel.classfile.JavaClass clazz,
org.apache.bcel.classfile.Field f,
org.apache.bcel.generic.Type fieldType,
InjectionGenerator.PrimitiveTypeInfo info,
org.apache.bcel.generic.InstructionFactory factory,
org.apache.bcel.generic.InstructionList il)
|
protected void |
addMVByteBufferFieldPut(org.apache.bcel.classfile.JavaClass clazz,
org.apache.bcel.classfile.Field f,
org.apache.bcel.generic.Type fieldType,
InjectionGenerator.PrimitiveTypeInfo info,
org.apache.bcel.generic.InstructionFactory factory,
org.apache.bcel.generic.InstructionList il)
|
protected void |
addStack(int count)
|
protected void |
addUnmarshallingForField(org.apache.bcel.classfile.JavaClass clazz,
org.apache.bcel.classfile.Field f,
org.apache.bcel.generic.InstructionFactory factory,
org.apache.bcel.generic.ConstantPoolGen cp,
org.apache.bcel.generic.InstructionList il)
|
protected String |
aggregateTypeString(org.apache.bcel.generic.ObjectType fieldObjectType)
|
protected org.apache.bcel.generic.MethodGen |
createMarshallingMethod(org.apache.bcel.classfile.JavaClass clazz,
org.apache.bcel.classfile.JavaClass superclass,
org.apache.bcel.generic.ConstantPoolGen cp,
org.apache.bcel.generic.InstructionFactory factory,
LinkedList<org.apache.bcel.classfile.Field> fields,
LinkedList<Integer> nullTestedFields,
int flagBitCount)
Create the marshalObject method |
protected org.apache.bcel.generic.MethodGen |
createUnmarshallingMethod(org.apache.bcel.classfile.JavaClass clazz,
org.apache.bcel.classfile.JavaClass superclass,
org.apache.bcel.generic.ConstantPoolGen cp,
org.apache.bcel.generic.InstructionFactory factory,
LinkedList<org.apache.bcel.classfile.Field> fields,
LinkedList<Integer> nullTestedFields,
int flagBitCount)
Create the unmarshalObject method |
protected boolean |
doesOrWillHandleMarshallable(org.apache.bcel.generic.ObjectType type)
|
protected Short |
getAggregateTypeNum(org.apache.bcel.generic.ObjectType fieldObjectType)
|
protected int |
getFinalStack()
|
static InjectionGenerator |
getInstance()
Get the InjectionGenerator singleton instance |
protected static InjectionGenerator.PrimitiveTypeInfo |
getPrimitiveTypeInfo(org.apache.bcel.generic.Type type)
|
protected static LinkedList<org.apache.bcel.classfile.Field> |
getValidClassFields(org.apache.bcel.classfile.JavaClass c)
|
static org.apache.bcel.classfile.JavaClass |
getValidSuperclass(org.apache.bcel.classfile.JavaClass c)
|
static boolean |
handlesMarshallable(org.apache.bcel.classfile.JavaClass clazz)
|
protected boolean |
handlesMarshallable(org.apache.bcel.generic.ObjectType type)
|
static boolean |
handlesMarshallable(String typeName)
|
static void |
initialize(boolean generateClassFiles,
String outputDir,
boolean listGeneratedCode)
|
protected void |
initializeGlobals()
|
protected void |
initStack()
|
protected org.apache.bcel.classfile.JavaClass |
injectMarshallingMethods(org.apache.bcel.classfile.JavaClass clazz,
org.apache.bcel.classfile.JavaClass superclass,
LinkedList<org.apache.bcel.classfile.Field> fields,
LinkedList<Integer> nullTestedFields,
int flagBitCount)
Inject the marshalling methods for this class |
static boolean |
interfaceClass(String s)
|
protected static boolean |
isPrimitiveObjectType(org.apache.bcel.generic.Type type)
|
protected static boolean |
isPrimitiveType(org.apache.bcel.generic.Type type)
|
protected boolean |
isStringType(org.apache.bcel.generic.Type type)
|
protected void |
logGeneratedMethod(org.apache.bcel.generic.ClassGen classGen,
org.apache.bcel.generic.MethodGen method)
|
protected static void |
logInvoke(String s,
org.apache.bcel.generic.InvokeInstruction iv,
org.apache.bcel.generic.ConstantPoolGen cp)
|
protected static org.apache.bcel.classfile.JavaClass |
lookupClass(String className)
|
protected InjectionGenerator.BranchFixup[] |
makeOmittedTest(org.apache.bcel.classfile.JavaClass clazz,
org.apache.bcel.classfile.Field f,
org.apache.bcel.generic.InstructionFactory factory,
org.apache.bcel.generic.InstructionList il)
|
protected boolean |
marshalledByMarshallingRuntimeMarshalObject(org.apache.bcel.generic.ObjectType fieldObjectType)
|
org.apache.bcel.classfile.JavaClass |
maybeInjectMarshalling(org.apache.bcel.classfile.JavaClass clazz,
Short typeNum)
This is the public method called by MarshallingRuntime to inject marshalling methods into the clazz argument |
protected static String |
nonPrimitiveObjectTypeName(org.apache.bcel.generic.Type type)
|
protected void |
noteBranchTargets(InjectionGenerator.BranchFixup[] branchFixups,
org.apache.bcel.generic.InstructionList il)
|
protected boolean |
objectTypeIsInterface(org.apache.bcel.generic.ObjectType type)
|
protected boolean |
referencesInterface(org.apache.bcel.generic.ObjectType type)
|
protected org.apache.bcel.generic.Type |
storageType(org.apache.bcel.generic.Type type)
|
protected static void |
throwError(String msg)
|
protected org.apache.bcel.generic.Type |
underlyingPrimitiveType(org.apache.bcel.generic.Type type)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
int currentStack
int maxStack
HashSet<MarshallingRuntime.ClassNameAndTypeNumber> classesToBeMarshalled
static String marshallingRuntimeClassName
static String marshallableClassName
static String mvByteBufferClassName
org.apache.bcel.generic.ObjectType mvByteBufferType
org.apache.bcel.generic.ObjectType OBJBOOLEAN
org.apache.bcel.generic.ObjectType OBJBYTE
org.apache.bcel.generic.ObjectType OBJCHAR
org.apache.bcel.generic.ObjectType OBJDOUBLE
org.apache.bcel.generic.ObjectType OBJFLOAT
org.apache.bcel.generic.ObjectType OBJINT
org.apache.bcel.generic.ObjectType OBJLONG
org.apache.bcel.generic.ObjectType OBJSHORT
protected boolean generateClassFiles
protected String outputDir
protected boolean listGeneratedCode
protected static InjectionGenerator.PrimitiveTypeInfo[] primitiveTypes
protected static InjectionGenerator instance
| Constructor Detail |
|---|
public InjectionGenerator(boolean generateClassFiles,
String outputDir,
boolean listGeneratedCode)
generateClassFiles - True if we should generate new class files
containing injected methods. This is used by the batch injection code.outputDir - If not the empty string, this is the directory in
which generated class files should be stored.listGeneratedCode - True if we should log the generated methods
in the log file. This is only set when debugging InjectionGenerator.| Method Detail |
|---|
public static InjectionGenerator getInstance()
public org.apache.bcel.classfile.JavaClass maybeInjectMarshalling(org.apache.bcel.classfile.JavaClass clazz,
Short typeNum)
clazz - The BCEL JavaClass instance representing the class filetypeNum - The type number for the class
protected org.apache.bcel.classfile.JavaClass injectMarshallingMethods(org.apache.bcel.classfile.JavaClass clazz,
org.apache.bcel.classfile.JavaClass superclass,
LinkedList<org.apache.bcel.classfile.Field> fields,
LinkedList<Integer> nullTestedFields,
int flagBitCount)
protected void logGeneratedMethod(org.apache.bcel.generic.ClassGen classGen,
org.apache.bcel.generic.MethodGen method)
protected org.apache.bcel.generic.MethodGen createMarshallingMethod(org.apache.bcel.classfile.JavaClass clazz,
org.apache.bcel.classfile.JavaClass superclass,
org.apache.bcel.generic.ConstantPoolGen cp,
org.apache.bcel.generic.InstructionFactory factory,
LinkedList<org.apache.bcel.classfile.Field> fields,
LinkedList<Integer> nullTestedFields,
int flagBitCount)
protected void addMarshallingForField(org.apache.bcel.classfile.JavaClass clazz,
org.apache.bcel.classfile.Field f,
org.apache.bcel.generic.InstructionFactory factory,
org.apache.bcel.generic.InstructionList il)
protected void addMVByteBufferFieldPut(org.apache.bcel.classfile.JavaClass clazz,
org.apache.bcel.classfile.Field f,
org.apache.bcel.generic.Type fieldType,
InjectionGenerator.PrimitiveTypeInfo info,
org.apache.bcel.generic.InstructionFactory factory,
org.apache.bcel.generic.InstructionList il)
protected InjectionGenerator.BranchFixup[] makeOmittedTest(org.apache.bcel.classfile.JavaClass clazz,
org.apache.bcel.classfile.Field f,
org.apache.bcel.generic.InstructionFactory factory,
org.apache.bcel.generic.InstructionList il)
protected org.apache.bcel.generic.MethodGen createUnmarshallingMethod(org.apache.bcel.classfile.JavaClass clazz,
org.apache.bcel.classfile.JavaClass superclass,
org.apache.bcel.generic.ConstantPoolGen cp,
org.apache.bcel.generic.InstructionFactory factory,
LinkedList<org.apache.bcel.classfile.Field> fields,
LinkedList<Integer> nullTestedFields,
int flagBitCount)
protected void addUnmarshallingForField(org.apache.bcel.classfile.JavaClass clazz,
org.apache.bcel.classfile.Field f,
org.apache.bcel.generic.InstructionFactory factory,
org.apache.bcel.generic.ConstantPoolGen cp,
org.apache.bcel.generic.InstructionList il)
protected void addMVByteBufferFieldGet(org.apache.bcel.classfile.JavaClass clazz,
org.apache.bcel.classfile.Field f,
org.apache.bcel.generic.Type fieldType,
InjectionGenerator.PrimitiveTypeInfo info,
org.apache.bcel.generic.InstructionFactory factory,
org.apache.bcel.generic.InstructionList il)
protected void addFieldFetch(org.apache.bcel.classfile.JavaClass clazz,
org.apache.bcel.generic.InstructionFactory factory,
org.apache.bcel.classfile.Field f,
org.apache.bcel.generic.InstructionList il)
protected static org.apache.bcel.classfile.JavaClass lookupClass(String className)
protected static InjectionGenerator.PrimitiveTypeInfo getPrimitiveTypeInfo(org.apache.bcel.generic.Type type)
protected boolean isStringType(org.apache.bcel.generic.Type type)
protected static boolean isPrimitiveObjectType(org.apache.bcel.generic.Type type)
protected static boolean isPrimitiveType(org.apache.bcel.generic.Type type)
protected static String nonPrimitiveObjectTypeName(org.apache.bcel.generic.Type type)
protected org.apache.bcel.generic.Type underlyingPrimitiveType(org.apache.bcel.generic.Type type)
protected org.apache.bcel.generic.Type storageType(org.apache.bcel.generic.Type type)
protected Short getAggregateTypeNum(org.apache.bcel.generic.ObjectType fieldObjectType)
protected String aggregateTypeString(org.apache.bcel.generic.ObjectType fieldObjectType)
protected boolean marshalledByMarshallingRuntimeMarshalObject(org.apache.bcel.generic.ObjectType fieldObjectType)
protected boolean referencesInterface(org.apache.bcel.generic.ObjectType type)
protected boolean doesOrWillHandleMarshallable(org.apache.bcel.generic.ObjectType type)
protected boolean handlesMarshallable(org.apache.bcel.generic.ObjectType type)
public static boolean handlesMarshallable(String typeName)
public static boolean handlesMarshallable(org.apache.bcel.classfile.JavaClass clazz)
protected boolean objectTypeIsInterface(org.apache.bcel.generic.ObjectType type)
public static boolean interfaceClass(String s)
protected static LinkedList<org.apache.bcel.classfile.Field> getValidClassFields(org.apache.bcel.classfile.JavaClass c)
public static org.apache.bcel.classfile.JavaClass getValidSuperclass(org.apache.bcel.classfile.JavaClass c)
protected void noteBranchTargets(InjectionGenerator.BranchFixup[] branchFixups,
org.apache.bcel.generic.InstructionList il)
protected void initStack()
protected void addStack(int count)
protected int getFinalStack()
protected static void logInvoke(String s,
org.apache.bcel.generic.InvokeInstruction iv,
org.apache.bcel.generic.ConstantPoolGen cp)
protected static void throwError(String msg)
protected void initializeGlobals()
public static void initialize(boolean generateClassFiles,
String outputDir,
boolean listGeneratedCode)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||