org.sourceforge.jemm.weaver.transformation
Class ShadowTransformation

java.lang.Object
  extended by org.sourceforge.jemm.weaver.transformation.AbstractClassTransformation
      extended by org.sourceforge.jemm.weaver.transformation.ShadowTransformation
All Implemented Interfaces:
Transformation

public class ShadowTransformation
extends AbstractClassTransformation

Adds the ShadowObject field called jemmOIF to the class.

Author:
Paul Keeble

Field Summary
static java.lang.String COMPILER_VERSION_VARIABLE_NAME
          The name of the compiler version variable added to user classes.
static java.lang.String SHADOW_CLASS
          The class of the shadow reference held by user classes.
static java.lang.String SHADOW_VARIABLE_NAME
          The name of the ShadowObject variable added to user classes.
protected  javassist.CtClass type
           
 
Constructor Summary
ShadowTransformation()
          Creates a new ShadowObject.
 
Method Summary
 java.lang.String[] dependentTransforms()
          Has no dependencies and hence returns an empty array
 void transform(javassist.CtClass clazz)
          Adds the ShadowObject instance to the class as a protected field.
 
Methods inherited from class org.sourceforge.jemm.weaver.transformation.AbstractClassTransformation
equals, getTransformationName, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SHADOW_VARIABLE_NAME

public static final java.lang.String SHADOW_VARIABLE_NAME
The name of the ShadowObject variable added to user classes.

See Also:
Constant Field Values

COMPILER_VERSION_VARIABLE_NAME

public static final java.lang.String COMPILER_VERSION_VARIABLE_NAME
The name of the compiler version variable added to user classes.

See Also:
Constant Field Values

SHADOW_CLASS

public static final java.lang.String SHADOW_CLASS
The class of the shadow reference held by user classes.


type

protected final javassist.CtClass type
Constructor Detail

ShadowTransformation

public ShadowTransformation()
                     throws javassist.NotFoundException
Creates a new ShadowObject.

Throws:
javassist.NotFoundException - If ShadowObject class can not be loaded
Method Detail

transform

public void transform(javassist.CtClass clazz)
               throws TransformationException
Adds the ShadowObject instance to the class as a protected field.

Specified by:
transform in interface Transformation
Specified by:
transform in class AbstractClassTransformation
Parameters:
clazz - The class to modify
Throws:
TransformationException - If the field can not be added.

dependentTransforms

public java.lang.String[] dependentTransforms()
Has no dependencies and hence returns an empty array

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.