|
Web Site | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.janino.Java.CompilationUnit
Holds the result of Parser.parseCompilationUnit()
.
Constructor Summary | |
Java.CompilationUnit(String optionalFileName)
|
Method Summary | |
void |
addImportDeclaration(Java.ImportDeclaration id)
|
void |
addPackageMemberTypeDeclaration(Java.PackageMemberTypeDeclaration pmtd)
|
Java.Scope |
getEnclosingScope()
|
String |
getFileName()
|
Java.PackageMemberTypeDeclaration |
getPackageMemberTypeDeclaration(String name)
Return the package member class or interface declared with the given name. |
Java.PackageMemberTypeDeclaration[] |
getPackageMemberTypeDeclarations()
Get all classes and interfaces declared in this compilation unit. |
String[] |
getSingleTypeImport(String name)
Check if the given name was imported through a "single type import", e.g. |
void |
setPackageDeclaration(Java.PackageDeclaration packageDeclaration)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Java.CompilationUnit(String optionalFileName)
optionalFileName
- only for getFileName()
Method Detail |
public String getFileName()
optionalFileName
given at construction.public Java.Scope getEnclosingScope()
getEnclosingScope
in interface Java.Scope
public void setPackageDeclaration(Java.PackageDeclaration packageDeclaration)
public void addImportDeclaration(Java.ImportDeclaration id) throws Parser.ParseException
Parser.ParseException
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 unitpublic String[] getSingleTypeImport(String name)
import java.util.Map
null
|
Web Site | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |