org.codehaus.groovy.syntax

## Class ASTHelper

- java.lang.Object
- - org.codehaus.groovy.syntax.ASTHelper

Direct Known Subclasses:
  AntlrParserPlugin

    public class ASTHelper
    extends java.lang.Object

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

Author:
  Jochen Theodorou, James Strachan, Bob McWhirter, Sam Pullara, Chris Poirier

### Field Summary

Fields
`protected ModuleNode` `output`
`protected static java.util.Map` `resolutions`

### Constructor Summary

Constructors
Constructor and Description
`ASTHelper()`
`ASTHelper(SourceUnit controller, java.lang.ClassLoader classLoader)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`protected void` `addImport(ClassNode type, java.lang.String name, java.lang.String aliasName)`
`protected void` `addImport(ClassNode type, java.lang.String name, java.lang.String aliasName, java.util.List<AnnotationNode> annotations)`
`protected void` `addStarImport(java.lang.String importPackage)`
`protected void` `addStarImport(java.lang.String importPackage, java.util.List<AnnotationNode> annotations)`
`protected void` `addStaticImport(ClassNode type, java.lang.String name, java.lang.String alias)`
`protected void` `addStaticImport(ClassNode type, java.lang.String name, java.lang.String alias, java.util.List<AnnotationNode> annotations)`
`protected void` `addStaticStarImport(ClassNode type, java.lang.String importClass)`
`protected void` `addStaticStarImport(ClassNode type, java.lang.String importClass, java.util.List<AnnotationNode> annotations)`
`protected java.lang.String` `dot(java.lang.String base)` A synonym for `dot( base, "" )`.
`static java.lang.String` `dot(java.lang.String base, java.lang.String name)`
`java.lang.ClassLoader` `getClassLoader()` Returns our class loader (as supplied on construction).
`SourceUnit` `getController()`
`java.lang.String` `getPackageName()`
`protected void` `makeModule()`
`void` `setClassLoader(java.lang.ClassLoader classLoader)`
`void` `setController(SourceUnit controller)`
`PackageNode` `setPackage(java.lang.String packageName, java.util.List<AnnotationNode> annotations)`
`void` `setPackageName(java.lang.String packageName)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### output

    protected ModuleNode output

#### resolutions

    protected static java.util.Map resolutions

### Constructor Detail

#### ASTHelper

    public ASTHelper(SourceUnit controller,
                     java.lang.ClassLoader classLoader)

#### ASTHelper

    public ASTHelper()

### Method Detail

#### getPackageName

    public java.lang.String getPackageName()

#### setPackageName

    public void setPackageName(java.lang.String packageName)

#### setPackage

    public PackageNode setPackage(java.lang.String packageName,
                                  java.util.List<AnnotationNode> annotations)

#### getClassLoader

    public java.lang.ClassLoader getClassLoader()

Returns our class loader (as supplied on construction).

#### setClassLoader

    public void setClassLoader(java.lang.ClassLoader classLoader)

#### getController

    public SourceUnit getController()

#### setController

    public void setController(SourceUnit controller)

#### dot

    public static java.lang.String dot(java.lang.String base,
                                       java.lang.String name)

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

#### makeModule

    protected void makeModule()

#### dot

    protected java.lang.String dot(java.lang.String base)

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

#### addImport

    protected void addImport(ClassNode type,
                             java.lang.String name,
                             java.lang.String aliasName)

#### addImport

    protected void addImport(ClassNode type,
                             java.lang.String name,
                             java.lang.String aliasName,
                             java.util.List<AnnotationNode> annotations)

#### addStaticImport

    protected void addStaticImport(ClassNode type,
                                   java.lang.String name,
                                   java.lang.String alias)

#### addStaticImport

    protected void addStaticImport(ClassNode type,
                                   java.lang.String name,
                                   java.lang.String alias,
                                   java.util.List<AnnotationNode> annotations)

#### addStaticStarImport

    protected void addStaticStarImport(ClassNode type,
                                       java.lang.String importClass)

#### addStaticStarImport

    protected void addStaticStarImport(ClassNode type,
                                       java.lang.String importClass,
                                       java.util.List<AnnotationNode> annotations)

#### addStarImport

    protected void addStarImport(java.lang.String importPackage)

#### addStarImport

    protected void addStarImport(java.lang.String importPackage,
                                 java.util.List<AnnotationNode> annotations)