Class ModuleNode

  • All Implemented Interfaces:
    org.objectweb.asm.Opcodes

    public class ModuleNode
    extends ASTNode
    implements org.objectweb.asm.Opcodes
    Represents a module, which consists typically of a class declaration but could include some imports, some statements and multiple classes intermixed with statements like scripts in Python or Ruby
    • Constructor Detail

      • ModuleNode

        public ModuleNode​(SourceUnit context)
    • Method Detail

      • getImportType

        public ClassNode getImportType​(String alias)
        Parameters:
        alias - the name of interest
        Returns:
        the class node for the given alias or null if none is available
      • getImport

        public ImportNode getImport​(String alias)
        Parameters:
        alias - the name of interest
        Returns:
        the import node for the given alias or null if none is available
      • addStarImport

        public void addStarImport​(String packageName)
      • addStaticStarImport

        public void addStaticStarImport​(String name,
                                        ClassNode type)
      • addStatement

        public void addStatement​(Statement node)
      • addClass

        public void addClass​(ClassNode node)
      • addMethod

        public void addMethod​(MethodNode node)
      • getPackageName

        public String getPackageName()
      • setPackage

        public void setPackage​(PackageNode packageNode)
      • setPackageName

        public void setPackageName​(String packageName)
      • hasPackageName

        public boolean hasPackageName()
      • hasPackage

        public boolean hasPackage()
      • getDescription

        public String getDescription()
        Returns:
        the underlying character stream description
      • setDescription

        public void setDescription​(String description)
      • getScriptClassDummy

        public ClassNode getScriptClassDummy()
      • createStatementsClass

        protected ClassNode createStatementsClass()
      • extractClassFromFileDescription

        protected String extractClassFromFileDescription()
      • isEmpty

        public boolean isEmpty()
      • sortClasses

        public void sortClasses()
      • hasImportsResolved

        public boolean hasImportsResolved()
      • setImportsResolved

        public void setImportsResolved​(boolean importsResolved)
      • getMainClassName

        public String getMainClassName()