Extension SDK

oracle.jdeveloper.jot
Interface JotWorkArea

All Superinterfaces:
JotElement
All Known Subinterfaces:
JotModel
All Known Implementing Classes:
JotManager

public interface JotWorkArea
extends JotElement

The JotWorkArea represents a group of compilation units, and/or sub-JotWorkAreas. It contains retrieval methods that operate within this work area's classpath or sourcepath scope. Work areas are parents of elements the contain.Work areas can be obtained by calling Jot.getWorkArea(String name).

This interface is not intended to be implemented by clients.


Method Summary
 void addChild(JotElement childElement)
          Adds the given JotElement as a child of this model.
 void addLibrary(JotLibrary library)
           
 JotClass getClass(java.lang.String className, int needs)
          Retrieves the JotClass for a specific class.
 java.util.Iterator getClassList(java.lang.String pkgName, int needs)
          Retrieves a list of classes available in a package
 java.lang.ClassLoader getClassLoader()
          Retrieves the ClassLoader associated with this JotWorkArea.
 java.util.Iterator getClassNameList(java.lang.String pkgName, int needs)
          Retrieves a list of classes available in a package
 JotFile getFile(java.lang.String filename)
          Retrieves the JotFile representing a specific file.
 JotFile getFile(java.net.URL url)
          Retrieves the JotFile representing a file located at a specific URL.
 java.util.Iterator getFileList(java.lang.String pkgName, int needs)
          Retrieves a list of classes available in a package
 JotTypeInfo getJotTypeInfo(java.lang.String className, int needs)
          Returns a JotTypeInfo instance for the given classname.
 JotLibrary getLibraryByName(java.lang.String libraryName)
           
 java.lang.String getPackage(JotFile importContext, java.lang.String className)
          Retrieves a string representation of apackage containing a given class, based on a specific import context.
 java.util.Iterator getPackageList(int needs)
          Retrieves a list of packages available under the configuration associated with this JotManager instance.
 java.util.Iterator getPackages(java.lang.String base, int needs)
          Retrieves a list of strings representing sub-packages located under a specific package.
 JotType getType(java.lang.String classname)
          Retrieves the JotType for a class.
 java.net.URL getURL(java.lang.String clsName, int needs)
          Retrieves the URL of the file containing the desired class.
 java.net.URL getURL(java.lang.String fileName, java.lang.String pkgName, int needs)
          Retrieves the URL of a specified file.
 java.lang.Class loadClass(java.lang.String className, boolean resolve)
          Loads a class from the JotWorkArea's classpath
 void removeChild(JotElement childElement)
          Removes the given JotElement from the list of children in this model.
 void removeLibrary(JotLibrary library)
           
 void removeLibraryByName(java.lang.String libraryName)
           
 void setLibraryList(JotLibrary[] libraryList)
           
 
Methods inherited from interface oracle.jdeveloper.jot.JotElement
getElementName, getElementType, getEndOffset, getID, getJotWorkArea, getParent, getStartOffset, isExistent, isReadOnly, isStructureKnown, setParent
 

Method Detail

loadClass

public java.lang.Class loadClass(java.lang.String className,
                                 boolean resolve)
                          throws java.lang.ClassNotFoundException
Loads a class from the JotWorkArea's classpath

Parameters:
resolve - whether to resolve the class once it is loaded.
Returns:
the java.lang.Class instance representing the class, or null if the class cannot be loaded.
Throws:
java.lang.ClassNotFoundException - if the class cannot be loaded.

getClass

public JotClass getClass(java.lang.String className,
                         int needs)
Retrieves the JotClass for a specific class.

Parameters:
className - the fully qualified name of the class.
needs - whether to retrieve the compiled or source version of the class
Returns:
a JotClass representing the 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

getFile

public JotFile getFile(java.lang.String filename)
Retrieves the JotFile representing a specific file.

Parameters:
filename - the absolute path to the desired file.
Returns:
a JotFile representing the given file.

getFile

public JotFile getFile(java.net.URL url)
Retrieves the JotFile representing a file located at a specific URL.

Parameters:
url - the URL indicating the location of the file.
Returns:
a JotFile representing the given location.

getURL

public java.net.URL getURL(java.lang.String clsName,
                           int needs)
Retrieves the URL of the file containing the desired class.

Parameters:
clsName - the fully qualified class name.
needs - a description of what type of files to find - sources or class files.
Returns:
an URL representing the file containing the class, or null if it could not be found.

getURL

public java.net.URL getURL(java.lang.String fileName,
                           java.lang.String pkgName,
                           int needs)
Retrieves the URL of a specified file.

Parameters:
fileName - the name of the file (for example, Class1.java).
pkgName - the name of the package containing the file.
needs - whether to check the sourcepath or the classpath.
Returns:
an URL representing the file, or null if the file cannot be found.

getPackage

public java.lang.String getPackage(JotFile importContext,
                                   java.lang.String className)
Retrieves a string representation of apackage containing a given class, based on a specific import context.

Parameters:
importContext - a JotFile to use for resolving the classname.
className - to name of the class to locate.
Returns:
the name of the package containing the class, or null if no matching package is found.

getPackageList

public java.util.Iterator getPackageList(int needs)
Retrieves a list of packages available under the configuration associated with this JotManager instance.

Parameters:
needs - the type of packages to list: sourcepath packages, classpath packages, or both.
Returns:
an Iterator over the list of packages. Each package is returned as a String.
See Also:
#NEED_SOURCE, #NEED_CLASS

getPackages

public java.util.Iterator getPackages(java.lang.String base,
                                      int needs)
Retrieves a list of strings representing sub-packages located under a specific package. Only the packages directly under the package is returned.

Parameters:
base - the package base (for example, java).
needs - the type of packages to list.
Returns:
an Iterator over the list of sub-packages. Each package is returned as a String. For example, calling getPackages for java would return java.applet, java.awt, etc. in the iterator.

getClassList

public java.util.Iterator getClassList(java.lang.String pkgName,
                                       int needs)
Retrieves a list of classes available in a package

Parameters:
pkgName - the name of the package for which classes are requested.
needs - the type of classes to list: sourcepath classes, classpath classes, or both.
Returns:
an Iterator over the list of classes. Each class is returned as a JotClass instance
See Also:
#NEED_ANY, #NEED_SOURCE, #NEED_CLASS

getClassNameList

public java.util.Iterator getClassNameList(java.lang.String pkgName,
                                           int needs)
Retrieves a list of classes available in a package

Parameters:
pkgName - the name of the package for which classes are requested.
needs - the type of classes to list: sourcepath classes, classpath classes, or both.
Returns:
an Iterator over the list of classes. Each class name is returned as a String
See Also:
#NEED_ANY, #NEED_SOURCE, #NEED_CLASS

getFileList

public java.util.Iterator getFileList(java.lang.String pkgName,
                                      int needs)
Retrieves a list of classes available in a package

Parameters:
pkgName - the name of the package for which files are requested.
needs - the type of classes to list: sourcepath classes, classpath classes, or both.
Returns:
an Iterator over the list of files. Each file is returned as an URL.
See Also:
#PREFER_SOURCE, #PREFER_CLASS, #NEED_SOURCE, #NEED_CLASS

getClassLoader

public java.lang.ClassLoader getClassLoader()
Retrieves the ClassLoader associated with this JotWorkArea.

Returns:
a ClassLoader that can be used to load classes based on the configuration associated with this JotManager.

getType

public JotType getType(java.lang.String classname)
Retrieves the JotType for a class.

Parameters:
classname - the name of the class
Returns:
a JotType object representing the type.

addChild

public void addChild(JotElement childElement)
Adds the given JotElement as a child of this model.


getJotTypeInfo

public JotTypeInfo getJotTypeInfo(java.lang.String className,
                                  int needs)
Returns a JotTypeInfo instance for the given classname. A JotTypeInfo contains a JotType and accessors to allow the holder to determine if the class referenced by the JotType is an interface, and determine its public/private modifiers.

This interface exists as an alternate to getClass() for callers that are only interested in those specific attributes.

Returns:
a JotTypeInfo instance for the given classname.

removeChild

public void removeChild(JotElement childElement)
Removes the given JotElement from the list of children in this model.


setLibraryList

public void setLibraryList(JotLibrary[] libraryList)

getLibraryByName

public JotLibrary getLibraryByName(java.lang.String libraryName)

addLibrary

public void addLibrary(JotLibrary library)

removeLibrary

public void removeLibrary(JotLibrary library)

removeLibraryByName

public void removeLibraryByName(java.lang.String libraryName)

Extension SDK

 

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