Package org.spockframework.compiler
Class SpecRewriter
java.lang.Object
org.spockframework.compiler.AbstractSpecVisitor
org.spockframework.compiler.SpecRewriter
- All Implemented Interfaces:
IRewriteResources
,ISpecVisitor
A Spec visitor responsible for most of the rewriting of a Spec's AST.
- Author:
- Peter Niederwieser
-
Constructor Summary
ConstructorsConstructorDescriptionSpecRewriter
(AstNodeCache nodeCache, SourceLookup lookup, ErrorReporter errorReporter) -
Method Summary
Modifier and TypeMethodDescriptionorg.codehaus.groovy.ast.expr.VariableExpression
captureOldValue
(org.codehaus.groovy.ast.expr.Expression oldValue) void
defineValueRecorder
(List<org.codehaus.groovy.ast.stmt.Statement> stats) org.codehaus.groovy.ast.expr.MethodCallExpression
org.codehaus.groovy.ast.expr.MethodCallExpression
getSourceText
(org.codehaus.groovy.ast.ASTNode node) org.codehaus.groovy.ast.expr.MethodCallExpression
org.codehaus.groovy.ast.expr.MethodCallExpression
setThrownException
(org.codehaus.groovy.ast.expr.Expression value) void
visitAnyBlock
(Block block) void
visitCleanupBlock
(CleanupBlock block) void
visitField
(Field field) void
visitMethod
(Method method) void
visitMethodAgain
(Method method) void
void
visitThenBlock
(ThenBlock block) Methods inherited from class org.spockframework.compiler.AbstractSpecVisitor
visitAnonymousBlock, visitExpectBlock, visitSetupBlock, visitSpecAgain, visitWhenBlock, visitWhereBlock
-
Constructor Details
-
SpecRewriter
-
-
Method Details
-
visitSpec
- Specified by:
visitSpec
in interfaceISpecVisitor
- Overrides:
visitSpec
in classAbstractSpecVisitor
-
visitField
- Specified by:
visitField
in interfaceISpecVisitor
- Overrides:
visitField
in classAbstractSpecVisitor
-
visitMethod
- Specified by:
visitMethod
in interfaceISpecVisitor
- Overrides:
visitMethod
in classAbstractSpecVisitor
-
visitMethodAgain
- Specified by:
visitMethodAgain
in interfaceISpecVisitor
- Overrides:
visitMethodAgain
in classAbstractSpecVisitor
-
visitAnyBlock
- Specified by:
visitAnyBlock
in interfaceISpecVisitor
- Overrides:
visitAnyBlock
in classAbstractSpecVisitor
-
visitThenBlock
- Specified by:
visitThenBlock
in interfaceISpecVisitor
- Overrides:
visitThenBlock
in classAbstractSpecVisitor
-
visitCleanupBlock
- Specified by:
visitCleanupBlock
in interfaceISpecVisitor
- Overrides:
visitCleanupBlock
in classAbstractSpecVisitor
-
getCurrentSpec
- Specified by:
getCurrentSpec
in interfaceIRewriteResources
-
getCurrentMethod
- Specified by:
getCurrentMethod
in interfaceIRewriteResources
-
getCurrentBlock
- Specified by:
getCurrentBlock
in interfaceIRewriteResources
-
defineValueRecorder
- Specified by:
defineValueRecorder
in interfaceIRewriteResources
-
captureOldValue
public org.codehaus.groovy.ast.expr.VariableExpression captureOldValue(org.codehaus.groovy.ast.expr.Expression oldValue) - Specified by:
captureOldValue
in interfaceIRewriteResources
-
getSpecificationContext
public org.codehaus.groovy.ast.expr.MethodCallExpression getSpecificationContext() -
getMockInvocationMatcher
public org.codehaus.groovy.ast.expr.MethodCallExpression getMockInvocationMatcher()- Specified by:
getMockInvocationMatcher
in interfaceIRewriteResources
-
setThrownException
public org.codehaus.groovy.ast.expr.MethodCallExpression setThrownException(org.codehaus.groovy.ast.expr.Expression value) -
getAstNodeCache
- Specified by:
getAstNodeCache
in interfaceIRewriteResources
-
getSourceText
- Specified by:
getSourceText
in interfaceIRewriteResources
-
getErrorReporter
- Specified by:
getErrorReporter
in interfaceIRewriteResources
-