org.multiverse.instrumentation
Class AbstractInstrumentationPhase

java.lang.Object
  extended by org.multiverse.instrumentation.AbstractInstrumentationPhase
All Implemented Interfaces:
InstrumentationPhase
Direct Known Subclasses:
JSRInlineInstrumentationPhase, PreventReinstrumentationInstrumentationPhase

public abstract class AbstractInstrumentationPhase
extends java.lang.Object
implements InstrumentationPhase

Abstract InstrumentationPhase that provides some basic plumbing.

Author:
Peter Veentjer

Constructor Summary
AbstractInstrumentationPhase(java.lang.String name)
           
 
Method Summary
protected  void doInit()
           
protected abstract  Clazz doInstrument(Environment environment, Clazz clazz)
           
 java.lang.String getName()
          Returns the name for this InstrumentationPhase.
 Clazz instrument(Environment environment, Clazz originalClazz)
          Compiles (transforms) the originalClazz.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractInstrumentationPhase

public AbstractInstrumentationPhase(java.lang.String name)
Method Detail

getName

public java.lang.String getName()
Description copied from interface: InstrumentationPhase
Returns the name for this InstrumentationPhase. It is only used for logging purposes.

Specified by:
getName in interface InstrumentationPhase
Returns:
the name of this InstrumentationPhase.

instrument

public Clazz instrument(Environment environment,
                        Clazz originalClazz)
Description copied from interface: InstrumentationPhase
Compiles (transforms) the originalClazz. If nothing is changed, the originalClazz can be returned. The returned value never should be null.

Specified by:
instrument in interface InstrumentationPhase
originalClazz - the originalClazz.
Returns:
the compiled clazz. Null means that following compile phases should be skipped. This makes it possible to add control flow compile phases (for example if the class already has been

toString

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

doInit

protected void doInit()

doInstrument

protected abstract Clazz doInstrument(Environment environment,
                                      Clazz clazz)


Copyright © 2008-2010 Multiverse. All Rights Reserved.