|
janino.net | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.codehaus.janino.Java.CompilationUnit
public static final class Java.CompilationUnit
Holds the result of Parser.parseCompilationUnit().
| Nested Class Summary | |
|---|---|
static class |
Java.CompilationUnit.ImportDeclaration
Base class for the various IMPORT declarations. |
static class |
Java.CompilationUnit.SingleStaticImportDeclaration
Represents a single static import declaration like import java.util.Collections.EMPTY_MAP; |
static class |
Java.CompilationUnit.SingleTypeImportDeclaration
Represents a 'single-type import declaration' like ' import java.util.Map;'. |
static class |
Java.CompilationUnit.StaticImportOnDemandDeclaration
Represents a static-import-on-demand declaration like import java.util.Collections. |
static class |
Java.CompilationUnit.TypeImportOnDemandDeclaration
Represents a type-import-on-demand declaration like import java.util.*;. |
| Field Summary | |
|---|---|
List<Java.CompilationUnit.ImportDeclaration> |
importDeclarations
The IMPORT declarations in this CU. |
String |
optionalFileName
A string that explains the 'file' (or similar resource) where this CU was loaded from. |
Java.PackageDeclaration |
optionalPackageDeclaration
The package declaration at the very top of this CU (if any). |
List<Java.PackageMemberTypeDeclaration> |
packageMemberTypeDeclarations
The top-level declarations in this CU. |
| Constructor Summary | |
|---|---|
Java.CompilationUnit(String optionalFileName)
|
|
| Method Summary | |
|---|---|
void |
addImportDeclaration(Java.CompilationUnit.ImportDeclaration id)
Adds one IMPORT declaration to this CU. |
void |
addPackageMemberTypeDeclaration(Java.PackageMemberTypeDeclaration pmtd)
Adds one top-level type declaration to this CU. |
Java.Scope |
getEnclosingScope()
|
Java.PackageMemberTypeDeclaration |
getPackageMemberTypeDeclaration(String name)
Return the package member class or interface declared with the given name. |
Java.PackageMemberTypeDeclaration[] |
getPackageMemberTypeDeclarations()
Gets all classes and interfaces declared in this compilation unit. |
void |
setPackageDeclaration(Java.PackageDeclaration packageDeclaration)
Sets the package declaration of this CU. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final String optionalFileName
public Java.PackageDeclaration optionalPackageDeclaration
public final List<Java.CompilationUnit.ImportDeclaration> importDeclarations
public final List<Java.PackageMemberTypeDeclaration> packageMemberTypeDeclarations
| Constructor Detail |
|---|
public Java.CompilationUnit(String optionalFileName)
| Method Detail |
|---|
public Java.Scope getEnclosingScope()
getEnclosingScope in interface Java.Scopenullpublic void setPackageDeclaration(Java.PackageDeclaration packageDeclaration)
public void addImportDeclaration(Java.CompilationUnit.ImportDeclaration id)
public void addPackageMemberTypeDeclaration(Java.PackageMemberTypeDeclaration pmtd)
public Java.PackageMemberTypeDeclaration[] getPackageMemberTypeDeclarations()
public Java.PackageMemberTypeDeclaration getPackageMemberTypeDeclaration(String name)
name - Declared (i.e. not the fully qualified) name
null if a package member type with that name is not declared in this compilation unit
|
janino.net | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||