public class JDOPropertyGetterAdapter
extends org.objectweb.asm.MethodVisitor
YYY aaaGetZZZ() { if (aaaFlags > 0 && aaaStateManager != null && !aaaStateManager.isLoaded(this, 0)) return (Integer) aaaStateManager.getObjectField(this, 0, aaaGetXXX()); if (aaaIsDetached() && !((BitSet) aaaDetachedState[2]).get(0)) throw new DetachedFieldAccessException ("You have just attempted to access property \"id\" yet this field was not detached ..."); return aaaGetXXX(); }and when not detachable
YYY aaaGetZZZ() { if (aaaFlags > 0 && aaaStateManager != null && !aaaStateManager.isLoaded(this, 0)) return (Integer) aaaStateManager.getObjectField(this, 0, aaaGetXXX()); return aaaGetXXX(); }There are other variants for MEDIATE_READ and NORMAL_READ
Modifier and Type | Field and Description |
---|---|
protected ClassEnhancer |
enhancer
The enhancer for this class.
|
protected static Localiser |
LOCALISER
Localisation of messages.
|
protected String |
methodDescriptor
Descriptor for the method being adapted.
|
protected String |
methodName
Name for the method being adapted.
|
protected AbstractMemberMetaData |
mmd
MetaData for the property.
|
protected org.objectweb.asm.MethodVisitor |
visitor
Visitor for the aaaGetXXX method.
|
Constructor and Description |
---|
JDOPropertyGetterAdapter(org.objectweb.asm.MethodVisitor mv,
ClassEnhancer enhancer,
String methodName,
String methodDesc,
AbstractMemberMetaData mmd,
org.objectweb.asm.ClassVisitor cv)
Constructor for the method adapter.
|
Modifier and Type | Method and Description |
---|---|
static void |
generateGetXXXMethod(org.objectweb.asm.MethodVisitor mv,
AbstractMemberMetaData mmd,
String asmClassName,
String asmClassDesc,
boolean detachListener,
boolean includeFrames,
EnhancementNamer namer)
Convenience method to use the MethodVisitor to generate the code for the method getXXX() for the
property with the specified MetaData.
|
org.objectweb.asm.AnnotationVisitor |
visitAnnotation(String arg0,
boolean arg1) |
org.objectweb.asm.AnnotationVisitor |
visitAnnotationDefault() |
void |
visitAttribute(org.objectweb.asm.Attribute arg0) |
void |
visitCode() |
void |
visitEnd()
Method called at the end of visiting the getXXX method.
|
void |
visitFieldInsn(int arg0,
String arg1,
String arg2,
String arg3) |
void |
visitFrame(int arg0,
int arg1,
Object[] arg2,
int arg3,
Object[] arg4) |
void |
visitIincInsn(int arg0,
int arg1) |
void |
visitInsn(int arg0) |
void |
visitIntInsn(int arg0,
int arg1) |
void |
visitJumpInsn(int arg0,
org.objectweb.asm.Label arg1) |
void |
visitLabel(org.objectweb.asm.Label arg0) |
void |
visitLdcInsn(Object arg0) |
void |
visitLineNumber(int arg0,
org.objectweb.asm.Label arg1) |
void |
visitLocalVariable(String arg0,
String arg1,
String arg2,
org.objectweb.asm.Label arg3,
org.objectweb.asm.Label arg4,
int arg5) |
void |
visitLookupSwitchInsn(org.objectweb.asm.Label arg0,
int[] arg1,
org.objectweb.asm.Label[] arg2) |
void |
visitMaxs(int arg0,
int arg1) |
void |
visitMethodInsn(int arg0,
String arg1,
String arg2,
String arg3) |
void |
visitMultiANewArrayInsn(String arg0,
int arg1) |
org.objectweb.asm.AnnotationVisitor |
visitParameterAnnotation(int arg0,
String arg1,
boolean arg2) |
void |
visitTableSwitchInsn(int arg0,
int arg1,
org.objectweb.asm.Label arg2,
org.objectweb.asm.Label... arg3) |
void |
visitTryCatchBlock(org.objectweb.asm.Label arg0,
org.objectweb.asm.Label arg1,
org.objectweb.asm.Label arg2,
String arg3) |
void |
visitTypeInsn(int arg0,
String arg1) |
void |
visitVarInsn(int arg0,
int arg1) |
protected static final Localiser LOCALISER
protected ClassEnhancer enhancer
protected String methodName
protected String methodDescriptor
protected AbstractMemberMetaData mmd
protected org.objectweb.asm.MethodVisitor visitor
public JDOPropertyGetterAdapter(org.objectweb.asm.MethodVisitor mv, ClassEnhancer enhancer, String methodName, String methodDesc, AbstractMemberMetaData mmd, org.objectweb.asm.ClassVisitor cv)
mv
- MethodVisitorenhancer
- ClassEnhancer for the class with the methodmethodName
- Name of the methodmethodDesc
- Method descriptormmd
- MetaData for the propertycv
- ClassVisitorpublic void visitEnd()
visitEnd
in class org.objectweb.asm.MethodVisitor
public static void generateGetXXXMethod(org.objectweb.asm.MethodVisitor mv, AbstractMemberMetaData mmd, String asmClassName, String asmClassDesc, boolean detachListener, boolean includeFrames, EnhancementNamer namer)
mv
- MethodVisitormmd
- MetaData for the propertyasmClassName
- ASM class name for the owning classasmClassDesc
- ASM descriptor for the owning classdetachListener
- true if the generate code must support DetachListenerpublic org.objectweb.asm.AnnotationVisitor visitAnnotation(String arg0, boolean arg1)
visitAnnotation
in class org.objectweb.asm.MethodVisitor
public org.objectweb.asm.AnnotationVisitor visitAnnotationDefault()
visitAnnotationDefault
in class org.objectweb.asm.MethodVisitor
public void visitAttribute(org.objectweb.asm.Attribute arg0)
visitAttribute
in class org.objectweb.asm.MethodVisitor
public void visitCode()
visitCode
in class org.objectweb.asm.MethodVisitor
public void visitFieldInsn(int arg0, String arg1, String arg2, String arg3)
visitFieldInsn
in class org.objectweb.asm.MethodVisitor
public void visitFrame(int arg0, int arg1, Object[] arg2, int arg3, Object[] arg4)
visitFrame
in class org.objectweb.asm.MethodVisitor
public void visitIincInsn(int arg0, int arg1)
visitIincInsn
in class org.objectweb.asm.MethodVisitor
public void visitInsn(int arg0)
visitInsn
in class org.objectweb.asm.MethodVisitor
public void visitIntInsn(int arg0, int arg1)
visitIntInsn
in class org.objectweb.asm.MethodVisitor
public void visitJumpInsn(int arg0, org.objectweb.asm.Label arg1)
visitJumpInsn
in class org.objectweb.asm.MethodVisitor
public void visitLabel(org.objectweb.asm.Label arg0)
visitLabel
in class org.objectweb.asm.MethodVisitor
public void visitLdcInsn(Object arg0)
visitLdcInsn
in class org.objectweb.asm.MethodVisitor
public void visitLineNumber(int arg0, org.objectweb.asm.Label arg1)
visitLineNumber
in class org.objectweb.asm.MethodVisitor
public void visitLocalVariable(String arg0, String arg1, String arg2, org.objectweb.asm.Label arg3, org.objectweb.asm.Label arg4, int arg5)
visitLocalVariable
in class org.objectweb.asm.MethodVisitor
public void visitLookupSwitchInsn(org.objectweb.asm.Label arg0, int[] arg1, org.objectweb.asm.Label[] arg2)
visitLookupSwitchInsn
in class org.objectweb.asm.MethodVisitor
public void visitMaxs(int arg0, int arg1)
visitMaxs
in class org.objectweb.asm.MethodVisitor
public void visitMethodInsn(int arg0, String arg1, String arg2, String arg3)
visitMethodInsn
in class org.objectweb.asm.MethodVisitor
public void visitMultiANewArrayInsn(String arg0, int arg1)
visitMultiANewArrayInsn
in class org.objectweb.asm.MethodVisitor
public org.objectweb.asm.AnnotationVisitor visitParameterAnnotation(int arg0, String arg1, boolean arg2)
visitParameterAnnotation
in class org.objectweb.asm.MethodVisitor
public void visitTableSwitchInsn(int arg0, int arg1, org.objectweb.asm.Label arg2, org.objectweb.asm.Label... arg3)
visitTableSwitchInsn
in class org.objectweb.asm.MethodVisitor
public void visitTryCatchBlock(org.objectweb.asm.Label arg0, org.objectweb.asm.Label arg1, org.objectweb.asm.Label arg2, String arg3)
visitTryCatchBlock
in class org.objectweb.asm.MethodVisitor
public void visitTypeInsn(int arg0, String arg1)
visitTypeInsn
in class org.objectweb.asm.MethodVisitor
public void visitVarInsn(int arg0, int arg1)
visitVarInsn
in class org.objectweb.asm.MethodVisitor
Copyright © 2019. All rights reserved.