public class MultiVisitor extends java.lang.Object implements ExecutionVisitor
When the visitBefore method is called on this visitor, it calls visitMethod on each of the sub-visitors in the order in which the sub-visitors were given when constructing this visitor.
When the visitAfter method is called on this visitor, it calls visitAfter on each of the sub-visitors in turn, also in the order in which they were given when constructing the visitor. If one of these calls returns false, this visitor immediately returns false without calling visitAfter on the remaining visitors.
| Modifier and Type | Field and Description |
|---|---|
private java.util.List<ExecutionVisitor> |
visitors
The list of visitors.
|
| Constructor and Description |
|---|
MultiVisitor()
Creates a new MultiVisitor.
|
MultiVisitor(java.util.List<ExecutionVisitor> visitors)
Creates a new MultiVisitor.
|
| Modifier and Type | Method and Description |
|---|---|
static ExecutionVisitor |
createMultiVisitor(java.util.List<ExecutionVisitor> visitors)
Returns a MultiVisitor if needed, otherwise a simpler visitor.
|
void |
initialize(ExecutableSequence eseq)
Calls the initialize method for each of the visitors, in the order in which the visitors were
given during construction of this MultiVisitor.
|
void |
visitAfterSequence(ExecutableSequence eseq)
Called after execution of a sequence.
|
void |
visitAfterStatement(ExecutableSequence eseq,
int i)
Invoked by ExecutableSequence.execute after the i-th statement executes.
|
void |
visitBeforeStatement(ExecutableSequence eseq,
int i)
Invoked by ExecutableSequence.execute before the i-th statement executes.
|
private final java.util.List<ExecutionVisitor> visitors
public MultiVisitor()
public MultiVisitor(java.util.List<ExecutionVisitor> visitors)
visitors - the list of visitorspublic static ExecutionVisitor createMultiVisitor(java.util.List<ExecutionVisitor> visitors)
visitors - the visitors to composepublic void initialize(ExecutableSequence eseq)
initialize in interface ExecutionVisitoreseq - the code sequence to be visitedpublic void visitAfterStatement(ExecutableSequence eseq, int i)
ExecutionVisitorPrecondition: statements 0..i have been executed.
visitAfterStatement in interface ExecutionVisitoreseq - the code sequence to be visitedi - the position of statement to visitpublic void visitBeforeStatement(ExecutableSequence eseq, int i)
ExecutionVisitorPrecondition: statements 0..i-1 have been executed.
visitBeforeStatement in interface ExecutionVisitoreseq - the code sequence to be visitedi - the position of statement to visitpublic void visitAfterSequence(ExecutableSequence eseq)
ExecutionVisitorvisitAfterSequence in interface ExecutionVisitoreseq - the visited code sequence