Groovy Documentation

## org.codehaus.groovy.syntax
[Java] Class ASTHelper

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

    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

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

Field Summary
`protected ModuleNode` | `output`
`protected static java.util.Map` | `resolutions`

Constructor Summary
`ASTHelper(SourceUnit controller, java.lang.ClassLoader classLoader)`
`ASTHelper()`

Method Summary
`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 annotations)`
`protected void` | `addStarImport(java.lang.String importPackage)`
`protected void` | `addStarImport(java.lang.String importPackage, java.util.List 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 annotations)`
`protected void` | `addStaticStarImport(ClassNode type, java.lang.String importClass)`
`protected void` | `addStaticStarImport(ClassNode type, java.lang.String importClass, java.util.List annotations)`

`static java.lang.String`

`dot(java.lang.String base, java.lang.String name)`

Returns:
  Two names joined by a dot.

`protected java.lang.String` | `dot(java.lang.String base)` A synonym for `dot( base, "" )`.
`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 annotations)`
`void` | `setPackageName(java.lang.String packageName)`

Methods inherited from class java.lang.Object
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()

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

### 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 annotations)

### addStarImport

    protected void addStarImport(java.lang.String importPackage)

### addStarImport

    protected void addStarImport(java.lang.String importPackage, java.util.List 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 annotations)

### addStaticStarImport

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

### addStaticStarImport

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

### 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.

### dot

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

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

### getClassLoader

    public java.lang.ClassLoader getClassLoader()

  Returns our class loader (as supplied on construction).

### getController

    public SourceUnit getController()

### getPackageName

    public java.lang.String getPackageName()

### makeModule

    protected void makeModule()

### setClassLoader

    public void setClassLoader(java.lang.ClassLoader classLoader)

### setController

    public void setController(SourceUnit controller)

### setPackage

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

### setPackageName

    public void setPackageName(java.lang.String packageName)

Groovy Documentation