org.multiverse.instrumentation
Interface Instrumentor

All Known Implementing Classes:
StandardInstrumentor

public interface Instrumentor

The Instrumentor is responsible transforming a Clazz.

The same Instrumentor can be used for compiletime instrumentation and loadtime instrumentation, so no worries about that anymore.

Author:
Peter Veentjer

Method Summary
 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 logger)
          Sets the InstrumenterLogger this Instrumentor uses to execute log statements on.
 void setOptimize(boolean optimize)
           
 void setResolver(Resolver resolver)
           
 

Method Detail

getInstrumentorName

java.lang.String getInstrumentorName()
Returns the name of this Instrumentor. Needed for identification and logging purpuses.

Returns:
the name of this Instrumentor.
See Also:
getInstrumentorVersion()

getInstrumentorVersion

java.lang.String getInstrumentorVersion()
Returns the version of this Instrumentor. Needed for identification and logging purposes.

Returns:
the version of this Instrumentor.
See Also:
getInstrumentorName()

getStmName

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

Returns:
the name of the Stm

setFiler

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

Parameters:
filer - the filer this Instrumentor is going to use.

setResolver

void setResolver(Resolver resolver)

setDumpBytecode

void setDumpBytecode(boolean dumpBytecode)
If the bytecode generated by this Instrumentor should be dumped for debugging purposes.

Parameters:
dumpBytecode - true if bytecode should be dumpted.
See Also:
setDumpDirectory(java.io.File)

setDumpDirectory

void setDumpDirectory(java.io.File dumpDirectory)
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.

Parameters:
dumpDirectory - the directory to write the dumped classfiles to.

getDumpDirectory

java.io.File getDumpDirectory()

setLog

void setLog(InstrumenterLogger logger)
Sets the InstrumenterLogger this Instrumentor uses to execute log statements on.

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

Parameters:
logger -

addIncluded

void addIncluded(java.lang.String included)
Add a pattern that is included. Default everything is included, unless it is explicitly excluded. The pattern is just the

Parameters:
included -

addExcluded

void addExcluded(java.lang.String ignored)

process

Clazz process(Clazz originalClazz)
Processes a clazz. If nothing needs to be processed, the provided clazz can be returned. The return value should never be null.

Parameters:
originalClazz - the Clazz to transform.
Returns:
the transformed clazz. If extra classes need to be generated, they are created using the Filer.
Throws:
CompileException - if something goes wrong while compile clazz.

setOptimize

void setOptimize(boolean optimize)


Copyright © 2008-2010 Multiverse. All Rights Reserved.