Class ASTHelper

Direct Known Subclasses:

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
  • Field Details

    • output

      protected ModuleNode output
    • resolutions

      protected static final java.util.Map resolutions
  • Constructor Details

    • ASTHelper

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

      public ASTHelper()
  • Method Details

    • 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)
      base - typically a package
      name - typically a simple unqualified class name
      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)