Package: org.codehaus.groovy.syntax

## [Java] Class ASTHelper

- org.codehaus.groovy.syntax.ASTHelper

- A common base class of AST helper methods which can be shared across the classic and new parsers

  Authors:
    Jochen Theodorou
    James Strachan
    Bob McWhirter
    Sam Pullara
    Chris Poirier

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `protected ModuleNode` | `output` |
    `protected static Map` | `resolutions` |

  - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `ClassLoader` | `classLoader`
    `org.codehaus.groovy.control.SourceUnit` | `controller`
    `String` | `packageName`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `ASTHelper (org.codehaus.groovy.control.SourceUnit controller, ClassLoader classLoader)`
    `ASTHelper ()`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `protected void` | `addImport(ClassNode type, String name, String aliasName)`
    `` | `protected void` | `addImport(ClassNode type, String name, String aliasName, List<AnnotationNode> annotations)`
    `` | `protected void` | `addStarImport(String importPackage)`
    `` | `protected void` | `addStarImport(String importPackage, List<AnnotationNode> annotations)`
    `` | `protected void` | `addStaticImport(ClassNode type, String name, String alias)`
    `` | `protected void` | `addStaticImport(ClassNode type, String name, String alias, List<AnnotationNode> annotations)`
    `` | `protected void` | `addStaticStarImport(ClassNode type, String importClass)`
    `` | `protected void` | `addStaticStarImport(ClassNode type, String importClass, List<AnnotationNode> annotations)`
    `` | `static String` | `dot(String base, String name)` Returns: Two names joined by a dot.
    `` | `protected String` | `dot(String base)` A synonym for `dot( base, "" )`.
    `` | `ClassLoader` | `getClassLoader()` Returns our class loader (as supplied on construction).
    `` | `org.codehaus.groovy.control.SourceUnit` | `getController()`
    `` | `String` | `getPackageName()`
    `` | `protected void` | `makeModule()`
    `` | `void` | `setClassLoader(ClassLoader classLoader)`
    `` | `void` | `setController(org.codehaus.groovy.control.SourceUnit controller)`
    `` | `PackageNode` | `setPackage(String packageName, List<AnnotationNode> annotations)`
    `` | `void` | `setPackageName(String packageName)`

  - ### Inherited Methods Summary

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

- - ### Field Detail

    - #### protected ModuleNode output

    - #### protected static Map resolutions

  - ### Property Detail

    - #### ClassLoader classLoader

    - #### org.codehaus.groovy.control.SourceUnit controller

    - #### String packageName

  - ### Constructor Detail

    - #### public ASTHelper(org.codehaus.groovy.control.SourceUnit controller, ClassLoader classLoader)

    - #### public ASTHelper()

  - ### Method Detail

    - #### protected void addImport(ClassNode type, String name, String aliasName)

    - #### protected void addImport(ClassNode type, String name, String aliasName, List<AnnotationNode> annotations)

    - #### protected void addStarImport(String importPackage)

    - #### protected void addStarImport(String importPackage, List<AnnotationNode> annotations)

    - #### protected void addStaticImport(ClassNode type, String name, String alias)

    - #### protected void addStaticImport(ClassNode type, String name, String alias, List<AnnotationNode> annotations)

    - #### protected void addStaticStarImport(ClassNode type, String importClass)

    - #### protected void addStaticStarImport(ClassNode type, String importClass, List<AnnotationNode> annotations)

    - #### public static String dot(String base, String name)

      Returns:
        Two names joined by a dot. If the base name is empty, returns the name unchanged.
      Parameters:
        `base` - typically a package
        `name` - typically a simple unqualified class name

    - #### protected String dot(String base)

      A synonym for `dot( base, "" )`.

    - #### public ClassLoader getClassLoader()

      Returns our class loader (as supplied on construction).

    - #### public org.codehaus.groovy.control.SourceUnit getController()

    - #### public String getPackageName()

    - #### protected void makeModule()

    - #### public void setClassLoader(ClassLoader classLoader)

    - #### public void setController(org.codehaus.groovy.control.SourceUnit controller)

    - #### public PackageNode setPackage(String packageName, List<AnnotationNode> annotations)

    - #### public void setPackageName(String packageName)