Extension SDK

oracle.jdeveloper.jot
Class JotManager

java.lang.Object
  extended byoracle.jdeveloper.jot.JotManager
All Implemented Interfaces:
JotElement, JotWorkArea, Subject

public abstract class JotManager
extends java.lang.Object
implements JotWorkArea, Subject

Named JotManager for historical reasons, this class represents an abstract extension of the JotWorkArea interface. A JotManager exists for each leaf project in the application. It always has a parent, and never contains any additional JotWorkAreas.

The JotManager class provides an entrypoint in the JOT subsystem. Each JotManager instance is associated with a Project; this Project's classpath and sourcepath are used to determine the classes available to JOT clients.

JOT can located classes and files in three locations: the project's sourcepath, the project's classpath, and the system classpath. In general, clients should only use the project's paths; the system classpath should only be used in exceptional cases. JOT supports both normal Java source files (.java files) and sources files containing embedded SQLJ commands (.sqlj files). Normal sourcepath searches will look for both (with SQLJ files getting the priority); however, clients can specify one or the other to look for exclusively.

Since:
5.0
See Also:
JProject

Field Summary
static int CHECK_SOURCE_FIRST
          Flag modifying a request to give sources precedence over class files.
static java.lang.String CLASS_EXT
          The file extension for compiled class files.
static int CLASS_TYPE
          ID corresponding to a class file.
static int CLASSPATH_CHANGED
          UpdateMessage ID indicating that a change in the classpath has occurred.
static int CLASSPATH_CONTENTS_CHANGED
          UpdateMessage ID indicating that the contents of the classpath have changed as might occur after a compile has taken place.
static int EXCLUDE_OUTPUT_DIRECTORY
          Flag indicating that the project's output directory should be excluded from the search path when looking for compiled classes.
static int FILE_PARSE_FAILED
          UpdateMessage ID indicating that a parse of a JotFile failed and the model is not available.
static int FILE_STRUCTURE_CHANGED
          UpdateMessage ID indicating that the structure of a JotFile has changed.
static int FULL_SOURCE_PATH
          Flag indicating that the entire source path (and not just the project's explicit source path) should be used when finding or listing classes.
static java.lang.String JAVA_SOURCE_EXT
          The file extension for java source files.
static int JAVA_SOURCE_TYPE
          ID corresponding to a Java source file.
static int NEED_ANY
          Deprecated. use PREFER_SOURCE or PREFER_CLASS
static int NEED_ANY_CLASS
          Flag indicating that a class from either the project classpath or the system classpath is required.
static int NEED_CLASS
          Flag indicating that classes from the classpath are required.
static int NEED_JAVA_SOURCE
          Flag indicating that java sources from the full sourcepath are required.
static int NEED_PROJECT_SOURCE
          Flag indicating that only sources from the Project Source Path should be checked.
static int NEED_SOURCE
          Flag indicating that sources from the sourcepath are required.
static int NEED_SQLJ_SOURCE
          Flag indicating that sqlj sources from the full sourcepath are required.
static int NEED_SYSTEM_CLASS
          Flag indicating that a class from the system classpath is required.
static int PREFER_CLASS
          Flag indicating that either a class file or a source file is acceptable, but classes are prefered.
static int PREFER_SOURCE
          Flag indicating that either a class file or a source file is acceptable, but sources are prefered.
static int SOURCEPATH_CHANGED
          UpdateMessage ID indicating that a change in the sourcepath has occurred.
static int SOURCEPATH_CONTENTS_CHANGED
          UpdateMessage ID indicating that the contents of the sourcepath have changed as might occur when a file has been added to the sourcepath.
static java.lang.String SQLJ_SOURCE_EXT
          The file extension for sqlj source files.
static int SQLJ_SOURCE_TYPE
          ID corresponding to a SQLJ source file
static int SYSTEM_CLASS_TYPE
          ID corresponding to a class on the system classpath.
 
Fields inherited from interface oracle.ide.addin.Subject
OBJECT_MODIFIED
 
Constructor Summary
protected JotManager()
           
 
Method Summary
static java.util.List buildClassAndInterfaceList(JotClass cls)
          Builds a list of all the superclasses and superinterfaces of a specified class.
static java.util.Set buildInterfaceList(JotClass cls)
          Builds a list of all the interfaces implemented by a class or extended by an interface.
protected  void close()
           
protected abstract  void closeImpl()
           
static java.lang.String extFromType(int type)
          Converts a type value to an extension string.
abstract  JotClass getClass(JotFile importContext, java.lang.String className, int needs)
          Retrieves the JOT representation of a specific class, using the import context of a given file.
static JotManager getJotManager(JProject prj)
          Obtains the JotManager instance associated with a specific Project.
abstract  JProject getProject()
          Gets the JProject to which this instance is associated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.jdeveloper.jot.JotWorkArea
addChild, addLibrary, getClass, getClassList, getClassLoader, getClassNameList, getFile, getFile, getFileList, getJotTypeInfo, getLibraryByName, getPackage, getPackageList, getPackages, getType, getURL, getURL, loadClass, removeChild, removeLibrary, removeLibraryByName, setLibraryList
 
Methods inherited from interface oracle.jdeveloper.jot.JotElement
getElementName, getElementType, getEndOffset, getID, getJotWorkArea, getParent, getStartOffset, isExistent, isReadOnly, isStructureKnown, setParent
 
Methods inherited from interface oracle.ide.addin.Subject
attach, detach, notifyObservers
 

Field Detail

CLASS_EXT

public static final java.lang.String CLASS_EXT
The file extension for compiled class files.

See Also:
Constant Field Values

JAVA_SOURCE_EXT

public static final java.lang.String JAVA_SOURCE_EXT
The file extension for java source files.

See Also:
Constant Field Values

SQLJ_SOURCE_EXT

public static final java.lang.String SQLJ_SOURCE_EXT
The file extension for sqlj source files.

See Also:
Constant Field Values

CLASS_TYPE

public static final int CLASS_TYPE
ID corresponding to a class file.

See Also:
Constant Field Values

JAVA_SOURCE_TYPE

public static final int JAVA_SOURCE_TYPE
ID corresponding to a Java source file.

See Also:
Constant Field Values

SQLJ_SOURCE_TYPE

public static final int SQLJ_SOURCE_TYPE
ID corresponding to a SQLJ source file

See Also:
Constant Field Values

SYSTEM_CLASS_TYPE

public static final int SYSTEM_CLASS_TYPE
ID corresponding to a class on the system classpath.

See Also:
Constant Field Values

CHECK_SOURCE_FIRST

public static final int CHECK_SOURCE_FIRST
Flag modifying a request to give sources precedence over class files. In the absence of the SOURCE_FIRST flag, class files take priority over sources. NOTE: this flag is meaningful only when combined with NEED_CLASS and one or more of NEED_JAVA_SOURCE, NEED_SQLJ_SOURCE, or NEED_SOURCE.

See Also:
PREFER_SOURCE, PREFER_CLASS, Constant Field Values

FULL_SOURCE_PATH

public static final int FULL_SOURCE_PATH
Flag indicating that the entire source path (and not just the project's explicit source path) should be used when finding or listing classes. By default, this flag is not set when classes and sources are requested. If only sources are requested, this flag is assumed to be set.

See Also:
Constant Field Values

EXCLUDE_OUTPUT_DIRECTORY

public static final int EXCLUDE_OUTPUT_DIRECTORY
Flag indicating that the project's output directory should be excluded from the search path when looking for compiled classes.

See Also:
Constant Field Values

NEED_CLASS

public static final int NEED_CLASS
Flag indicating that classes from the classpath are required.

See Also:
Constant Field Values

NEED_JAVA_SOURCE

public static final int NEED_JAVA_SOURCE
Flag indicating that java sources from the full sourcepath are required.

See Also:
Constant Field Values

NEED_SQLJ_SOURCE

public static final int NEED_SQLJ_SOURCE
Flag indicating that sqlj sources from the full sourcepath are required.

See Also:
Constant Field Values

NEED_SOURCE

public static final int NEED_SOURCE
Flag indicating that sources from the sourcepath are required. NEED_SOURCE is a combination of NEED_JAVA_SOURCE and NEED_SQLJ_SOURCE.

See Also:
Constant Field Values

NEED_PROJECT_SOURCE

public static final int NEED_PROJECT_SOURCE
Flag indicating that only sources from the Project Source Path should be checked. Library and J2SE sources should be skipped.

See Also:
Constant Field Values

PREFER_SOURCE

public static final int PREFER_SOURCE
Flag indicating that either a class file or a source file is acceptable, but sources are prefered.

See Also:
Constant Field Values

PREFER_CLASS

public static final int PREFER_CLASS
Flag indicating that either a class file or a source file is acceptable, but classes are prefered.

See Also:
Constant Field Values

NEED_SYSTEM_CLASS

public static final int NEED_SYSTEM_CLASS
Flag indicating that a class from the system classpath is required. Use this flag with caution; classes found on the system classpath may not match classes found on the project classpath, resulting in inconsistencies between designtime and runtime.

See Also:
Constant Field Values

NEED_ANY_CLASS

public static final int NEED_ANY_CLASS
Flag indicating that a class from either the project classpath or the system classpath is required. Note that the system classpath will only be searched if the requested class cannot be found on the project's classpath. NEED_ANY_CLASS is a combination of NEED_CLASS and NEED_SYSTEM_CLASS.

See Also:
Constant Field Values

NEED_ANY

public static final int NEED_ANY
Deprecated. use PREFER_SOURCE or PREFER_CLASS

Flag indicating sources and classes from the project's sourcepath and classpath are required.

See Also:
PREFER_SOURCE, PREFER_CLASS, Constant Field Values

FILE_STRUCTURE_CHANGED

public static final int FILE_STRUCTURE_CHANGED
UpdateMessage ID indicating that the structure of a JotFile has changed.

See Also:
UpdateMessage, Subject

FILE_PARSE_FAILED

public static final int FILE_PARSE_FAILED
UpdateMessage ID indicating that a parse of a JotFile failed and the model is not available.

See Also:
UpdateMessage, Subject

CLASSPATH_CHANGED

public static final int CLASSPATH_CHANGED
UpdateMessage ID indicating that a change in the classpath has occurred.

See Also:
UpdateMessage, Subject

SOURCEPATH_CHANGED

public static final int SOURCEPATH_CHANGED
UpdateMessage ID indicating that a change in the sourcepath has occurred.

See Also:
UpdateMessage, Subject

SOURCEPATH_CONTENTS_CHANGED

public static final int SOURCEPATH_CONTENTS_CHANGED
UpdateMessage ID indicating that the contents of the sourcepath have changed as might occur when a file has been added to the sourcepath.

See Also:
UpdateMessage, Subject

CLASSPATH_CONTENTS_CHANGED

public static final int CLASSPATH_CONTENTS_CHANGED
UpdateMessage ID indicating that the contents of the classpath have changed as might occur after a compile has taken place.

See Also:
UpdateMessage, Subject
Constructor Detail

JotManager

protected JotManager()
Method Detail

getJotManager

public static JotManager getJotManager(JProject prj)
Obtains the JotManager instance associated with a specific Project. JProject objects.

Parameters:
prj - the JProject object
Returns:
the JotManager associated with the JProjectConfiguration

getClass

public abstract JotClass getClass(JotFile importContext,
                                  java.lang.String className,
                                  int needs)
Retrieves the JOT representation of a specific class, using the import context of a given file. If the requested classname is not a fully qualified classname, the package and imports of the JotFile are used to determine the correct classname.

Parameters:
importContext - a JotFile containing import statements to use in resolving an unqualified classname
className - the name of the class.
needs - whether to retrieve the compiled or source version of the class
Returns:
a JotClass representing the JOT model of the class, or null if the class cannot be found in the required version.
See Also:
PREFER_SOURCE, PREFER_CLASS, NEED_SOURCE, NEED_CLASS

getProject

public abstract JProject getProject()
Gets the JProject to which this instance is associated.

Returns:
the JProject to which this instance is associated.

buildInterfaceList

public static java.util.Set buildInterfaceList(JotClass cls)
Builds a list of all the interfaces implemented by a class or extended by an interface.

Returns:
a Set containing the names of all the interfaces implemented by the specified class.

buildClassAndInterfaceList

public static java.util.List buildClassAndInterfaceList(JotClass cls)
Builds a list of all the superclasses and superinterfaces of a specified class.

Returns:
a List containing JotClass objects representing the superclasses and superinterfaces of the specified class.

extFromType

public static final java.lang.String extFromType(int type)
Converts a type value to an extension string.

Parameters:
type - the type of file.
Returns:
the extension of the file.
See Also:
CLASS_TYPE, JAVA_SOURCE_TYPE, SQLJ_SOURCE_TYPE

close

protected final void close()

closeImpl

protected abstract void closeImpl()

Extension SDK

 

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