polyglot.ast
Interface SourceFile

All Superinterfaces:
java.lang.Cloneable, Copy, JL, Node, NodeOps
All Known Implementing Classes:
SourceFile_c

public interface SourceFile
extends Node

A SourceFile is an immutable representations of a Java language source file. It consists of a package name, a list of Imports, and a list of GlobalDecls.


Method Summary
 java.util.List decls()
          Get the source's top-level declarations.
 SourceFile decls(java.util.List decls)
          Set the source's top-level declarations.
 java.util.List imports()
          Get the source's declared imports.
 SourceFile imports(java.util.List imports)
          Set the source's declared imports.
 ImportTable importTable()
          Get the source's import table.
 SourceFile importTable(ImportTable importTable)
          Set the source's import table.
 PackageNode package_()
          Get the source's declared package.
 SourceFile package_(PackageNode package_)
          Set the source's declared package.
 Source source()
          Get the source file.
 SourceFile source(Source source)
          Set the source file.
 
Methods inherited from interface polyglot.ast.Node
childExpectedType, del, del, dump, ext, ext, ext, ext, position, position, visit, visitChild, visitEdge, visitList
 
Methods inherited from interface polyglot.ast.JL
init, node
 
Methods inherited from interface polyglot.ast.NodeOps
addDecls, addMembers, addMembersEnter, buildTypes, buildTypesEnter, disambiguate, disambiguateEnter, enterScope, enterScope, exceptionCheck, exceptionCheckEnter, prettyPrint, throwTypes, translate, typeCheck, typeCheckEnter, visitChildren
 
Methods inherited from interface polyglot.util.Copy
copy
 

Method Detail

package_

PackageNode package_()
Get the source's declared package.


package_

SourceFile package_(PackageNode package_)
Set the source's declared package.


imports

java.util.List imports()
Get the source's declared imports.

Returns:
A list of Import.

imports

SourceFile imports(java.util.List imports)
Set the source's declared imports.

Parameters:
imports - A list of Import.

decls

java.util.List decls()
Get the source's top-level declarations.

Returns:
A list of TopLevelDecl.

decls

SourceFile decls(java.util.List decls)
Set the source's top-level declarations.

Parameters:
decls - A list of TopLevelDecl.

importTable

ImportTable importTable()
Get the source's import table.


importTable

SourceFile importTable(ImportTable importTable)
Set the source's import table.


source

Source source()
Get the source file.


source

SourceFile source(Source source)
Set the source file.