|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1) E13403-04 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.jdeveloper.java.JavaModel oracle.jdeveloper.java.JavaManager
public class JavaManager
A JavaManager
is an implementation of the
JavaFileProvider
interface. It provides structured access
to the contents of Java class and source files visible through
a Project
or through a set of source and classpaths.
There is also access to a JavaClassLocator
instance for
searching for the classes and subpackages contained in a package,
and for finding an URL associated with a Java source or class file.
By default, the JavaFile and JavaClass (as well as SourceFile and
SourceClass) instances retrieved through this API saved in a cache.
Clients are encouraged to use the provided CacheSupport
API
to provide indication as to when the cache is used, and when it
is no longer in use (and can be flushed). Clients can also force
a cache flush to occur.
Nested Class Summary | |
---|---|
protected class |
JavaManager.TransactionCommand
A Command implementation that wraps a committed
transaction. |
Nested classes/interfaces inherited from class oracle.jdeveloper.java.JavaModel |
---|
JavaModel.CacheTracker |
Field Summary | |
---|---|
protected Project |
_project
The project associated with this JavaManager (if it is project based and not URL based.) |
Fields inherited from class oracle.jdeveloper.java.JavaModel |
---|
_cacheSupport, _classLocator, _fileProvider |
Constructor Summary | |
---|---|
protected |
JavaManager(CachedFileProvider provider)
Protected constructor purposely. |
Method Summary | |
---|---|
SourceTransaction |
beginTransaction(SourceFile sourceFile)
Starts a transaction on the given sourceFile. |
boolean |
commitTransaction(SourceTransaction openTransaction)
Commit the specified open transaction. |
boolean |
commitTransaction(SourceTransaction openTransaction,
java.lang.String undoText)
Commit the specified open transaction. |
boolean |
commitTransaction(SourceTransaction openTransaction,
TransactionDescriptor txnDescriptor)
Commit the specified open transaction. |
boolean |
commitTransactionNoUndo(SourceTransaction openTransaction)
Commit the specified open transaction. |
static JavaManager |
getAnyInstance(Project project)
Fetch a JavaManager instance in a fail-safe manner. |
static JavaManager |
getAnyJavaManager(Project project)
Fetch a JavaManager instance in a fail-safe manner. |
static Project |
getDefiningProject(Context context,
java.net.URL url)
Finds the project that defines the specified URL. The method searches the currentProject , the jdk libraries, the project's libraries, it will repeat
the same search for the upstream dependencies and if it still not found, it will search all the other projects
in the workspace. |
static java.util.List<Project> |
getDependencies(Project project)
|
static JavaManager |
getInstance(Project project)
Fetch a JavaManager instance for the given project. |
static JavaManager |
getInstance(URLPath sourcePath,
URLPath classPath)
Fetch a JavaManager instance for the given source and class paths. |
static JavaManager |
getJavaManager(Project project)
Fetch a JavaManager instance for the given project. |
static JavaManager |
getJavaManager(URLPath sourcePath,
URLPath classPath)
Fetch a JavaManager instance for the given source and class paths. |
static boolean |
isDefinedIn(Project project,
java.net.URL url)
|
Methods inherited from class oracle.jdeveloper.java.JavaModel |
---|
createSourceFile, finalize, getArrayType, getCacheSupport, getClass, getClass, getClassByVMName, getClassLoader, getClassLoader, getFile, getJavaClassLocator, getPackage, getSourceClass, getSourceFile, getSourceFile, getTextBuffer |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Project _project
Constructor Detail |
---|
protected JavaManager(CachedFileProvider provider)
provider
- the provider that we wrapMethod Detail |
---|
public static JavaManager getInstance(Project project)
project
- the project to use for locating Java source and
class files
java.lang.NullPointerException
- if project is nullpublic static JavaManager getInstance(URLPath sourcePath, URLPath classPath)
sourcePath
- the source path to use for locating Java
source filesclassPath
- the class path to use for locating Java
class files
public static JavaManager getAnyInstance(Project project)
project
- the project to use, which can be null
public static JavaManager getJavaManager(Project project)
project
- the project to use for locating Java source and
class files
java.lang.NullPointerException
- if project is nullpublic static JavaManager getJavaManager(URLPath sourcePath, URLPath classPath)
sourcePath
- the source path to use for locating Java
source filesclassPath
- the class path to use for locating Java
class files
public static JavaManager getAnyJavaManager(Project project)
project
- the project to use, which can be null
public SourceTransaction beginTransaction(SourceFile sourceFile)
JavaManager
will have
IDE integration, such as undo registration and notifications.
sourceFile
- the source file to start a transaction on
public boolean commitTransaction(SourceTransaction openTransaction)
openTransaction
- the source transaction that is to be committed
java.lang.NullPointerException
- if the openTransaction is nullpublic boolean commitTransaction(SourceTransaction openTransaction, java.lang.String undoText)
openTransaction
- the source transaction that is to be committedundoText
- the (translateable) undo text to use for undo
java.lang.NullPointerException
- if the openTransaction is nullpublic boolean commitTransactionNoUndo(SourceTransaction openTransaction)
openTransaction
- the source transaction that is to be committed
java.lang.NullPointerException
- if the openTransaction is nullpublic boolean commitTransaction(SourceTransaction openTransaction, TransactionDescriptor txnDescriptor)
The txnDescriptor is required, and provides additional information
describing the transaction, such as a human-readable (translated) edit
name to use for "Edit->Undo
TransactionDescriptor
for more details.
openTransaction
- the source transaction that is to be committedtxnDescriptor
- the descriptor describing the transaction that
is being committed
java.lang.NullPointerException
- if the openTransaction is null
public static Project getDefiningProject(Context context, java.net.URL url)
currentProject
, the jdk libraries, the project's libraries, it will repeat
the same search for the upstream dependencies and if it still not found, it will search all the other projects
in the workspace.
url
- The url to find can be a source file, a class file or even a resource
public static java.util.List<Project> getDependencies(Project project)
public static boolean isDefinedIn(Project project, java.net.URL url)
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1) E13403-04 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |