Package: org.codehaus.groovy.control.customizers

## [Java] Class SecureASTCustomizer.SecuringCodeVisitor

- org.codehaus.groovy.control.customizers.SecureASTCustomizer.SecuringCodeVisitor

- All Implemented Interfaces and Traits:
    GroovyCodeVisitor

      protected class SecureASTCustomizer.SecuringCodeVisitor

  This visitor directly implements the GroovyCodeVisitor interface instead of using the CodeVisitorSupport class to make sure that future features of the language gets managed by this visitor. Thus, adding a new feature would result in a compilation error if this visitor is not updated.

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `protected void` | `assertExpressionAuthorized(Expression expression)` Checks that a given expression is either in the whitelist or not in the blacklist.
    `` | `protected void` | `assertStatementAuthorized(Statement statement)` Checks that a given statement is either in the whitelist or not in the blacklist.
    `` | `protected void` | `assertTokenAuthorized(Token token)` Checks that a given token is either in the whitelist or not in the blacklist.
    `` | `protected ClassNode` | `getExpressionType(ClassNode objectExpressionType)`
    `` | `void` | `visitArgumentlistExpression(ArgumentListExpression expression)`
    `` | `void` | `visitArrayExpression(ArrayExpression expression)`
    `` | `void` | `visitAssertStatement(AssertStatement statement)`
    `` | `void` | `visitAttributeExpression(AttributeExpression expression)`
    `` | `void` | `visitBinaryExpression(BinaryExpression expression)`
    `` | `void` | `visitBitwiseNegationExpression(BitwiseNegationExpression expression)`
    `` | `void` | `visitBlockStatement(BlockStatement block)`
    `` | `void` | `visitBooleanExpression(BooleanExpression expression)`
    `` | `void` | `visitBreakStatement(BreakStatement statement)`
    `` | `void` | `visitBytecodeExpression(BytecodeExpression expression)`
    `` | `void` | `visitCaseStatement(CaseStatement statement)`
    `` | `void` | `visitCastExpression(CastExpression expression)`
    `` | `void` | `visitCatchStatement(CatchStatement statement)`
    `` | `void` | `visitClassExpression(ClassExpression expression)`
    `` | `void` | `visitClosureExpression(ClosureExpression expression)`
    `` | `void` | `visitClosureListExpression(ClosureListExpression closureListExpression)`
    `` | `void` | `visitConstantExpression(ConstantExpression expression)`
    `` | `void` | `visitConstructorCallExpression(ConstructorCallExpression call)`
    `` | `void` | `visitContinueStatement(ContinueStatement statement)`
    `` | `void` | `visitDeclarationExpression(DeclarationExpression expression)`
    `` | `void` | `visitDoWhileLoop(DoWhileStatement loop)`
    `` | `void` | `visitEmptyStatement(EmptyStatement statement)`
    `` | `void` | `visitExpressionStatement(ExpressionStatement statement)`
    `` | `void` | `visitFieldExpression(FieldExpression expression)`
    `` | `void` | `visitForLoop(ForStatement forLoop)`
    `` | `void` | `visitGStringExpression(GStringExpression expression)`
    `` | `void` | `visitIfElse(IfStatement ifElse)`
    `` | `void` | `visitLambdaExpression(LambdaExpression expression)`
    `` | `void` | `visitListExpression(ListExpression expression)`
    `` | `void` | `visitMapEntryExpression(MapEntryExpression expression)`
    `` | `void` | `visitMapExpression(MapExpression expression)`
    `` | `void` | `visitMethodCallExpression(MethodCallExpression call)`
    `` | `void` | `visitMethodPointerExpression(MethodPointerExpression expression)`
    `` | `void` | `visitMethodReferenceExpression(MethodReferenceExpression expression)`
    `` | `void` | `visitNotExpression(NotExpression expression)`
    `` | `void` | `visitPostfixExpression(PostfixExpression expression)`
    `` | `void` | `visitPrefixExpression(PrefixExpression expression)`
    `` | `void` | `visitPropertyExpression(PropertyExpression expression)`
    `` | `void` | `visitRangeExpression(RangeExpression expression)`
    `` | `void` | `visitReturnStatement(ReturnStatement statement)`
    `` | `void` | `visitShortTernaryExpression(ElvisOperatorExpression expression)`
    `` | `void` | `visitSpreadExpression(SpreadExpression expression)`
    `` | `void` | `visitSpreadMapExpression(SpreadMapExpression expression)`
    `` | `void` | `visitStaticMethodCallExpression(StaticMethodCallExpression call)`
    `` | `void` | `visitSwitch(SwitchStatement statement)`
    `` | `void` | `visitSynchronizedStatement(SynchronizedStatement statement)`
    `` | `void` | `visitTernaryExpression(TernaryExpression expression)`
    `` | `void` | `visitThrowStatement(ThrowStatement statement)`
    `` | `void` | `visitTryCatchFinally(TryCatchStatement statement)`
    `` | `void` | `visitTupleExpression(TupleExpression expression)`
    `` | `void` | `visitUnaryMinusExpression(UnaryMinusExpression expression)`
    `` | `void` | `visitUnaryPlusExpression(UnaryPlusExpression expression)`
    `` | `void` | `visitVariableExpression(VariableExpression expression)`
    `` | `void` | `visitWhileLoop(WhileStatement loop)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll`

- - ### Method Detail

    - #### protected void assertExpressionAuthorized(Expression expression)

      Checks that a given expression is either in the whitelist or not in the blacklist.

      throws:
        SecurityException if usage of this expression class is forbidden
      Parameters:
        `expression` - the expression to be checked

    - #### protected void assertStatementAuthorized(Statement statement)

      Checks that a given statement is either in the whitelist or not in the blacklist.

      throws:
        SecurityException if usage of this statement class is forbidden
      Parameters:
        `statement` - the statement to be checked

    - #### protected void assertTokenAuthorized(Token token)

      Checks that a given token is either in the whitelist or not in the blacklist.

      throws:
        SecurityException if usage of this token is forbidden
      Parameters:
        `token` - the token to be checked

    - #### protected ClassNode getExpressionType(ClassNode objectExpressionType)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitArgumentlistExpression(ArgumentListExpression expression)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitArrayExpression(ArrayExpression expression)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitAssertStatement(AssertStatement statement)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitAttributeExpression(AttributeExpression expression)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitBinaryExpression(BinaryExpression expression)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitBitwiseNegationExpression(BitwiseNegationExpression expression)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitBlockStatement(BlockStatement block)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitBooleanExpression(BooleanExpression expression)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitBreakStatement(BreakStatement statement)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitBytecodeExpression(BytecodeExpression expression)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitCaseStatement(CaseStatement statement)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitCastExpression(CastExpression expression)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitCatchStatement(CatchStatement statement)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitClassExpression(ClassExpression expression)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitClosureExpression(ClosureExpression expression)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitClosureListExpression(ClosureListExpression closureListExpression)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitConstantExpression(ConstantExpression expression)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitConstructorCallExpression(ConstructorCallExpression call)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitContinueStatement(ContinueStatement statement)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitDeclarationExpression(DeclarationExpression expression)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitDoWhileLoop(DoWhileStatement loop)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitEmptyStatement(EmptyStatement statement)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitExpressionStatement(ExpressionStatement statement)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitFieldExpression(FieldExpression expression)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitForLoop(ForStatement forLoop)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitGStringExpression(GStringExpression expression)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitIfElse(IfStatement ifElse)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitLambdaExpression(LambdaExpression expression)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitListExpression(ListExpression expression)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitMapEntryExpression(MapEntryExpression expression)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitMapExpression(MapExpression expression)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitMethodCallExpression(MethodCallExpression call)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitMethodPointerExpression(MethodPointerExpression expression)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitMethodReferenceExpression(MethodReferenceExpression expression)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitNotExpression(NotExpression expression)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitPostfixExpression(PostfixExpression expression)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitPrefixExpression(PrefixExpression expression)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitPropertyExpression(PropertyExpression expression)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitRangeExpression(RangeExpression expression)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitReturnStatement(ReturnStatement statement)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitShortTernaryExpression(ElvisOperatorExpression expression)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitSpreadExpression(SpreadExpression expression)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitSpreadMapExpression(SpreadMapExpression expression)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitStaticMethodCallExpression(StaticMethodCallExpression call)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitSwitch(SwitchStatement statement)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitSynchronizedStatement(SynchronizedStatement statement)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitTernaryExpression(TernaryExpression expression)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitThrowStatement(ThrowStatement statement)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitTryCatchFinally(TryCatchStatement statement)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitTupleExpression(TupleExpression expression)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitUnaryMinusExpression(UnaryMinusExpression expression)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitUnaryPlusExpression(UnaryPlusExpression expression)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitVariableExpression(VariableExpression expression)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void visitWhileLoop(WhileStatement loop)