protected static class PurityChecker.PurityCheckerHelper extends SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
PurityChecker
's interface clean. The implementation is heavily
based on TreeScanner
, but some parts of the AST are skipped (such as types or
modifiers). Furthermore, scanning works differently in that the input parameter (usually
named p
) gets "threaded through", instead of using reduce
.Modifier and Type | Field and Description |
---|---|
protected AnnotationProvider |
annoProvider |
protected @Nullable List<Element> |
methodParameter |
DEFAULT_VALUE
Constructor and Description |
---|
PurityCheckerHelper(AnnotationProvider annoProvider,
boolean assumeSideEffectFree) |
visit, visit, visitAnnotatedType, visitAnnotation, visitArrayType, visitCompilationUnit, visitErroneous, visitImport, visitIntersectionType, visitMethod, visitModifiers, visitOther, visitParameterizedType, visitPrimitiveType, visitTypeParameter, visitUnionType, visitWildcard
protected final AnnotationProvider annoProvider
public PurityCheckerHelper(AnnotationProvider annoProvider, boolean assumeSideEffectFree)
public PurityChecker.PurityResult scan(Tree node, PurityChecker.PurityResult p)
public PurityChecker.PurityResult scan(Iterable<? extends Tree> nodes, PurityChecker.PurityResult p)
protected PurityChecker.PurityResult defaultAction(Tree node, PurityChecker.PurityResult p)
defaultAction
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitClass(ClassTree node, PurityChecker.PurityResult p)
visitClass
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitClass
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitVariable(VariableTree node, PurityChecker.PurityResult p)
visitVariable
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitVariable
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitEmptyStatement(EmptyStatementTree node, PurityChecker.PurityResult p)
visitEmptyStatement
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitEmptyStatement
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitBlock(BlockTree node, PurityChecker.PurityResult p)
visitBlock
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitBlock
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitDoWhileLoop(DoWhileLoopTree node, PurityChecker.PurityResult p)
visitDoWhileLoop
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitDoWhileLoop
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitWhileLoop(WhileLoopTree node, PurityChecker.PurityResult p)
visitWhileLoop
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitWhileLoop
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitForLoop(ForLoopTree node, PurityChecker.PurityResult p)
visitForLoop
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitForLoop
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitEnhancedForLoop(EnhancedForLoopTree node, PurityChecker.PurityResult p)
visitEnhancedForLoop
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitEnhancedForLoop
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitLabeledStatement(LabeledStatementTree node, PurityChecker.PurityResult p)
visitLabeledStatement
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitLabeledStatement
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitSwitch(SwitchTree node, PurityChecker.PurityResult p)
visitSwitch
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitSwitch
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitCase(CaseTree node, PurityChecker.PurityResult p)
visitCase
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitCase
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitSynchronized(SynchronizedTree node, PurityChecker.PurityResult p)
visitSynchronized
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitSynchronized
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitTry(TryTree node, PurityChecker.PurityResult p)
visitTry
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitTry
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitCatch(CatchTree node, PurityChecker.PurityResult p)
visitCatch
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitCatch
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitConditionalExpression(ConditionalExpressionTree node, PurityChecker.PurityResult p)
visitConditionalExpression
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitConditionalExpression
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitIf(IfTree node, PurityChecker.PurityResult p)
visitIf
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitIf
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitExpressionStatement(ExpressionStatementTree node, PurityChecker.PurityResult p)
visitExpressionStatement
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitExpressionStatement
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitBreak(BreakTree node, PurityChecker.PurityResult p)
visitBreak
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitBreak
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitContinue(ContinueTree node, PurityChecker.PurityResult p)
visitContinue
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitContinue
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitReturn(ReturnTree node, PurityChecker.PurityResult p)
visitReturn
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitReturn
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitThrow(ThrowTree node, PurityChecker.PurityResult p)
visitThrow
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitThrow
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitAssert(AssertTree node, PurityChecker.PurityResult p)
visitAssert
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitAssert
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitMethodInvocation(MethodInvocationTree node, PurityChecker.PurityResult p)
visitMethodInvocation
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitMethodInvocation
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitNewClass(NewClassTree node, PurityChecker.PurityResult p)
visitNewClass
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitNewClass
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitNewArray(NewArrayTree node, PurityChecker.PurityResult p)
visitNewArray
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitNewArray
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitLambdaExpression(LambdaExpressionTree node, PurityChecker.PurityResult p)
visitLambdaExpression
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitLambdaExpression
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitParenthesized(ParenthesizedTree node, PurityChecker.PurityResult p)
visitParenthesized
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitParenthesized
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitAssignment(AssignmentTree node, PurityChecker.PurityResult p)
visitAssignment
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitAssignment
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
protected PurityChecker.PurityResult assignmentCheck(PurityChecker.PurityResult p, ExpressionTree variable)
protected boolean isLocalVariable(ExpressionTree variable)
public PurityChecker.PurityResult visitCompoundAssignment(CompoundAssignmentTree node, PurityChecker.PurityResult p)
visitCompoundAssignment
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitCompoundAssignment
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitUnary(UnaryTree node, PurityChecker.PurityResult p)
visitUnary
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitUnary
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitBinary(BinaryTree node, PurityChecker.PurityResult p)
visitBinary
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitBinary
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitTypeCast(TypeCastTree node, PurityChecker.PurityResult p)
visitTypeCast
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitTypeCast
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitInstanceOf(InstanceOfTree node, PurityChecker.PurityResult p)
visitInstanceOf
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitInstanceOf
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitArrayAccess(ArrayAccessTree node, PurityChecker.PurityResult p)
visitArrayAccess
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitArrayAccess
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitMemberSelect(MemberSelectTree node, PurityChecker.PurityResult p)
visitMemberSelect
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitMemberSelect
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitMemberReference(MemberReferenceTree node, PurityChecker.PurityResult p)
visitMemberReference
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitMemberReference
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitIdentifier(IdentifierTree node, PurityChecker.PurityResult p)
visitIdentifier
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitIdentifier
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitLiteral(LiteralTree node, PurityChecker.PurityResult p)
visitLiteral
in interface TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitLiteral
in class SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>