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
      extends Object
      implements GroovyCodeVisitor

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

  - ### Inherited Methods Summary

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

- - ### Method Detail

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

      Checks that a given expression is either in the allowed list or not in the disallowed list.

      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 allowed list or not in the disallowed list.

      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 allowed list or not in the disallowed list.

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

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

    - #### public void visitArgumentlistExpression(ArgumentListExpression expression)

    - #### public void visitArrayExpression(ArrayExpression expression)

    - #### public void visitAssertStatement(AssertStatement statement)

    - #### public void visitAttributeExpression(AttributeExpression expression)

    - #### public void visitBinaryExpression(BinaryExpression expression)

    - #### public void visitBitwiseNegationExpression(BitwiseNegationExpression expression)

    - #### public void visitBlockStatement(BlockStatement block)

    - #### public void visitBooleanExpression(BooleanExpression expression)

    - #### public void visitBreakStatement(BreakStatement statement)

    - #### public void visitBytecodeExpression(BytecodeExpression expression)

    - #### public void visitCaseStatement(CaseStatement statement)

    - #### public void visitCastExpression(CastExpression expression)

    - #### public void visitCatchStatement(CatchStatement statement)

    - #### public void visitClassExpression(ClassExpression expression)

    - #### public void visitClosureExpression(ClosureExpression expression)

    - #### public void visitClosureListExpression(ClosureListExpression closureListExpression)

    - #### public void visitConstantExpression(ConstantExpression expression)

    - #### public void visitConstructorCallExpression(ConstructorCallExpression call)

    - #### public void visitContinueStatement(ContinueStatement statement)

    - #### public void visitDeclarationExpression(DeclarationExpression expression)

    - #### public void visitDoWhileLoop(DoWhileStatement loop)

    - #### public void visitEmptyStatement(EmptyStatement statement)

    - #### public void visitExpressionStatement(ExpressionStatement statement)

    - #### public void visitFieldExpression(FieldExpression expression)

    - #### public void visitForLoop(ForStatement forLoop)

    - #### public void visitGStringExpression(GStringExpression expression)

    - #### public void visitIfElse(IfStatement ifElse)

    - #### public void visitLambdaExpression(LambdaExpression expression)

    - #### public void visitListExpression(ListExpression expression)

    - #### public void visitMapEntryExpression(MapEntryExpression expression)

    - #### public void visitMapExpression(MapExpression expression)

    - #### public void visitMethodCallExpression(MethodCallExpression call)

    - #### public void visitMethodPointerExpression(MethodPointerExpression expression)

    - #### public void visitMethodReferenceExpression(MethodReferenceExpression expression)

    - #### public void visitNotExpression(NotExpression expression)

    - #### public void visitPostfixExpression(PostfixExpression expression)

    - #### public void visitPrefixExpression(PrefixExpression expression)

    - #### public void visitPropertyExpression(PropertyExpression expression)

    - #### public void visitRangeExpression(RangeExpression expression)

    - #### public void visitReturnStatement(ReturnStatement statement)

    - #### public void visitShortTernaryExpression(ElvisOperatorExpression expression)

    - #### public void visitSpreadExpression(SpreadExpression expression)

    - #### public void visitSpreadMapExpression(SpreadMapExpression expression)

    - #### public void visitStaticMethodCallExpression(StaticMethodCallExpression call)

    - #### public void visitSwitch(SwitchStatement statement)

    - #### public void visitSynchronizedStatement(SynchronizedStatement statement)

    - #### public void visitTernaryExpression(TernaryExpression expression)

    - #### public void visitThrowStatement(ThrowStatement statement)

    - #### public void visitTryCatchFinally(TryCatchStatement statement)

    - #### public void visitTupleExpression(TupleExpression expression)

    - #### public void visitUnaryMinusExpression(UnaryMinusExpression expression)

    - #### public void visitUnaryPlusExpression(UnaryPlusExpression expression)

    - #### public void visitVariableExpression(VariableExpression expression)

    - #### public void visitWhileLoop(WhileStatement loop)