org.codehaus.aspectwerkz.transform
Class TransformationUtil

java.lang.Object
  extended by org.codehaus.aspectwerkz.transform.TransformationUtil

public final class TransformationUtil
extends Object

Utility method used by the transformers.

Author:
Jonas BonŽr

Constructor Summary
TransformationUtil()
           
 
Method Summary
static String getConstructorBodyMethodName(String calleeTypeName)
          Returns the method name used for constructor body
static String getConstructorBodyMethodSignature(String ctorDesc, String calleeTypeName)
          Returns the method used for constructor body signature The callee type name is prepended to the constructor signature
static String getInvokeSignatureForCodeJoinPoints(int codeModifiers, String codeDesc, String callerTypeName, String calleeTypeName)
          Build the join point invoke method descriptor for code (method or constructor) join points.
static String getInvokeSignatureForConstructorCallJoinPoints(String calleeConstructorDesc, String callerTypeName, String calleeTypeName)
          Build the join point invoke method descriptor for ctor call join points.
static String getInvokeSignatureForFieldJoinPoints(int fieldModifiers, String fieldDesc, String callerTypeName, String calleeTypeName)
          Build the join point invoke method descriptor for field join points.
static String getInvokeSignatureForHandlerJoinPoints(String withinTypeName, String exceptionTypeName)
          Build the join point invoke method descriptor for handler join points.
static String getJoinPointClassName(String thisClassName, String thisMemberName, String thisMemberDesc, String targetClassName, int joinPointType, int joinPointHash)
          Computes the joinpoint classname : "caller/class_type_hash_suffix" For constructor call joinpoints, the hash of callee name is used as well.
static String getPrefixedOriginalClinitName(String className)
          Return the prefixed clinit method name
static String getPrefixedOriginalMethodName(String methodName, String className)
          Returns the prefixed method name.
static String getWrapperMethodName(String methodName, String methodDesc, String className, String prefix)
          Returns the prefixed method name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransformationUtil

public TransformationUtil()
Method Detail

getPrefixedOriginalClinitName

public static String getPrefixedOriginalClinitName(String className)
Return the prefixed clinit method name

Parameters:
className -
Returns:

getPrefixedOriginalMethodName

public static String getPrefixedOriginalMethodName(String methodName,
                                                   String className)
Returns the prefixed method name.

Parameters:
methodName - the method name
className - the class name
Returns:
the name of the join point

getWrapperMethodName

public static String getWrapperMethodName(String methodName,
                                          String methodDesc,
                                          String className,
                                          String prefix)
Returns the prefixed method name.

Parameters:
methodName - the method name
methodDesc - the method desc
className - the class name
Returns:
the name of the join point

getInvokeSignatureForCodeJoinPoints

public static String getInvokeSignatureForCodeJoinPoints(int codeModifiers,
                                                         String codeDesc,
                                                         String callerTypeName,
                                                         String calleeTypeName)
Build the join point invoke method descriptor for code (method or constructor) join points. Depends if the target method is static or not.

Parameters:
codeModifiers -
codeDesc -
callerTypeName -
calleeTypeName -
Returns:

getInvokeSignatureForFieldJoinPoints

public static String getInvokeSignatureForFieldJoinPoints(int fieldModifiers,
                                                          String fieldDesc,
                                                          String callerTypeName,
                                                          String calleeTypeName)
Build the join point invoke method descriptor for field join points. Depends if the target field is static or not.

Parameters:
fieldModifiers -
fieldDesc -
callerTypeName -
calleeTypeName -
Returns:
the signature

getInvokeSignatureForHandlerJoinPoints

public static String getInvokeSignatureForHandlerJoinPoints(String withinTypeName,
                                                            String exceptionTypeName)
Build the join point invoke method descriptor for handler join points. "Exception invoke(Exception, WithinInstance[can be null])"

Parameters:
withinTypeName -
exceptionTypeName -
Returns:
the signature

getInvokeSignatureForConstructorCallJoinPoints

public static String getInvokeSignatureForConstructorCallJoinPoints(String calleeConstructorDesc,
                                                                    String callerTypeName,
                                                                    String calleeTypeName)
Build the join point invoke method descriptor for ctor call join points.

Parameters:
calleeConstructorDesc -
callerTypeName -
calleeTypeName -
Returns:
the signature

getConstructorBodyMethodName

public static String getConstructorBodyMethodName(String calleeTypeName)
Returns the method name used for constructor body

Parameters:
calleeTypeName -
Returns:

getConstructorBodyMethodSignature

public static String getConstructorBodyMethodSignature(String ctorDesc,
                                                       String calleeTypeName)
Returns the method used for constructor body signature The callee type name is prepended to the constructor signature

Parameters:
ctorDesc -
calleeTypeName -
Returns:

getJoinPointClassName

public static String getJoinPointClassName(String thisClassName,
                                           String thisMemberName,
                                           String thisMemberDesc,
                                           String targetClassName,
                                           int joinPointType,
                                           int joinPointHash)
Computes the joinpoint classname : "caller/class_type_hash_suffix" For constructor call joinpoints, the hash of callee name is used as well.

Parameters:
thisClassName -
thisMemberName -
thisMemberDesc -
targetClassName -
joinPointType -
joinPointHash -
Returns:
the JIT joinpoint classname


Copyright © 2002-2005 Jonas Bonér, Alexandre Vasseur. All Rights Reserved.