Class Java.CompilationUnit

    • Field Detail

      • optionalFileName

        public final java.lang.String optionalFileName
        A string that explains the 'file' (or similar resource) where this CU was loaded from.
      • optionalPackageDeclaration

        public Java.PackageDeclaration optionalPackageDeclaration
        The package declaration at the very top of this CU (if any).
    • Constructor Detail

      • CompilationUnit

        public CompilationUnit​(java.lang.String optionalFileName)
    • Method Detail

      • setPackageDeclaration

        public void setPackageDeclaration​(Java.PackageDeclaration packageDeclaration)
        Sets the package declaration of this CU.
      • addPackageMemberTypeDeclaration

        public void addPackageMemberTypeDeclaration​(Java.PackageMemberTypeDeclaration pmtd)
        Adds one top-level type declaration to this CU.
      • getPackageMemberTypeDeclarations

        public Java.PackageMemberTypeDeclaration[] getPackageMemberTypeDeclarations()
        Gets all classes and interfaces declared in this compilation unit.
      • getPackageMemberTypeDeclaration

        public Java.PackageMemberTypeDeclaration getPackageMemberTypeDeclaration​(java.lang.String name)
        Return the package member class or interface declared with the given name.
        Parameters:
        name - Declared (i.e. not the fully qualified) name
        Returns:
        null if a package member type with that name is not declared in this compilation unit