public class EclipseAstInstrumentor extends Object
Instrumentation takes place on a best effort base. It is performed as follows:
useStrategy(de.uka.ipd.sdq.beagle.measurement.kieker.instrumentation.EclipseAstInstrumentationStrategy, java.util.Collection<de.uka.ipd.sdq.beagle.core.CodeSection>) for instrumentation
instructions to instrument the code sections provided through the same method call.
The result of the instrumentation is undefiend for a source file referenced by a code section that is not a valid Java file defining a class.
The instrumentation is executed using multible threads. However, the class itself is not thread safe and may thus not be called from multible threads.
| Modifier and Type | Class and Description |
|---|---|
static interface |
EclipseAstInstrumentor.InstrumentationResultFileProvider
Appoints a file the instrumented source code of a Java type shall be written to.
|
| Constructor and Description |
|---|
EclipseAstInstrumentor(EclipseAstInstrumentor.InstrumentationResultFileProvider instrumentedFileProvider)
Creates an instrumentor that writes its resulting instrumented code to the files
provided by
instrumentedFileProvider. |
| Modifier and Type | Method and Description |
|---|---|
void |
instrument()
Executes the instrumentation based on the settings set on this instrumentor.
|
EclipseAstInstrumentor |
useCharset(Charset ioCharset)
Makes the instrumentor use
charset to read and write source code. |
EclipseAstInstrumentor |
useStrategy(EclipseAstInstrumentationStrategy instrumentationStrategy,
CodeSection... codeSections)
Makes this instrumentor use the provided strategy to instrument the provided code
sections.
|
EclipseAstInstrumentor |
useStrategy(EclipseAstInstrumentationStrategy instrumentationStrategy,
Collection<CodeSection> codeSections)
Makes this instrumentor use the provided strategy to instrument the provided code
sections.
|
public EclipseAstInstrumentor(EclipseAstInstrumentor.InstrumentationResultFileProvider instrumentedFileProvider)
instrumentedFileProvider.instrumentedFileProvider - A function taking a fully qualified path of a Java
type and returning a file to write the instrumented code of this type
to. Must not be null.public EclipseAstInstrumentor useStrategy(EclipseAstInstrumentationStrategy instrumentationStrategy, Collection<CodeSection> codeSections)
instrumentationStrategy - The strategy to instrument with.codeSections - The sections that shall be instrumented using the provided
strategy.this.public EclipseAstInstrumentor useStrategy(EclipseAstInstrumentationStrategy instrumentationStrategy, CodeSection... codeSections)
instrumentationStrategy - The strategy to instrument with.codeSections - The sections that shall be instrumented using the provided
strategy.this.public EclipseAstInstrumentor useCharset(Charset ioCharset)
charset to read and write source code. It
defaults to using Charset.defaultCharset() if no charset was set.ioCharset - The charset to be used by this Instrumentor for input and output.this.public void instrument()