Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.5.0)

E13403-06


javax.ide.model.java.source.tree
Interface FileT

All Superinterfaces:
Tree

public interface FileT
extends Tree

The root of a source file, also called a compilation unit. From the root, a client may retrieve the package declaration, the import declarations, and all top-level type declarations.


Field Summary

 

Fields inherited from interface javax.ide.model.java.source.tree.Tree
EMPTY_ARRAY

 

Method Summary
 TreeTransaction beginTransaction()
          Begins a single-tree transaction.
 void clearAllProperties(java.lang.String key)
          Traverses the entire parse tree, calling setProperty(key, null) on each element.
 ClassT getClass(java.lang.String name)
          Gets the matching top-level source class.
 java.util.List getClasses()
          Gets the list of top-level source classes.
 TreeFactory getFactory()
          Gets the factory to create Tree objects in this FileT.
 java.util.Set getImportNames()
          Gets the set of import strings.
 java.util.List getImports()
          Gets the list of import declarations.
 JavaModel getOwningModel()
          Gets the owning JavaModel.
 PackageT getPackage()
          Gets the package declaration.
 java.lang.String getPackageName()
          Gets the package name, empty if none.
 ClassT getPrimaryClass()
          Gets the primary class.
 TreeTransaction getTransaction()
          Gets the in-progress single-tree transaction, null if none.
 java.net.URI getURI()
          Gets the URI of this file, null if none.
 void setPackage(PackageT packageD)
          Attempts to set the package declaration.
 void setPackageName(java.lang.String packageName)
          Attempts to set the name of the package declaration.

 

Methods inherited from interface javax.ide.model.java.source.tree.Tree
accept, addSelf, addSelf, addSelfAfter, addSelfBefore, clearProperty, cloneSelf, getChildren, getOwningFile, getParent, getPosition, getProperty, getSiblingAfter, getSiblingBefore, getSiblings, getTreeKind, isSynthetic, removeSelf, replaceSelf, setProperty

 

Method Detail

getPackage

PackageT getPackage()
Gets the package declaration.
Returns:
The package symbol. Null if none.

getPackageName

java.lang.String getPackageName()
Gets the package name, empty if none.
Returns:
The name of the package declaration. An empty string, if none.

setPackage

void setPackage(PackageT packageD)
Attempts to set the package declaration.

setPackageName

void setPackageName(java.lang.String packageName)
Attempts to set the name of the package declaration.

getImports

java.util.List getImports()
Gets the list of import declarations.
Returns:
The array of import symbols. Returns a collection of ImportT's.

List of ImportTs.


getImportNames

java.util.Set getImportNames()
Gets the set of import strings.
Returns:
The set (of String's) of fully qualified import names. If you add a String value that does not already exist in the set, then an import will be generated for that value. If you add a String value that already does exist in the set, it will be ignored.

Set of Strings.


getClasses

java.util.List getClasses()
Gets the list of top-level source classes.
Returns:
The array of class symbols. Returns a collection of ClassT's.

List of ClassTs.


getClass

ClassT getClass(java.lang.String name)
Gets the matching top-level source class.
Returns:
The matching class symbol. Null if none.

getPrimaryClass

ClassT getPrimaryClass()
Gets the primary class. Here, "primary class" means the class that bears the same name as the compilation unit (file). If no class is defined with the same name as the compilation unit, then no class will be returned. If the compilation unit has no name, then the first class is returned.

The term "primary class" is not actually used in any reference I tried: JLS, JPL, or Effective Java. It does see some usage on the web. The term "main class" could be confused with the run-time class whose "main(...)" method is being run.

Returns:
The primary class defined by this source file. Null if none.

clearAllProperties

void clearAllProperties(java.lang.String key)
Traverses the entire parse tree, calling setProperty(key, null) on each element.

getFactory

TreeFactory getFactory()
Gets the factory to create Tree objects in this FileT.
Returns:
The factory used to create Tree objects in this FileT.

getURI

java.net.URI getURI()
Gets the URI of this file, null if none.
Returns:
The URI of this file, null if none.

getOwningModel

JavaModel getOwningModel()
Gets the owning JavaModel.
Returns:
The owning JavaModel.

beginTransaction

TreeTransaction beginTransaction()
Begins a single-tree transaction.
Returns:
The transaction object.

getTransaction

TreeTransaction getTransaction()
Gets the in-progress single-tree transaction, null if none.
Returns:
The in-progress single-tree transaction, null if none.

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.5.0)

E13403-06


Copyright © 1997, 2011, Oracle. All rights reserved.