Package: org.codehaus.groovy.ast.builder

## [Groovy] Class AstSpecificationCompiler

- org.codehaus.groovy.ast.builder.AstSpecificationCompiler

- All Implemented Interfaces and Traits:
    GroovyInterceptable

      @SuppressWarningsSuppressWarnings
      class AstSpecificationCompiler
      extends Object

  Handles parsing the properties from the closure into values that can be referenced. This object is very stateful and not threadsafe. It accumulates expressions in the 'expression' field as they are found and executed within the DSL. Note: this class consists of many one-line method calls. A better implementation might be to take a declarative approach and replace the one-liners with map entries.

- - ### Constructor Summary

    Constructors
    Constructor and description
    `AstSpecificationCompiler (Closure spec)` Creates the DSL compiler.
    `AstSpecificationCompiler ()`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `void` | `annotation(Class target, Closure argBlock)` Creates an AnnotationNode.
    `` | `void` | `annotationConstant(Closure argBlock)` Creates an AnnotationConstantExpression.
    `` | `void` | `annotations(Closure argBlock)` Designates a list of AnnotationNodes.
    `` | `void` | `argumentList(Closure argBlock)` Creates an ArgumentListExpression.
    `` | `void` | `array(Class type, Closure argBlock)` Creates an ArrayExpression.
    `` | `void` | `assertStatement(Closure argBlock)` Creates an AssertStatement.
    `` | `void` | `attribute(Closure argBlock)` Creates an AttributeExpression.
    `` | `void` | `binary(Closure argBlock)` Creates a BinaryExpression.
    `` | `void` | `bitwiseNegation(Closure argBlock)` Creates a BitwiseNegationExpression.
    `` | `void` | `block(Closure argBlock)` Creates a BlockStatement.
    `` | `void` | `booleanExpression(Closure argBlock)` Creates a BooleanExpression.
    `` | `void` | `breakStatement(String label)` Creates a BreakStatement.
    `` | `void` | `caseStatement(Closure argBlock)` Create a CaseStatement.
    `` | `void` | `cast(Class type, Closure argBlock)` Creates a CastExpression.
    `` | `void` | `catchStatement(Closure argBlock)` Creates a CatchStatement.
    `` | `void` | `classExpression(Class type)` Creates a ClassExpression.
    `` | `void` | `classNode(Class target)` Creates a ClassNode.
    `` | `void` | `classNode(String name, int modifiers, Closure argBlock)` Creates a ClassNode
    `` | `void` | `closure(Closure argBlock)` Creates a ClosureExpression.
    `` | `void` | `closureList(Closure argBlock)` Creates a ClosureListExpression.
    `` | `void` | `constant(Object value)` Creates a ConstantExpression.
    `` | `void` | `constructor(int modifiers, Closure argBlock)` Creates a ConstructorNode.
    `` | `void` | `constructorCall(Class type, Closure argBlock)` Creates an ConstructorCallExpression.
    `` | `void` | `constructors(Closure argBlock)` Designates a list of ConstructorNodes.
    `` | `void` | `continueStatement(Closure argBlock)` Creates a ContinueStatement.
    `` | `void` | `declaration(Closure argBlock)` Creates a DeclarationExpression.
    `` | `void` | `defaultCase(Closure argBlock)` Creates a BlockStatement.
    `` | `void` | `dynamicVariable(String variable, boolean isStatic)` Creates a DynamicVariable.
    `` | `void` | `elvisOperator(Closure argBlock)` Creates an ElvisOperatorExpression.
    `` | `void` | `empty()` Creates EmptyStatement.
    `` | `void` | `exceptions(Closure argBlock)` Creates a ClassNode[].
    `` | `void` | `expression(Closure argBlock)` Creates an ExpressionStatement.
    `` | `void` | `field(Closure argBlock)` Creates a FieldExpression.
    `` | `void` | `fieldNode(String name, int modifiers, Class type, Class owner, Closure argBlock)` Creates a FieldNode.
    `` | `void` | `fields(Closure argBlock)` Designates a list of `FieldNode`s.
    `` | `void` | `forStatement(Closure argBlock)` Create a ForStatement.
    `` | `void` | `gString(String verbatimText, Closure argBlock)` Creates a gString.
    `` | `void` | `genericsType(Class type, Closure argBlock)` Creates a GenericsType.
    `` | `void` | `genericsTypes(Closure argBlock)` Creates a GenericsTypes[].
    `` | `List` | `getExpression()` Gets the current generated expression.
    `` | `void` | `ifStatement(Closure argBlock)` Creates an IfStatement.
    `` | `void` | `importNode(Class target, String alias)` Creates an ImportNode.
    `` | `void` | `inclusive(boolean value)` Creates a boolean value.
    `` | `void` | `innerClass(String name, int modifiers, Closure argBlock)` Creates an inner class.
    `` | `void` | `interfaces(Closure argBlock)` Creates a ClassNode[].
    `` | `void` | `label(String label)` Creates a label.
    `` | `void` | `list(Closure argBlock)` Creates a ListExpression.
    `` | `void` | `lowerBound(Class target)` Create lowerBound ClassNode.
    `` | `void` | `map(Closure argBlock)` Creates a MapExpression.
    `` | `void` | `mapEntry(Closure argBlock)` Creates a MapEntryExpression.
    `` | `void` | `mapEntry(Map map)` Creates a mapEntry.
    `` | `void` | `member(String name, Closure argBlock)` Creates a 2 element list of name and Annotation.
    `` | `void` | `method(String name, int modifiers, Class returnType, Closure argBlock)` Creates a MethodNode.
    `` | `void` | `methodCall(Closure argBlock)` Creates a MethodCallExpression.
    `` | `void` | `methodPointer(Closure argBlock)` Creates a methodPointer.
    `` | `void` | `methods(Closure argBlock)` Designates a list of MethodNodes.
    `` | `void` | `mixin(String name, int modifiers, Closure argBlock)` Creates a MixinNode.
    `` | `void` | `mixins(Closure argBlock)` Creates a MixinNode[].
    `` | `void` | `namedArgumentList(Closure argBlock)` Creates a NamedArgumentListExpression.
    `` | `void` | `not(Closure argBlock)` Creates a NotExpression.
    `` | `void` | `parameter(Map args, Closure argBlock)` Creates a Parameter.
    `` | `void` | `parameters(Closure argBlock)` Creates a Parameter[].
    `` | `void` | `postfix(Closure argBlock)` Creates a PostfixExpression.
    `` | `void` | `prefix(Closure argBlock)` Creates a PrefixExpression.
    `` | `void` | `properties(Closure argBlock)` Designates a list of `PropertyNode`s.
    `` | `void` | `property(Closure argBlock)` Creates a property.
    `` | `void` | `propertyNode(String name, int modifiers, Class type, Class owner, Closure argBlock)` Creates a PropertyNode.
    `` | `void` | `range(Closure argBlock)` Creates a RangeExpression.
    `` | `void` | `range(Range range)` Creates a RangeExpression.
    `` | `void` | `returnStatement(Closure argBlock)` Creates a ReturnStatement.
    `` | `void` | `spread(Closure argBlock)` Creates a SpreadExpression.
    `` | `void` | `spreadMap(Closure argBlock)` Creates a SpreadMapExpression.
    `` | `void` | `staticMethodCall(Class target, String name, Closure argBlock)` Creates a StaticMethodCallExpression.
    `` | `void` | `staticMethodCall(MethodClosure target, Closure argBlock)` Creates a StaticMethodCallExpression.
    `` | `void` | `strings(Closure argBlock)` Designates a list of ConstantExpressions.
    `` | `void` | `switchStatement(Closure argBlock)` Creates a SwitchStatement.
    `` | `void` | `synchronizedStatement(Closure argBlock)` Creates a SynchronizedStatement.
    `` | `void` | `throwStatement(Closure argBlock)` Creates a ThrowStatement.
    `` | `void` | `token(String value)` Creates a token.
    `` | `void` | `tryCatch(Closure argBlock)` Creates a TryCatchStatement.
    `` | `void` | `tuple(Closure argBlock)` Creates a TupleExpression.
    `` | `void` | `unaryMinus(Closure argBlock)` Creates a UnaryMinusExpression
    `` | `void` | `unaryPlus(Closure argBlock)` Creates a UnaryPlusExpression.
    `` | `void` | `upperBound(Closure argBlock)` Creates a list of upperBound ClassNodes.
    `` | `void` | `values(Closure argBlock)` Designates a list of Expressions.
    `` | `void` | `variable(String variable)` Creates a VariableExpression.
    `` | `void` | `whileStatement(Closure argBlock)` Creates a WhileStatement.

  - ### Inherited Methods Summary

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

- - ### Constructor Detail

    - #### AstSpecificationCompiler(@DelegatesToDelegatesTo Closure spec)

      Creates the DSL compiler.

    - #### AstSpecificationCompiler()

  - ### Method Detail

    - #### void annotation(Class target, @DelegatesToDelegatesTo Closure argBlock)

      Creates an AnnotationNode.

    - #### void annotationConstant(@DelegatesToDelegatesTo Closure argBlock)

      Creates an AnnotationConstantExpression.

    - #### void annotations(@DelegatesToDelegatesTo Closure argBlock)

      Designates a list of AnnotationNodes.

    - #### void argumentList(@DelegatesToDelegatesTo Closure argBlock)

      Creates an ArgumentListExpression.

    - #### void array(Class type, @DelegatesToDelegatesTo Closure argBlock)

      Creates an ArrayExpression.

    - #### void assertStatement(@DelegatesToDelegatesTo Closure argBlock)

      Creates an AssertStatement.

    - #### void attribute(@DelegatesToDelegatesTo Closure argBlock)

      Creates an AttributeExpression.

    - #### void binary(@DelegatesToDelegatesTo Closure argBlock)

      Creates a BinaryExpression.

    - #### void bitwiseNegation(@DelegatesToDelegatesTo Closure argBlock)

      Creates a BitwiseNegationExpression.

    - #### void block(@DelegatesToDelegatesTo Closure argBlock)

      Creates a BlockStatement.

    - #### void booleanExpression(@DelegatesToDelegatesTo Closure argBlock)

      Creates a BooleanExpression.

    - #### void breakStatement(String label)

      Creates a BreakStatement.

    - #### void caseStatement(@DelegatesToDelegatesTo Closure argBlock)

      Create a CaseStatement.

    - #### void cast(Class type, @DelegatesToDelegatesTo Closure argBlock)

      Creates a CastExpression.

    - #### void catchStatement(@DelegatesToDelegatesTo Closure argBlock)

      Creates a CatchStatement.

    - #### void classExpression(Class type)

      Creates a ClassExpression.

    - #### void classNode(Class target)

      Creates a ClassNode.

    - #### void classNode(String name, int modifiers, @DelegatesToDelegatesTo Closure argBlock)

      Creates a ClassNode

    - #### void closure(@DelegatesToDelegatesTo Closure argBlock)

      Creates a ClosureExpression.

    - #### void closureList(@DelegatesToDelegatesTo Closure argBlock)

      Creates a ClosureListExpression.

    - #### void constant(Object value)

      Creates a ConstantExpression.

    - #### void constructor(int modifiers, @DelegatesToDelegatesTo Closure argBlock)

      Creates a ConstructorNode.

    - #### void constructorCall(Class type, @DelegatesToDelegatesTo Closure argBlock)

      Creates an ConstructorCallExpression.

    - #### void constructors(@DelegatesToDelegatesTo Closure argBlock)

      Designates a list of ConstructorNodes.

    - #### void continueStatement(@DelegatesToDelegatesTo Closure argBlock)

      Creates a ContinueStatement.

    - #### void declaration(@DelegatesToDelegatesTo Closure argBlock)

      Creates a DeclarationExpression.

    - #### void defaultCase(@DelegatesToDelegatesTo Closure argBlock)

      Creates a BlockStatement.

    - #### void dynamicVariable(String variable, boolean isStatic)

      Creates a DynamicVariable.

    - #### void elvisOperator(@DelegatesToDelegatesTo Closure argBlock)

      Creates an ElvisOperatorExpression.

    - #### void empty()

      Creates EmptyStatement.

    - #### void exceptions(@DelegatesToDelegatesTo Closure argBlock)

      Creates a ClassNode[].

    - #### @SuppressWarningsSuppressWarnings void expression(@DelegatesToDelegatesTo Closure argBlock)

      Creates an ExpressionStatement.

    - #### void field(@DelegatesToDelegatesTo Closure argBlock)

      Creates a FieldExpression.

    - #### void fieldNode(String name, int modifiers, Class type, Class owner, @DelegatesToDelegatesTo Closure argBlock)

      Creates a FieldNode.

    - #### void fields(@DelegatesToDelegatesTo Closure argBlock)

      Designates a list of `FieldNode`s.

    - #### void forStatement(@DelegatesToDelegatesTo Closure argBlock)

      Create a ForStatement.

    - #### void gString(String verbatimText, @DelegatesToDelegatesTo Closure argBlock)

      Creates a gString.

    - #### void genericsType(Class type, @DelegatesToDelegatesTo Closure argBlock)

      Creates a GenericsType.

    - #### void genericsTypes(@DelegatesToDelegatesTo Closure argBlock)

      Creates a GenericsTypes[].

    - #### List getExpression()

      Gets the current generated expression.

    - #### void ifStatement(@DelegatesToDelegatesTo Closure argBlock)

      Creates an IfStatement.

    - #### void importNode(Class target, String alias)

      Creates an ImportNode.

    - #### void inclusive(boolean value)

      Creates a boolean value.

    - #### void innerClass(String name, int modifiers, @DelegatesToDelegatesTo Closure argBlock)

      Creates an inner class.

    - #### void interfaces(@DelegatesToDelegatesTo Closure argBlock)

      Creates a ClassNode[].

    - #### void label(String label)

      Creates a label.

    - #### void list(@DelegatesToDelegatesTo Closure argBlock)

      Creates a ListExpression.

    - #### void lowerBound(Class target)

      Create lowerBound ClassNode.

    - #### void map(@DelegatesToDelegatesTo Closure argBlock)

      Creates a MapExpression.

    - #### void mapEntry(@DelegatesToDelegatesTo Closure argBlock)

      Creates a MapEntryExpression.

    - #### void mapEntry(Map map)

      Creates a mapEntry.

    - #### void member(String name, @DelegatesToDelegatesTo Closure argBlock)

      Creates a 2 element list of name and Annotation. Used with Annotation Members.

    - #### void method(String name, int modifiers, Class returnType, @DelegatesToDelegatesTo Closure argBlock)

      Creates a MethodNode.

    - #### void methodCall(@DelegatesToDelegatesTo Closure argBlock)

      Creates a MethodCallExpression.

    - #### void methodPointer(@DelegatesToDelegatesTo Closure argBlock)

      Creates a methodPointer.

    - #### void methods(@DelegatesToDelegatesTo Closure argBlock)

      Designates a list of MethodNodes.

    - #### void mixin(String name, int modifiers, @DelegatesToDelegatesTo Closure argBlock)

      Creates a MixinNode.

    - #### void mixins(@DelegatesToDelegatesTo Closure argBlock)

      Creates a MixinNode[].

    - #### void namedArgumentList(@DelegatesToDelegatesTo Closure argBlock)

      Creates a NamedArgumentListExpression.

    - #### void not(@DelegatesToDelegatesTo Closure argBlock)

      Creates a NotExpression.

    - #### void parameter(Map args, @DelegatesToDelegatesTo Closure argBlock)

      Creates a Parameter.

    - #### void parameters(@DelegatesToDelegatesTo Closure argBlock)

      Creates a Parameter[].

    - #### void postfix(@DelegatesToDelegatesTo Closure argBlock)

      Creates a PostfixExpression.

    - #### void prefix(@DelegatesToDelegatesTo Closure argBlock)

      Creates a PrefixExpression.

    - #### void properties(@DelegatesToDelegatesTo Closure argBlock)

      Designates a list of `PropertyNode`s.

    - #### void property(@DelegatesToDelegatesTo Closure argBlock)

      Creates a property.

    - #### void propertyNode(String name, int modifiers, Class type, Class owner, @DelegatesToDelegatesTo Closure argBlock)

      Creates a PropertyNode.

    - #### void range(@DelegatesToDelegatesTo Closure argBlock)

      Creates a RangeExpression.

    - #### void range(Range range)

      Creates a RangeExpression.

    - #### void returnStatement(@DelegatesToDelegatesTo Closure argBlock)

      Creates a ReturnStatement.

    - #### void spread(@DelegatesToDelegatesTo Closure argBlock)

      Creates a SpreadExpression.

    - #### void spreadMap(@DelegatesToDelegatesTo Closure argBlock)

      Creates a SpreadMapExpression.

    - #### void staticMethodCall(Class target, String name, @DelegatesToDelegatesTo Closure argBlock)

      Creates a StaticMethodCallExpression.

    - #### void staticMethodCall(MethodClosure target, @DelegatesToDelegatesTo Closure argBlock)

      Creates a StaticMethodCallExpression.

    - #### void strings(@DelegatesToDelegatesTo Closure argBlock)

      Designates a list of ConstantExpressions.

    - #### void switchStatement(@DelegatesToDelegatesTo Closure argBlock)

      Creates a SwitchStatement.

    - #### void synchronizedStatement(@DelegatesToDelegatesTo Closure argBlock)

      Creates a SynchronizedStatement.

    - #### void throwStatement(@DelegatesToDelegatesTo Closure argBlock)

      Creates a ThrowStatement.

    - #### void token(String value)

      Creates a token.

    - #### void tryCatch(@DelegatesToDelegatesTo Closure argBlock)

      Creates a TryCatchStatement.

    - #### void tuple(@DelegatesToDelegatesTo Closure argBlock)

      Creates a TupleExpression.

    - #### void unaryMinus(@DelegatesToDelegatesTo Closure argBlock)

      Creates a UnaryMinusExpression

    - #### void unaryPlus(@DelegatesToDelegatesTo Closure argBlock)

      Creates a UnaryPlusExpression.

    - #### void upperBound(@DelegatesToDelegatesTo Closure argBlock)

      Creates a list of upperBound ClassNodes.

    - #### void values(@DelegatesToDelegatesTo Closure argBlock)

      Designates a list of Expressions.

    - #### void variable(String variable)

      Creates a VariableExpression.

    - #### void whileStatement(@DelegatesToDelegatesTo Closure argBlock)

      Creates a WhileStatement.