Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.3.0)

E17493-04


oracle.jdeveloper.java.locator
Class DirURLClassLocator

java.lang.Object
  extended by oracle.jdeveloper.java.locator.BaseClassLocator
      extended by oracle.jdeveloper.java.locator.URLClassLocator
          extended by oracle.jdeveloper.java.locator.DirURLClassLocator

All Implemented Interfaces:
JavaClassLocator, JavaClassLocator2, JavaResourceLocator

public class DirURLClassLocator
extends URLClassLocator

The DirURLClassLocator is an implementation of the URL-based ClassLocator which deals with root URLs that are not Jar URLs.


Field Summary

 

Fields inherited from class oracle.jdeveloper.java.locator.URLClassLocator
_fileType, _rootURL, CLASS_SUFFIXES, CLASS_TYPE, SOURCE_SUFFIXES, SOURCE_TYPE

 

Fields inherited from class oracle.jdeveloper.java.locator.BaseClassLocator
EMPTY_COLLECTION, EMPTY_LOCATOR, EMPTY_STRING_ARRAY

 

Constructor Summary
protected DirURLClassLocator(java.net.URL dirURL, int classType)
          Constructs a new DirURLClassLocator.

 

Method Summary
 void buildIndex()
          Instructs this class locator to start building its index for locating files.
 void buildIndexInterruptibly()
          Instructs this class locator to start building its index for locating files.
 void getAllClasses(java.util.Collection<java.lang.String> out, ClassNameFilter filter)
          Fetch all of the top-level classes that are known by this locator.
 void getAllClassesInterruptibly(java.util.Collection<java.lang.String> out, ClassNameFilter filter)
          Get all of the top-level classes that are known by this locator.
 void getAllPackages(java.util.Collection<java.lang.String> out, PackageNameFilter filter)
          Fetch all of the full packges that are known by this locator.
 void getClassesInPackage(java.lang.String packagePrefix, java.util.Collection<java.lang.String> out)
          Fetch the list of top-level classes within the given package, adding them to the out collection provided.
 void getPackages(java.lang.String packagePrefix, java.util.Collection<java.lang.String> 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.
 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.URLClassLocator
getClassURL, getFileType, getRootURL, getSourceURL, isClassTypeLocator, isMatchingFileType, isMatchingFileType, isSourceTypeLocator

 

Methods inherited from class oracle.jdeveloper.java.locator.BaseClassLocator
addToCollection, buildFQName, checkInterrupt, ensureValid, getAllClasses, getAllClasses, getAllClassesInterruptibly, getAllClassesInterruptibly, getAllPackages, getAllPackages, getAllPackagesInterruptibly, getAllPackagesInterruptibly, getAllPackagesInterruptibly, getClassesByName, getClassesByNameInterruptibly, getClassesByPrefix, getClassesByPrefixInterruptibly, getClassesInPackage, getClassesInPackageInterruptibly, getClassesInPackageInterruptibly, getClassURLInterruptibly, getNameCascades, getNameParts, getPackages, getPackagesInterruptibly, getPackagesInterruptibly, getResourceURLs, getSourceURLInterruptibly, getStringArray, getURLInterruptibly

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

DirURLClassLocator

protected DirURLClassLocator(java.net.URL dirURL,
                             int classType)
Constructs a new DirURLClassLocator.
Parameters:
dirURL - the root URL we are working with
classType - the file type, either CLASS_TYPE or SOURCE_TYPE

Method Detail

buildIndex

public void buildIndex()
Instructs this class locator to start building its index for locating files.

buildIndexInterruptibly

public void buildIndexInterruptibly()
                             throws java.lang.InterruptedException
Description copied from interface: JavaClassLocator2
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.
Specified by:
buildIndexInterruptibly in interface JavaClassLocator2
Overrides:
buildIndexInterruptibly in class BaseClassLocator
Throws:
java.lang.InterruptedException - if the build is interrupted

getPackages

public void getPackages(java.lang.String packagePrefix,
                        java.util.Collection<java.lang.String> 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

public void getClassesInPackage(java.lang.String packagePrefix,
                                java.util.Collection<java.lang.String> 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

public void getAllClasses(java.util.Collection<java.lang.String> 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:
filter - the class name filter to use
out - the collection to add the fully-qualified class names

getAllClassesInterruptibly

public void getAllClassesInterruptibly(java.util.Collection<java.lang.String> out,
                                       ClassNameFilter filter)
                                throws java.lang.InterruptedException
Description copied from class: BaseClassLocator
Get all of the top-level classes that are known by this locator. This can be overridden by subclasses that provide support for interruption.
Overrides:
getAllClassesInterruptibly in class BaseClassLocator
Parameters:
out - the collection where fully qualified class names are added
filter - the class name filter to use
Throws:
java.lang.InterruptedException - if the operation is interrupted

getAllPackages

public void getAllPackages(java.util.Collection<java.lang.String> 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 package 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.Map.Entry.
Returns:
the URL for the JavaFile containing the given class

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

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.3.0)

E17493-04


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