public class ResourceDemandInstrumentationStrategy extends Object implements EclipseAstInstrumentationStrategy
Constructor and Description |
---|
ResourceDemandInstrumentationStrategy(CodeSectionIdentifier identifier)
Creates a strategey that will use the provided
identifier to identify code
sections in the instrumentation code. |
Modifier and Type | Method and Description |
---|---|
org.eclipse.jdt.core.dom.Statement |
instrumentEnd(CodeSection codeSection,
org.eclipse.jdt.core.dom.AST nodeFactory)
Provides a node to be inserted after the given
codeSection . |
org.eclipse.jdt.core.dom.Statement |
instrumentStart(CodeSection codeSection,
org.eclipse.jdt.core.dom.AST nodeFactory)
Provides a node to be inserted before the given
codeSection . |
public ResourceDemandInstrumentationStrategy(CodeSectionIdentifier identifier)
identifier
to identify code
sections in the instrumentation code.identifier
- The provider of identifers for instrumented code sections.public org.eclipse.jdt.core.dom.Statement instrumentStart(CodeSection codeSection, org.eclipse.jdt.core.dom.AST nodeFactory)
EclipseAstInstrumentationStrategy
codeSection
. The statement
returned is to be inserted before the first statement of the given
codeSection
.instrumentStart
in interface EclipseAstInstrumentationStrategy
codeSection
- The section being instrumented.nodeFactory
- The AST instance that must be used to create the
instrumentation statement.ASTNode.getAST()
must return nodeFactory
.
null
to not insert anything.public org.eclipse.jdt.core.dom.Statement instrumentEnd(CodeSection codeSection, org.eclipse.jdt.core.dom.AST nodeFactory)
EclipseAstInstrumentationStrategy
codeSection
. The statement
returned is to be inserted after the last statement of the given
codeSection
.instrumentEnd
in interface EclipseAstInstrumentationStrategy
codeSection
- The section being instrumented.nodeFactory
- The AST instance that must be used to create the
instrumentation statement.ASTNode.getAST()
must return nodeFactory
.
null
to not insert anything.