Class 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
    • Field Detail

      • 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)
      • 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)