org.multiverse.instrumentation
Class StandardInstrumentor

java.lang.Object
  extended by org.multiverse.instrumentation.StandardInstrumentor
All Implemented Interfaces:
Instrumentor

public class StandardInstrumentor
extends java.lang.Object
implements Instrumentor

Author:
Peter Veentjer

Constructor Summary
StandardInstrumentor(java.lang.String compilerName, java.lang.String compilerVersion, java.lang.String stmName)
           
 
Method Summary
protected  void add(InstrumentationPhase phase)
           
 void addExcluded(java.lang.String ignored)
           
 void addIncluded(java.lang.String included)
          Add a pattern that is included.
 java.io.File getDumpDirectory()
           
 java.lang.String getInstrumentorName()
          Returns the name of this Instrumentor.
 java.lang.String getInstrumentorVersion()
          Returns the version of this Instrumentor.
 java.lang.String getStmName()
          Returns the name of the Stm this Instrumentor is going to do the instrumentation for.
 Clazz process(Clazz originalClazz)
          Processes a clazz.
 void setDumpBytecode(boolean dumpBytecode)
          If the bytecode generated by this Instrumentor should be dumped for debugging purposes.
 void setDumpDirectory(java.io.File dumpDirectory)
          Sets the location of this Instrumentor.
 void setFiler(Filer filer)
          Sets the Filer for this Instrumentor.
 void setLog(InstrumenterLogger log)
          Sets the InstrumenterLogger this Instrumentor uses to execute log statements on.
 void setOptimize(boolean optimize)
           
 void setResolver(Resolver resolver)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StandardInstrumentor

public StandardInstrumentor(java.lang.String compilerName,
                            java.lang.String compilerVersion,
                            java.lang.String stmName)
Method Detail

add

protected final void add(InstrumentationPhase phase)

getInstrumentorName

public java.lang.String getInstrumentorName()
Description copied from interface: Instrumentor
Returns the name of this Instrumentor. Needed for identification and logging purpuses.

Specified by:
getInstrumentorName in interface Instrumentor
Returns:
the name of this Instrumentor.
See Also:
Instrumentor.getInstrumentorVersion()

getInstrumentorVersion

public java.lang.String getInstrumentorVersion()
Description copied from interface: Instrumentor
Returns the version of this Instrumentor. Needed for identification and logging purposes.

Specified by:
getInstrumentorVersion in interface Instrumentor
Returns:
the version of this Instrumentor.
See Also:
Instrumentor.getInstrumentorName()

getStmName

public java.lang.String getStmName()
Description copied from interface: Instrumentor
Returns the name of the Stm this Instrumentor is going to do the instrumentation for. It is purely used for debugging/logging purposes.

Specified by:
getStmName in interface Instrumentor
Returns:
the name of the Stm

addExcluded

public void addExcluded(java.lang.String ignored)
Specified by:
addExcluded in interface Instrumentor

addIncluded

public void addIncluded(java.lang.String included)
Description copied from interface: Instrumentor
Add a pattern that is included. Default everything is included, unless it is explicitly excluded. The pattern is just the

Specified by:
addIncluded in interface Instrumentor

setLog

public void setLog(InstrumenterLogger log)
Description copied from interface: Instrumentor
Sets the InstrumenterLogger this Instrumentor uses to execute log statements on.

So if you want to have verbose output, just plug in some logger.

Specified by:
setLog in interface Instrumentor

setDumpBytecode

public void setDumpBytecode(boolean dumpBytecode)
Description copied from interface: Instrumentor
If the bytecode generated by this Instrumentor should be dumped for debugging purposes.

Specified by:
setDumpBytecode in interface Instrumentor
Parameters:
dumpBytecode - true if bytecode should be dumpted.
See Also:
Instrumentor.setDumpDirectory(java.io.File)

setDumpDirectory

public void setDumpDirectory(java.io.File dumpDirectory)
Description copied from interface: Instrumentor
Sets the location of this Instrumentor. The default is the tmp directory so in most cases you don't need to worry about this property.

Specified by:
setDumpDirectory in interface Instrumentor
Parameters:
dumpDirectory - the directory to write the dumped classfiles to.

getDumpDirectory

public java.io.File getDumpDirectory()
Specified by:
getDumpDirectory in interface Instrumentor

setFiler

public void setFiler(Filer filer)
Description copied from interface: Instrumentor
Sets the Filer for this Instrumentor. The Filer can be used to do callbacks for creating additional resources like classes.

Specified by:
setFiler in interface Instrumentor
Parameters:
filer - the filer this Instrumentor is going to use.

setResolver

public void setResolver(Resolver resolver)
Specified by:
setResolver in interface Instrumentor

setOptimize

public void setOptimize(boolean optimize)
Specified by:
setOptimize in interface Instrumentor

process

public Clazz process(Clazz originalClazz)
Description copied from interface: Instrumentor
Processes a clazz. If nothing needs to be processed, the provided clazz can be returned. The return value should never be null.

Specified by:
process in interface Instrumentor
Parameters:
originalClazz - the Clazz to transform.
Returns:
the transformed clazz. If extra classes need to be generated, they are created using the Filer.

toString

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


Copyright © 2008-2010 Multiverse. All Rights Reserved.