Class ASTHelper

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

public class ASTHelper extends Object
A common base class of AST helper methods which can be shared across the classic and new parsers
  • Field Details

    • output

      protected ModuleNode output
    • resolutions

      protected static final Map resolutions
  • Constructor Details

    • ASTHelper

      public ASTHelper(SourceUnit controller, ClassLoader classLoader)
    • ASTHelper

      public ASTHelper()
  • Method Details

    • getPackageName

      public String getPackageName()
    • setPackageName

      public void setPackageName(String packageName)
    • setPackage

      public PackageNode setPackage(String packageName, List<AnnotationNode> annotations)
    • 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)
      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 String dot(String base)
      A synonym for dot( base, "" ).
    • addImport

      protected void addImport(ClassNode type, String name, String aliasName)
    • addImport

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

      protected void addStaticImport(ClassNode type, String name, String alias)
    • addStaticImport

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

      protected void addStaticStarImport(ClassNode type, String importClass)
    • addStaticStarImport

      protected void addStaticStarImport(ClassNode type, String importClass, List<AnnotationNode> annotations)
    • addStarImport

      protected void addStarImport(String importPackage)
    • addStarImport

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