org.datanucleus.enhancer.asm
Class JdoMethodAdapter

java.lang.Object
  extended by org.objectweb.asm.MethodAdapter
      extended by org.datanucleus.enhancer.asm.JdoMethodAdapter
All Implemented Interfaces:
org.objectweb.asm.MethodVisitor

public class JdoMethodAdapter
extends org.objectweb.asm.MethodAdapter

Adapter for methods in JDO-enabled classes allowing enhancement of direct access to user fields. Currently performs the following updates


Field Summary
protected  ASMClassEnhancer enhancer
          The enhancer for this class.
protected static org.datanucleus.util.Localiser LOCALISER
          Localisation of messages.
protected  java.lang.String methodDescriptor
          Descriptor for the method being adapted.
protected  java.lang.String methodName
          Name for the method being adapted.
 
Fields inherited from class org.objectweb.asm.MethodAdapter
mv
 
Constructor Summary
JdoMethodAdapter(org.objectweb.asm.MethodVisitor mv, ASMClassEnhancer enhancer, java.lang.String methodName, java.lang.String methodDesc)
          Constructor for the method adapter.
 
Method Summary
 void visitFieldInsn(int opcode, java.lang.String owner, java.lang.String name, java.lang.String desc)
          Method to intercept any calls to fields.
 void visitInsn(int opcode)
          Method to intercept any general instructions.
 void visitMethodInsn(int opcode, java.lang.String owner, java.lang.String name, java.lang.String desc)
          Method to intercept any calls to methods.
 
Methods inherited from class org.objectweb.asm.MethodAdapter
visitAnnotation, visitAnnotationDefault, visitAttribute, visitCode, visitEnd, visitFrame, visitIincInsn, visitIntInsn, visitJumpInsn, visitLabel, visitLdcInsn, visitLineNumber, visitLocalVariable, visitLookupSwitchInsn, visitMaxs, visitMultiANewArrayInsn, visitParameterAnnotation, visitTableSwitchInsn, visitTryCatchBlock, visitTypeInsn, visitVarInsn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCALISER

protected static org.datanucleus.util.Localiser LOCALISER
Localisation of messages.


enhancer

protected ASMClassEnhancer enhancer
The enhancer for this class.


methodName

protected java.lang.String methodName
Name for the method being adapted.


methodDescriptor

protected java.lang.String methodDescriptor
Descriptor for the method being adapted.

Constructor Detail

JdoMethodAdapter

public JdoMethodAdapter(org.objectweb.asm.MethodVisitor mv,
                        ASMClassEnhancer enhancer,
                        java.lang.String methodName,
                        java.lang.String methodDesc)
Constructor for the method adapter.

Parameters:
mv - MethodVisitor
enhancer - ClassEnhancer for the class with the method
Method Detail

visitFieldInsn

public void visitFieldInsn(int opcode,
                           java.lang.String owner,
                           java.lang.String name,
                           java.lang.String desc)
Method to intercept any calls to fields.

Specified by:
visitFieldInsn in interface org.objectweb.asm.MethodVisitor
Overrides:
visitFieldInsn in class org.objectweb.asm.MethodAdapter
Parameters:
opcode - Operation
owner - Owner class
name - Name of the field
desc - Descriptor for the field

visitMethodInsn

public void visitMethodInsn(int opcode,
                            java.lang.String owner,
                            java.lang.String name,
                            java.lang.String desc)
Method to intercept any calls to methods.

Specified by:
visitMethodInsn in interface org.objectweb.asm.MethodVisitor
Overrides:
visitMethodInsn in class org.objectweb.asm.MethodAdapter
Parameters:
opcode - Operation
owner - Owner class
name - Name of the field
desc - Descriptor for the field

visitInsn

public void visitInsn(int opcode)
Method to intercept any general instructions. We use it to intercept any RETURN on a static initialisation block so we can append to it.

Specified by:
visitInsn in interface org.objectweb.asm.MethodVisitor
Overrides:
visitInsn in class org.objectweb.asm.MethodAdapter
Parameters:
opcode - Operation


Copyright © 2011. All Rights Reserved.