jodd.proxetta.asm
Class ProxettaWrapperClassBuilder

java.lang.Object
  extended by jodd.asm.EmptyClassVisitor
      extended by jodd.proxetta.asm.ProxettaClassBuilder
          extended by jodd.proxetta.asm.ProxettaWrapperClassBuilder
All Implemented Interfaces:
org.objectweb.asm.ClassVisitor

public class ProxettaWrapperClassBuilder
extends ProxettaClassBuilder


Field Summary
protected  java.lang.Class targetClassOrInterface
           
protected  java.lang.String targetFieldName
           
protected  java.lang.Class targetInterface
           
 
Fields inherited from class jodd.proxetta.asm.ProxettaClassBuilder
aspects, reqProxyClassName, suffix, targetClassInfo, wd
 
Constructor Summary
ProxettaWrapperClassBuilder(java.lang.Class targetClassOrInterface, java.lang.Class targetInterface, java.lang.String targetFieldName, org.objectweb.asm.ClassVisitor dest, ProxyAspect[] aspects, java.lang.String suffix, java.lang.String reqProxyClassName, TargetClassInfoReader targetClassInfoReader)
           
 
Method Summary
protected  ProxettaMethodBuilder applyProxy(MethodSignatureVisitor msign)
          Check if proxy should be applied on method and return proxy method builder if so.
protected  void createEmptyCtor()
          Created empty default constructor.
protected  void createSimpleMethodWrapper(MethodSignatureVisitor msign)
          Creates simple method wrapper without proxy.
 void visit(int version, int access, java.lang.String name, java.lang.String signature, java.lang.String superName, java.lang.String[] interfaces)
          Creates destination subclass header from current target class.
 void visitEnd()
          Finalizes creation of destination proxy class.
 org.objectweb.asm.MethodVisitor visitMethod(int access, java.lang.String name, java.lang.String desc, java.lang.String signature, java.lang.String[] exceptions)
          Creates proxified methods and constructors.
 
Methods inherited from class jodd.proxetta.asm.ProxettaClassBuilder
getWorkData, makeProxyConstructor, makeStaticInitBlock, matchMethodPointcuts, processSuperMethods, visitAnnotation, visitAttribute, visitField, visitInnerClass, visitOuterClass, visitSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

targetClassOrInterface

protected final java.lang.Class targetClassOrInterface

targetInterface

protected final java.lang.Class targetInterface

targetFieldName

protected final java.lang.String targetFieldName
Constructor Detail

ProxettaWrapperClassBuilder

public ProxettaWrapperClassBuilder(java.lang.Class targetClassOrInterface,
                                   java.lang.Class targetInterface,
                                   java.lang.String targetFieldName,
                                   org.objectweb.asm.ClassVisitor dest,
                                   ProxyAspect[] aspects,
                                   java.lang.String suffix,
                                   java.lang.String reqProxyClassName,
                                   TargetClassInfoReader targetClassInfoReader)
Method Detail

visit

public void visit(int version,
                  int access,
                  java.lang.String name,
                  java.lang.String signature,
                  java.lang.String superName,
                  java.lang.String[] interfaces)
Creates destination subclass header from current target class. Destination name is created from targets by adding a suffix and, optionally, a number. Destination extends the target.

Specified by:
visit in interface org.objectweb.asm.ClassVisitor
Overrides:
visit in class ProxettaClassBuilder
Parameters:
version - the class version.
access - the class's access flags. This parameter also indicates if the class is deprecated.
name - the internal name of the class.
signature - the signature of this class. May be null if the class is not a generic one, and does not extend or implement generic classes or interfaces.
superName - the internal of name of the super class. For interfaces, the super class is Object. May be null, but only for the Object class.
interfaces - the internal names of the class's interfaces. May be null.

createEmptyCtor

protected void createEmptyCtor()
Created empty default constructor.


visitMethod

public org.objectweb.asm.MethodVisitor visitMethod(int access,
                                                   java.lang.String name,
                                                   java.lang.String desc,
                                                   java.lang.String signature,
                                                   java.lang.String[] exceptions)
Creates proxified methods and constructors. Destination proxy will have all constructors as a target class, using ProxettaCtorBuilder. Static initializers are removed, since they will be execute in target anyway. For each method, ProxettaMethodBuilder determines if method matches pointcut. If so, method will be proxified.

Specified by:
visitMethod in interface org.objectweb.asm.ClassVisitor
Overrides:
visitMethod in class ProxettaClassBuilder
Parameters:
access - the method's access flags. This parameter also indicates if the method is synthetic and/or deprecated.
name - the method's name.
desc - the method's descriptor.
signature - the method's signature. May be null if the method parameters, return type and exceptions do not use generic types.
exceptions - the internal names of the method's exception classes. May be null.
Returns:
an object to visit the byte code of the method, or null if this class visitor is not interested in visiting the code of this method.

applyProxy

protected ProxettaMethodBuilder applyProxy(MethodSignatureVisitor msign)
Description copied from class: ProxettaClassBuilder
Check if proxy should be applied on method and return proxy method builder if so. Otherwise, returns null.

Overrides:
applyProxy in class ProxettaClassBuilder

createSimpleMethodWrapper

protected void createSimpleMethodWrapper(MethodSignatureVisitor msign)
Creates simple method wrapper without proxy.


visitEnd

public void visitEnd()
Description copied from class: ProxettaClassBuilder
Finalizes creation of destination proxy class.

Specified by:
visitEnd in interface org.objectweb.asm.ClassVisitor
Overrides:
visitEnd in class ProxettaClassBuilder


Copyright © 2003-2012 Jodd Team