org.sourceforge.jemm.weaver.transformation
Class AbstractClassTransformation

java.lang.Object
  extended by org.sourceforge.jemm.weaver.transformation.AbstractClassTransformation
All Implemented Interfaces:
Transformation
Direct Known Subclasses:
AbstractShadowConstructorTransformation, ConstructorProxyTransformation, InterfaceTransformation, MethodAnnotationTransformation, MethodProxyTransformation, ShadowTransformation, SynchronizedBlockTransformation

public abstract class AbstractClassTransformation
extends java.lang.Object
implements Transformation

Abstract parent class for concrete class transformers.

Author:
Paul Keeble

Constructor Summary
AbstractClassTransformation()
           
 
Method Summary
abstract  java.lang.String[] dependentTransforms()
          Should return a list of the transformations that this transform requires before it can execute on a class.
 boolean equals(java.lang.Object obj)
          Note that the equals check is not just about equality, but whether the transforms are equivalent.
 java.lang.String getTransformationName()
          When the dependencies for a Transformation are being determined it is this name which should be listed in the dependency list.
 int hashCode()
           
 java.lang.String toString()
           
abstract  void transform(javassist.CtClass clazz)
          Modifies the passed in CtClass based on the transformation necessary.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractClassTransformation

public AbstractClassTransformation()
Method Detail

dependentTransforms

public abstract java.lang.String[] dependentTransforms()
Description copied from interface: Transformation
Should return a list of the transformations that this transform requires before it can execute on a class. For the core Transformations this is equal to getClass().getSimpleName().

Specified by:
dependentTransforms in interface Transformation
Returns:
A list of transforms that must run first.

transform

public abstract 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
Parameters:
clazz - The CtClass to modify
Throws:
TransformationException - If an error occurs in the transformation process

equals

public boolean equals(java.lang.Object obj)
Description copied from interface: Transformation
Note that the equals check is not just about equality, but whether the transforms are equivalent. Any equivalent transforms, even if a different object should result in a true return.

Specified by:
equals in interface Transformation
Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to check for equality.
Returns:
True if equal, false otherwise
See Also:
For the definition of equals, Which implements a default equals and hashcode

hashCode

public int hashCode()
Specified by:
hashCode in interface Transformation
Overrides:
hashCode in class java.lang.Object
Returns:
The hashcode
See Also:
Object.hashCode()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getTransformationName

public java.lang.String getTransformationName()
Description copied from interface: Transformation
When the dependencies for a Transformation are being determined it is this name which should be listed in the dependency list. The name can be anything but AbstractClassTransformation implements this as getClass().getSimpleName() which is used in many of the transformations.

Specified by:
getTransformationName in interface Transformation
Returns:
The name of the transformation used in dependency matching


Copyright © 2009. All Rights Reserved.