org.sourceforge.jemm.weaver.transformation
Class ConstructorProxyTransformation
java.lang.Object
org.sourceforge.jemm.weaver.transformation.AbstractClassTransformation
org.sourceforge.jemm.weaver.transformation.ConstructorProxyTransformation
- All Implemented Interfaces:
- Transformation
public class ConstructorProxyTransformation
- extends AbstractClassTransformation
Proxies the constructors creation with a begin and end call.
Produces code similar to:
super();
try {
ConstructorLifecycle.preConstructor(???.class.getName());
super();
ConstructorLifecycle.beginConstructor(this);
//original code
ConstructorLifecycle.endConstructor(this);
} catch(Throwable t) {
ConstructorLifecycle.failedConstructor(this);
throw t;
}
- Author:
- Paul Keeble
Method Summary |
java.lang.String[] |
dependentTransforms()
Depends on ShadowConstructorTransformation (and on ShadowTransformation)
and on InterfaceTransformation. |
boolean |
isTransformableConstructor(javassist.CtConstructor c)
|
void |
transform(javassist.CtClass clazz)
Modifies the passed in CtClass based on the transformation necessary. |
void |
transformConstructor(javassist.CtClass clazz,
javassist.CtConstructor c)
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
ConstructorProxyTransformation
public ConstructorProxyTransformation()
throws javassist.NotFoundException
- Creates a ConstructorProxyTransformation instance.
- Throws:
javassist.NotFoundException
- Likely caused by a classpath issue
transform
public void transform(javassist.CtClass clazz)
throws TransformationException
- Description copied from interface:
Transformation
- Modifies the passed in CtClass based on the transformation necessary.
- Specified by:
transform
in interface Transformation
- Specified by:
transform
in class AbstractClassTransformation
- Parameters:
clazz
- The CtClass to modify
- Throws:
TransformationException
- If an error occurs in the transformation process
transformConstructor
public void transformConstructor(javassist.CtClass clazz,
javassist.CtConstructor c)
throws javassist.CannotCompileException
- Throws:
javassist.CannotCompileException
isTransformableConstructor
public boolean isTransformableConstructor(javassist.CtConstructor c)
dependentTransforms
public java.lang.String[] dependentTransforms()
- Depends on ShadowConstructorTransformation (and on ShadowTransformation)
and on InterfaceTransformation.
- Specified by:
dependentTransforms
in interface Transformation
- Specified by:
dependentTransforms
in class AbstractClassTransformation
- Returns:
- A list of transforms that must run first.
Copyright © 2009. All Rights Reserved.