## org.codehaus.groovy.syntax
Class ASTHelper

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

Direct Known Subclasses:
  AntlrParserPlugin

    public class ASTHelper

extends Object

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

Version:
  $Revision: 8008 $
Author:
  Jochen Theodorou, James Strachan, Bob McWhirter, Sam Pullara, Chris Poirier

Field Summary
`protected Map` `imports` Our imports, simple name => fully qualified name
`protected ModuleNode` `output`
`protected static Map` `resolutions`
`protected List` `staticDotImports` Our implicit static imports
`protected Map` `staticImports` Our explicit static imports, simple name => fully qualified name

Constructor Summary
`ASTHelper()`
`ASTHelper(SourceUnit controller, ClassLoader classLoader)`

Method Summary
`protected void` `addNewClassName(String name)`
`protected String` `dot(String base)` A synonym for `dot( base, "" )`.
`static String` `dot(String base, String name)` Returns two names joined by a dot.
`ClassLoader` `getClassLoader()` Returns our class loader (as supplied on construction).
`SourceUnit` `getController()`
`String` `getPackageName()`
`protected void` `importClass(ClassNode type, String name, String as)`
`protected void` `importPackageWithStar(String importPackage)`
`protected void` `makeModule()`
`void` `setClassLoader(ClassLoader classLoader)`
`void` `setController(SourceUnit controller)`
`void` `setPackageName(String packageName)`
`protected void` `staticImportClassWithStar(ClassNode type, String importClass)`
`protected void` `staticImportMethodOrField(ClassNode type, String name, String alias)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### imports

    protected Map imports

  Our imports, simple name => fully qualified name

### staticImports

    protected Map staticImports

  Our explicit static imports, simple name => fully qualified name

### staticDotImports

    protected List staticDotImports

  Our implicit static imports

### output

    protected ModuleNode output

### resolutions

    protected static Map resolutions

Constructor Detail

### ASTHelper

    public ASTHelper(SourceUnit controller,
                     ClassLoader classLoader)

### ASTHelper

    public ASTHelper()

Method Detail

### getPackageName

    public String getPackageName()

### setPackageName

    public void setPackageName(String packageName)

### getClassLoader

    public ClassLoader getClassLoader()

  Returns our class loader (as supplied on construction).

### setClassLoader

    public void setClassLoader(ClassLoader classLoader)

### getController

    public SourceUnit getController()

### setController

    public void setController(SourceUnit controller)

### dot

    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.

### makeModule

    protected void makeModule()

### dot

    protected String dot(String base)

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

### addNewClassName

    protected void addNewClassName(String name)

### importClass

    protected void importClass(ClassNode type,
                               String name,
                               String as)

### staticImportMethodOrField

    protected void staticImportMethodOrField(ClassNode type,
                                             String name,
                                             String alias)

### staticImportClassWithStar

    protected void staticImportClassWithStar(ClassNode type,
                                             String importClass)

### importPackageWithStar

    protected void importPackageWithStar(String importPackage)

Copyright © 2003-2008 The Codehaus. All rights reserved.