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

E13403-02

oracle.jdeveloper.java.locator
Class PathClassLocator

java.lang.Object
  extended by oracle.jdeveloper.java.locator.BaseClassLocator
      extended by oracle.jdeveloper.java.locator.PathClassLocator
All Implemented Interfaces:
JavaClassLocator, JavaResourceLocator
Direct Known Subclasses:
JdevPathClassLocator

public class PathClassLocator
extends BaseClassLocator

The PathClassLocator is an implementation of the JavaClassLocator to locate classes for based on an URLPaths for both the source and class paths


Field Summary
 
Fields inherited from class oracle.jdeveloper.java.locator.BaseClassLocator
EMPTY_COLLECTION, EMPTY_LOCATOR, EMPTY_STRING_ARRAY
 
Constructor Summary
protected PathClassLocator(URLPath sourcePath, URLPath classPath)
          Constructs a new PathClassLocator for the given source and class paths.
 
Method Summary
 void buildIndex()
          Instructs this class locator to start building its index for locating files.
protected  void getAllClasses(java.util.Collection out, ClassNameFilter filter)
          Fetch all of the top-level classes that are known by this locator.
protected  void getAllPackages(java.util.Collection out, PackageNameFilter filter)
          Fetch all of the full packges that are known by this locator.
protected  void getClassesInPackage(java.lang.String packagePrefix, java.util.Collection out)
          Fetch the list of top-level classes within the given package, adding them to the out collection provided.
protected  long getClassTimestamp(java.net.URL classURL)
          Gets the timestamp for the given class file url.
 java.net.URL getClassURL(java.lang.String fqClassName)
          Fetch the URL for the JavaFile for the given fully-qualified Java class name.
protected  void getPackages(java.lang.String packagePrefix, java.util.Collection out)
          Fetch the list of subpackages within the given package, adding them to the out collection provided.
 java.net.URL getResourceURL(java.lang.String resourceName)
          Fetch the URL for the Java resource file given the resource name.
protected  long getSourceTimestamp(java.net.URL sourceURL)
          Gets the timestamp for the given source file url.
 java.net.URL getSourceURL(java.lang.String fqClassName)
          Fetch the URL for the SourceFile for the given fully-qualified Java class name.
 java.net.URL getURL(java.lang.String fqClassName)
          Fetch the URL for the JavaFile for the given fully-qualified Java class name.
 
Methods inherited from class oracle.jdeveloper.java.locator.BaseClassLocator
addToCollection, buildFQName, ensureValid, getAllClasses, getAllClasses, getAllPackages, getAllPackages, getClassesByName, getClassesByPrefix, getClassesInPackage, getNameCascades, getNameParts, getPackages, getResourceURLs, getStringArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PathClassLocator

protected PathClassLocator(URLPath sourcePath,
                           URLPath classPath)
Constructs a new PathClassLocator for the given source and class paths.

Parameters:
sourcePath - the source path to use
classPath - the class path to use
Method Detail

buildIndex

public void buildIndex()
Instructs this class locator to start building its index for locating files. This method runs on the current thread and blocks until the index build is completed. To build the index in the background, call this method on a background thread.


getPackages

protected void getPackages(java.lang.String packagePrefix,
                           java.util.Collection out)
Fetch the list of subpackages within the given package, adding them to the out collection provided.

Specified by:
getPackages in class BaseClassLocator
Parameters:
packagePrefix - the package prefix, i.e., "java.io"
out - the collection to add the packages

getClassesInPackage

protected void getClassesInPackage(java.lang.String packagePrefix,
                                   java.util.Collection out)
Fetch the list of top-level classes within the given package, adding them to the out collection provided.

Specified by:
getClassesInPackage in class BaseClassLocator
Parameters:
packagePrefix - the package prefix, i.e., "java.io"
out - the collection to add the class names

getAllClasses

protected void getAllClasses(java.util.Collection out,
                             ClassNameFilter filter)
Fetch all of the top-level classes that are known by this locator. This will return fully-qualified class names, such as "java.util.List".

Specified by:
getAllClasses in class BaseClassLocator
Parameters:
out - the collection to add the fully-qualified class names
filter - the class name filter to use

getAllPackages

protected void getAllPackages(java.util.Collection out,
                              PackageNameFilter filter)
Fetch all of the full packges that are known by this locator. This will return fully-qualified package names, such as "java.util" or "java.io". This collection will not include the top-level package "".

Specified by:
getAllPackages in class BaseClassLocator
Parameters:
out - the collection to add the full package names
filter - the pckage name filter to use

getURL

public java.net.URL getURL(java.lang.String fqClassName)
Fetch the URL for the JavaFile for the given fully-qualified Java class name. The implementation may choose either a class URL or source URL. For example, an implementation may decide to return the URL that is more up-to-date, or an URL that would be faster to load. Note that if the given class is an inner class, this routine may return the URL for the Java source that contains the owning outer class.

Parameters:
fqClassName - the fully-qualified class name in dotted notation, i.e., java.util.List
Returns:
the URL for the JavaFile containing the given class

getSourceURL

public java.net.URL getSourceURL(java.lang.String fqClassName)
Fetch the URL for the SourceFile for the given fully-qualified Java class name. This may return null if a source URL is not available for the given fully-qualified class name.

Parameters:
fqClassName - the fully-qualified class name in dotted notation

getClassURL

public java.net.URL getClassURL(java.lang.String fqClassName)
Fetch the URL for the JavaFile for the given fully-qualified Java class name. This may return null if a given class URL is not available for the given fully-qualified class name.

Parameters:
fqClassName - the fully-qualified class name in dotted notation
Returns:
the Java *.class URL, or null if it is not found

getResourceURL

public java.net.URL getResourceURL(java.lang.String resourceName)
Fetch the URL for the Java resource file given the resource name. This should include the full path of the resource, minus any root directory that is part of the class path.

Parameters:
resourceName - the full name of the resource including any file extensions
Returns:
the Java resource URL, or null if it is not found

getClassTimestamp

protected long getClassTimestamp(java.net.URL classURL)
Gets the timestamp for the given class file url.


getSourceTimestamp

protected long getSourceTimestamp(java.net.URL sourceURL)
Gets the timestamp for the given source file url.


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

E13403-02

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