public class TopLinkClassWeaver extends ClassAdapter implements Constants
TopLinkMethodWeaver
Modifier and Type | Field and Description |
---|---|
boolean |
alreadyWeaved |
protected ClassDetails |
classDetails |
static String |
TW_SHORT_SIGNATURE |
static String |
VH_SHORT_SIGNATURE |
static String |
VHI_CLASSNAME |
static String |
VHI_SHORT_SIGNATURE |
static String |
VHI_SIGNATURE |
boolean |
weavedVH |
cv
AALOAD, AASTORE, ACC_ABSTRACT, ACC_ANNOTATION, ACC_BRIDGE, ACC_DEPRECATED, ACC_ENUM, ACC_FINAL, ACC_INTERFACE, ACC_NATIVE, ACC_PRIVATE, ACC_PROTECTED, ACC_PUBLIC, ACC_STATIC, ACC_STRICT, ACC_SUPER, ACC_SYNCHRONIZED, ACC_SYNTHETIC, ACC_TRANSIENT, ACC_VARARGS, ACC_VOLATILE, ACONST_NULL, ALOAD, ANEWARRAY, ARETURN, ARRAYLENGTH, ASTORE, ATHROW, BALOAD, BASTORE, BIPUSH, CALOAD, CASTORE, CHECKCAST, D2F, D2I, D2L, DADD, DALOAD, DASTORE, DCMPG, DCMPL, DCONST_0, DCONST_1, DDIV, DLOAD, DMUL, DNEG, DREM, DRETURN, DSTORE, DSUB, DUP, DUP_X1, DUP_X2, DUP2, DUP2_X1, DUP2_X2, F2D, F2I, F2L, FADD, FALOAD, FASTORE, FCMPG, FCMPL, FCONST_0, FCONST_1, FCONST_2, FDIV, FLOAD, FMUL, FNEG, FREM, FRETURN, FSTORE, FSUB, GETFIELD, GETSTATIC, GOTO, I2B, I2C, I2D, I2F, I2L, I2S, IADD, IALOAD, IAND, IASTORE, ICONST_0, ICONST_1, ICONST_2, ICONST_3, ICONST_4, ICONST_5, ICONST_M1, IDIV, IF_ACMPEQ, IF_ACMPNE, IF_ICMPEQ, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE, IF_ICMPLT, IF_ICMPNE, IFEQ, IFGE, IFGT, IFLE, IFLT, IFNE, IFNONNULL, IFNULL, IINC, ILOAD, IMUL, INEG, INSTANCEOF, INVOKEINTERFACE, INVOKESPECIAL, INVOKESTATIC, INVOKEVIRTUAL, IOR, IREM, IRETURN, ISHL, ISHR, ISTORE, ISUB, IUSHR, IXOR, JSR, L2D, L2F, L2I, LADD, LALOAD, LAND, LASTORE, LCMP, LCONST_0, LCONST_1, LDC, LDIV, LLOAD, LMUL, LNEG, LOOKUPSWITCH, LOR, LREM, LRETURN, LSHL, LSHR, LSTORE, LSUB, LUSHR, LXOR, MONITORENTER, MONITOREXIT, MULTIANEWARRAY, NEW, NEWARRAY, NOP, POP, POP2, PUTFIELD, PUTSTATIC, RET, RETURN, SALOAD, SASTORE, SIPUSH, SWAP, T_BOOLEAN, T_BYTE, T_CHAR, T_DOUBLE, T_FLOAT, T_INT, T_LONG, T_SHORT, TABLESWITCH, V1_1, V1_2, V1_3, V1_4, V1_5
Constructor and Description |
---|
TopLinkClassWeaver(ClassWriter classWriter,
ClassDetails classDetails) |
Modifier and Type | Method and Description |
---|---|
void |
addGetterMethodForFieldAccess(ClassDetails classDetails,
AttributeDetails attributeDetails)
INTERNAL:
Adds a convenience method used to replace a GETFIELD when field access is used.
|
void |
addGetterMethodForValueHolder(ClassDetails classDetails,
AttributeDetails attributeDetails)
INTERNAL:
Add a get method for the newly added valueholder.
|
void |
addSetterMethodForFieldAccess(ClassDetails classDetails,
AttributeDetails attributeDetails)
INTERNAL:
Adds a convenience method used to replace a PUTFIELD when field access is used.
|
void |
addSetterMethodForValueHolder(ClassDetails classDetails,
AttributeDetails attributeDetails)
INTERNAL:
Add a set method for the newly added ValueHolder.
|
void |
addValueHolder(AttributeDetails attributeDetails)
INTERNAL:
Add a variable of type ValueHolderInterface to the class.
|
void |
visit(int version,
int access,
String name,
String superName,
String[] interfaces,
String sourceFile)
Visits the header of the class.
|
void |
visitAttribute(Attribute attr)
Visits a non standard attribute of the class.
|
void |
visitEnd()
Visits the end of the class.
|
CodeVisitor |
visitMethod(int access,
String methodName,
String desc,
String[] exceptions,
Attribute attrs)
INTERNAL:
Construct a TopLinkMethodWeaver and allow it to process the method.
|
visitField, visitInnerClass
public static final String VHI_CLASSNAME
public static final String VH_SHORT_SIGNATURE
public static final String VHI_SHORT_SIGNATURE
public static final String VHI_SIGNATURE
public static final String TW_SHORT_SIGNATURE
protected ClassDetails classDetails
public boolean alreadyWeaved
public boolean weavedVH
public TopLinkClassWeaver(ClassWriter classWriter, ClassDetails classDetails)
public void addValueHolder(AttributeDetails attributeDetails)
public void addGetterMethodForValueHolder(ClassDetails classDetails, AttributeDetails attributeDetails)
public void addSetterMethodForValueHolder(ClassDetails classDetails, AttributeDetails attributeDetails)
public void addSetterMethodForFieldAccess(ClassDetails classDetails, AttributeDetails attributeDetails)
public void addGetterMethodForFieldAccess(ClassDetails classDetails, AttributeDetails attributeDetails)
public void visit(int version, int access, String name, String superName, String[] interfaces, String sourceFile)
ClassVisitor
visit
in interface ClassVisitor
visit
in class ClassAdapter
version
- the class version.access
- the class's access flags (see Constants
). This
parameter also indicates if the class is deprecated.name
- the internal name of the class (see getInternalName
).superName
- the internal of name of the super class (see getInternalName
). For interfaces, the super
class is Object
. May be null, but only for the java.lang.Object
class.interfaces
- the internal names of the class's interfaces (see getInternalName
). May be null.sourceFile
- the name of the source file from which this class was
compiled. May be null.public CodeVisitor visitMethod(int access, String methodName, String desc, String[] exceptions, Attribute attrs)
visitMethod
in interface ClassVisitor
visitMethod
in class ClassAdapter
access
- the method's access flags (see Constants
). This
parameter also indicates if the method is synthetic and/or deprecated.methodName
- the method's name.desc
- the method's descriptor (see Type
).exceptions
- the internal names of the method's exception
classes (see getInternalName
). May be
null.attrs
- the non standard method attributes, linked together by their
next field. May be null.public void visitAttribute(Attribute attr)
ClassVisitor
visitAttribute
in interface ClassVisitor
visitAttribute
in class ClassAdapter
attr
- a non standard class attribute. Must not be null.public void visitEnd()
ClassVisitor
visitEnd
in interface ClassVisitor
visitEnd
in class ClassAdapter
Copyright © 2021. All rights reserved.