All Packages Class Hierarchy This Package Previous Next Index
Class openjava.ptree.CompilationUnit
java.lang.Object
|
+----openjava.ptree.PtreeObject
|
+----openjava.ptree.NonLeaf
|
+----openjava.ptree.CompilationUnit
- public class CompilationUnit
- extends NonLeaf
The CompilationUnit class presents for the whole parse tree in a file.
CompilationUnits consists of
(package statement) (import statement list) (type declaration list)
QualifiedName ImportStatementList TypeDeclarationList
- See Also:
- QualifiedName, ImportStatementList, TypeDeclarationList
-
CompilationUnit(QualifiedName, ImportStatementList, TypeDeclarationList)
- Allocates this object with specified parse-tree elements.
-
getImportStatements()
- Obtains the import statement list of this compilation unit
-
getPackage()
- Obtains the package of this compilation unit
-
getPublicClass()
- Obtains the public class in this compilation unit.
-
getTypeDeclarations()
- Obtains the type declaration list of this compilation unit
-
setImportStatements(ImportStatementList)
- Sets the import statement list of this compilation unit
-
setPackage(QualifiedName)
- Sets the package of this compilation unit
-
setTypeDeclarations(TypeDeclarationList)
- Sets the type declaration list of this compilation unit
-
writeCode()
- Overrides the writing code method
CompilationUnit
public CompilationUnit(QualifiedName e0,
ImportStatementList e1,
TypeDeclarationList e2)
- Allocates this object with specified parse-tree elements.
writeCode
public void writeCode()
- Overrides the writing code method
- Overrides:
- writeCode in class NonLeaf
setPackage
public void setPackage(QualifiedName qn)
- Sets the package of this compilation unit
- Parameters:
- qn - the qualified name indicating this package
getPackage
public QualifiedName getPackage()
- Obtains the package of this compilation unit
- Returns:
- the qualified name indicating this package
setImportStatements
public void setImportStatements(ImportStatementList islst)
- Sets the import statement list of this compilation unit
- Parameters:
- islst - the import statement list of this compilation unit
getImportStatements
public ImportStatementList getImportStatements()
- Obtains the import statement list of this compilation unit
- Returns:
- the import statement list of this compilation unit
setTypeDeclarations
public void setTypeDeclarations(TypeDeclarationList tdlst)
- Sets the type declaration list of this compilation unit
- Parameters:
- tdlst - the type declaration list of this compilation unit
getTypeDeclarations
public TypeDeclarationList getTypeDeclarations()
- Obtains the type declaration list of this compilation unit
- Returns:
- the type declaration list of this compilation unit
getPublicClass
public TypeDeclaration getPublicClass() throws PtreeException
- Obtains the public class in this compilation unit.
- Returns:
- the public class
- Throws: PtreeException
- if not one public class is declared.
All Packages Class Hierarchy This Package Previous Next Index