protected static class PurityChecker.PurityCheckerHelper extends com.sun.source.util.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 java.util.List<javax.lang.model.element.Element> |
methodParameter |
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
protected @Nullable java.util.List<javax.lang.model.element.Element> methodParameter
public PurityCheckerHelper(AnnotationProvider annoProvider, boolean assumeSideEffectFree)
public PurityChecker.PurityResult scan(com.sun.source.tree.Tree node, PurityChecker.PurityResult p)
public PurityChecker.PurityResult scan(java.lang.Iterable<? extends com.sun.source.tree.Tree> nodes, PurityChecker.PurityResult p)
protected PurityChecker.PurityResult defaultAction(com.sun.source.tree.Tree node, PurityChecker.PurityResult p)
defaultAction
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitClass(com.sun.source.tree.ClassTree node, PurityChecker.PurityResult p)
visitClass
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitClass
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitVariable(com.sun.source.tree.VariableTree node, PurityChecker.PurityResult p)
visitVariable
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitVariable
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitEmptyStatement(com.sun.source.tree.EmptyStatementTree node, PurityChecker.PurityResult p)
visitEmptyStatement
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitEmptyStatement
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitBlock(com.sun.source.tree.BlockTree node, PurityChecker.PurityResult p)
visitBlock
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitBlock
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitDoWhileLoop(com.sun.source.tree.DoWhileLoopTree node, PurityChecker.PurityResult p)
visitDoWhileLoop
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitDoWhileLoop
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitWhileLoop(com.sun.source.tree.WhileLoopTree node, PurityChecker.PurityResult p)
visitWhileLoop
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitWhileLoop
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitForLoop(com.sun.source.tree.ForLoopTree node, PurityChecker.PurityResult p)
visitForLoop
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitForLoop
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitEnhancedForLoop(com.sun.source.tree.EnhancedForLoopTree node, PurityChecker.PurityResult p)
visitEnhancedForLoop
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitEnhancedForLoop
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitLabeledStatement(com.sun.source.tree.LabeledStatementTree node, PurityChecker.PurityResult p)
visitLabeledStatement
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitLabeledStatement
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitSwitch(com.sun.source.tree.SwitchTree node, PurityChecker.PurityResult p)
visitSwitch
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitSwitch
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitCase(com.sun.source.tree.CaseTree node, PurityChecker.PurityResult p)
visitCase
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitCase
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitSynchronized(com.sun.source.tree.SynchronizedTree node, PurityChecker.PurityResult p)
visitSynchronized
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitSynchronized
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitTry(com.sun.source.tree.TryTree node, PurityChecker.PurityResult p)
visitTry
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitTry
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitCatch(com.sun.source.tree.CatchTree node, PurityChecker.PurityResult p)
visitCatch
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitCatch
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitConditionalExpression(com.sun.source.tree.ConditionalExpressionTree node, PurityChecker.PurityResult p)
visitConditionalExpression
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitConditionalExpression
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitIf(com.sun.source.tree.IfTree node, PurityChecker.PurityResult p)
visitIf
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitIf
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitExpressionStatement(com.sun.source.tree.ExpressionStatementTree node, PurityChecker.PurityResult p)
visitExpressionStatement
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitExpressionStatement
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitBreak(com.sun.source.tree.BreakTree node, PurityChecker.PurityResult p)
visitBreak
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitBreak
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitContinue(com.sun.source.tree.ContinueTree node, PurityChecker.PurityResult p)
visitContinue
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitContinue
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitReturn(com.sun.source.tree.ReturnTree node, PurityChecker.PurityResult p)
visitReturn
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitReturn
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitThrow(com.sun.source.tree.ThrowTree node, PurityChecker.PurityResult p)
visitThrow
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitThrow
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitAssert(com.sun.source.tree.AssertTree node, PurityChecker.PurityResult p)
visitAssert
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitAssert
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitMethodInvocation(com.sun.source.tree.MethodInvocationTree node, PurityChecker.PurityResult p)
visitMethodInvocation
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitMethodInvocation
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitNewClass(com.sun.source.tree.NewClassTree node, PurityChecker.PurityResult p)
visitNewClass
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitNewClass
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitNewArray(com.sun.source.tree.NewArrayTree node, PurityChecker.PurityResult p)
visitNewArray
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitNewArray
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitLambdaExpression(com.sun.source.tree.LambdaExpressionTree node, PurityChecker.PurityResult p)
visitLambdaExpression
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitLambdaExpression
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitParenthesized(com.sun.source.tree.ParenthesizedTree node, PurityChecker.PurityResult p)
visitParenthesized
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitParenthesized
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitAssignment(com.sun.source.tree.AssignmentTree node, PurityChecker.PurityResult p)
visitAssignment
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitAssignment
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
protected PurityChecker.PurityResult assignmentCheck(PurityChecker.PurityResult p, com.sun.source.tree.ExpressionTree variable)
protected boolean isLocalVariable(com.sun.source.tree.ExpressionTree variable)
public PurityChecker.PurityResult visitCompoundAssignment(com.sun.source.tree.CompoundAssignmentTree node, PurityChecker.PurityResult p)
visitCompoundAssignment
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitCompoundAssignment
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitUnary(com.sun.source.tree.UnaryTree node, PurityChecker.PurityResult p)
visitUnary
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitUnary
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitBinary(com.sun.source.tree.BinaryTree node, PurityChecker.PurityResult p)
visitBinary
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitBinary
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitTypeCast(com.sun.source.tree.TypeCastTree node, PurityChecker.PurityResult p)
visitTypeCast
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitTypeCast
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitInstanceOf(com.sun.source.tree.InstanceOfTree node, PurityChecker.PurityResult p)
visitInstanceOf
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitInstanceOf
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitArrayAccess(com.sun.source.tree.ArrayAccessTree node, PurityChecker.PurityResult p)
visitArrayAccess
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitArrayAccess
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitMemberSelect(com.sun.source.tree.MemberSelectTree node, PurityChecker.PurityResult p)
visitMemberSelect
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitMemberSelect
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitMemberReference(com.sun.source.tree.MemberReferenceTree node, PurityChecker.PurityResult p)
visitMemberReference
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitMemberReference
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitIdentifier(com.sun.source.tree.IdentifierTree node, PurityChecker.PurityResult p)
visitIdentifier
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitIdentifier
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
public PurityChecker.PurityResult visitLiteral(com.sun.source.tree.LiteralTree node, PurityChecker.PurityResult p)
visitLiteral
in interface com.sun.source.tree.TreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>
visitLiteral
in class com.sun.source.util.SimpleTreeVisitor<PurityChecker.PurityResult,PurityChecker.PurityResult>