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

E13403-07

oracle.jdeveloper.java.provider
Class LocatorWrapper

java.lang.Object
  extended by oracle.jdeveloper.java.provider.LocatorWrapper
All Implemented Interfaces:
JavaClassLocator, JavaClassLocator2, JavaResourceLocator

public class LocatorWrapper
extends java.lang.Object
implements JavaClassLocator2, JavaResourceLocator

The LocatorWrapper is a JavaClassLocator implementation that simply wraps a BaseFileProvider instance.


Constructor Summary
LocatorWrapper(BaseFileProvider provider)
          Construct a JavaClassLocator wrapper for the given provider.
 
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.
 java.util.Collection<java.lang.String> getAllClasses()
          Fetch all of the top-level classes that are known by this locator.
 java.util.Collection<java.lang.String> getAllClasses(ClassNameFilter filter)
          Fetch all of the top-level classes that are known by this locator that satisfies the given filter.
 java.util.Collection<java.lang.String> getAllClassesInterruptibly()
          Fetch all of the top-level classes that are known by this locator.
 java.util.Collection<java.lang.String> getAllClassesInterruptibly(ClassNameFilter filter)
          Fetch all of the top-level classes that are known by this locator that satisfies the given filter.
 java.util.Collection<java.lang.String> getAllPackages()
          Fetch all of the full packges that are known by this locator.
 java.util.Collection<java.lang.String> getAllPackages(PackageNameFilter filter)
          Fetch all of the packages that are known by this locator that satisfies the given filter.
 java.util.Collection<java.lang.String> getAllPackagesInterruptibly()
          Fetch all of the full packges that are known by this locator.
 java.util.Collection<java.lang.String> getAllPackagesInterruptibly(PackageNameFilter filter)
          Fetch all of the packages that are known by this locator that satisfies the given filter.
 java.util.Collection<java.lang.String> getClassesByName(java.lang.String name, boolean matchCase)
          Fetch all of the top-level classes that are known by this locator with the given class name.
 java.util.Collection<java.lang.String> getClassesByNameInterruptibly(java.lang.String name, boolean matchCase)
          Fetch all of the top-level classes that are known by this locator with the given class name.
 java.util.Collection<java.lang.String> getClassesByPrefix(java.lang.String prefix, boolean matchCase)
          Fetch all of the top-level classes that are known by this locator whose given class name starts with the specified prefix.
 java.util.Collection<java.lang.String> getClassesByPrefixInterruptibly(java.lang.String prefix, boolean matchCase)
          Fetch all of the top-level classes that are known by this locator whose given class name starts with the specified prefix.
 java.util.Collection<java.lang.String> getClassesInPackage(java.lang.String packagePrefix)
          Fetch the top-level classes within the given package prefix.
 java.util.Collection<java.lang.String> getClassesInPackageInterruptibly(java.lang.String packagePrefix)
          Fetch the top-level classes within the given package prefix.
 java.net.URL getClassURL(java.lang.String fqClassName)
          Fetch the URL for the JavaFile for the given fully-qualified Java class name.
 java.net.URL getClassURLInterruptibly(java.lang.String fqClassName)
          Fetch the URL for the JavaFile for the given fully-qualified Java class name.
 java.util.Collection<java.lang.String> getPackages(java.lang.String packagePrefix)
          Fetch the list of subpackages within the given package.
 java.util.Collection<java.lang.String> getPackagesInterruptibly(java.lang.String packagePrefix)
          Fetch the list of subpackages within the given package.
 java.net.URL getResourceURL(java.lang.String resourceName)
          Fetch the URL for the Java resource file given the resource name.
 java.util.Collection<java.net.URL> getResourceURLs(java.lang.String resourceName)
          Fetch all the URL's for the Java resource file given the resource name.
 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 getSourceURLInterruptibly(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.
 java.net.URL getURLInterruptibly(java.lang.String fqClassName)
          Fetch the URL for the JavaFile for the given fully-qualified Java class name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocatorWrapper

public LocatorWrapper(BaseFileProvider provider)
Construct a JavaClassLocator wrapper for the given provider.

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.

Specified by:
buildIndex in interface JavaClassLocator

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
Throws:
java.lang.InterruptedException - if the build is interrupted

getPackages

public java.util.Collection<java.lang.String> getPackages(java.lang.String packagePrefix)
Fetch the list of subpackages within the given package. To get a list of top-level packages, use an empty, "", prefix. The names of the subpackages will not contain the package prefix.

Specified by:
getPackages in interface JavaClassLocator
Parameters:
packagePrefix - the package prefix, i.e., "java.io"
Returns:
a collection of (String) subpackage names in the given package

getPackagesInterruptibly

public java.util.Collection<java.lang.String> getPackagesInterruptibly(java.lang.String packagePrefix)
                                                                throws java.lang.InterruptedException
Description copied from interface: JavaClassLocator2
Fetch the list of subpackages within the given package. To get a list of top-level packages, use an empty, "", prefix. The names of the subpackages will not contain the package prefix.

Specified by:
getPackagesInterruptibly in interface JavaClassLocator2
Parameters:
packagePrefix - the package prefix, i.e., "java.io"
Returns:
a collection of (String) subpackage names in the given package
Throws:
java.lang.InterruptedException - if the operation is interrupted

getClassesInPackage

public java.util.Collection<java.lang.String> getClassesInPackage(java.lang.String packagePrefix)
Fetch the top-level classes within the given package prefix. To get a list of top-level classes that don't have a package, use an empty, "", prefix. Note that this method does not return inner classes.

Specified by:
getClassesInPackage in interface JavaClassLocator
Parameters:
packagePrefix - the package prefix, i.e., "java.io"
Returns:
a collection of (String) class names (without the package prefix) in the given package

getClassesInPackageInterruptibly

public java.util.Collection<java.lang.String> getClassesInPackageInterruptibly(java.lang.String packagePrefix)
                                                                        throws java.lang.InterruptedException
Description copied from interface: JavaClassLocator2
Fetch the top-level classes within the given package prefix. To get a list of top-level classes that don't have a package, use an empty, "", prefix. Note that this method does not return inner classes.

Specified by:
getClassesInPackageInterruptibly in interface JavaClassLocator2
Parameters:
packagePrefix - the package prefix, i.e., "java.io"
Returns:
a collection of (String) class names (without the package prefix) in the given package
Throws:
java.lang.InterruptedException - if the operation is interrupted

getAllClasses

public java.util.Collection<java.lang.String> getAllClasses()
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 interface JavaClassLocator
Returns:
a collection of (String) fully-qualified class names known by this locator

getAllClassesInterruptibly

public java.util.Collection<java.lang.String> getAllClassesInterruptibly()
                                                                  throws java.lang.InterruptedException
Description copied from interface: JavaClassLocator2
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:
getAllClassesInterruptibly in interface JavaClassLocator2
Returns:
a collection of (String) fully-qualified class names known by this locator
Throws:
java.lang.InterruptedException - if the operation is interrupted

getAllClasses

public java.util.Collection<java.lang.String> getAllClasses(ClassNameFilter filter)
Fetch all of the top-level classes that are known by this locator that satisfies the given filter. This will return fully-qualified class names, such as "java.util.List".

Specified by:
getAllClasses in interface JavaClassLocator
Parameters:
filter - the class name filter to use for the search
Returns:
a collection of (String) fully-qualified class names known by this locator, and filtered by the given name filter

getAllClassesInterruptibly

public java.util.Collection<java.lang.String> getAllClassesInterruptibly(ClassNameFilter filter)
                                                                  throws java.lang.InterruptedException
Description copied from interface: JavaClassLocator2
Fetch all of the top-level classes that are known by this locator that satisfies the given filter. This will return fully-qualified class names, such as "java.util.List".

Specified by:
getAllClassesInterruptibly in interface JavaClassLocator2
Parameters:
filter - the class name filter to use for the search
Returns:
a collection of (String) fully-qualified class names known by this locator, and filtered by the given name filter
Throws:
java.lang.InterruptedException - if the operation is interrupted

getAllPackages

public java.util.Collection<java.lang.String> getAllPackages()
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 interface JavaClassLocator
Returns:
a collection of (String) full package names known by this lcoator

getAllPackagesInterruptibly

public java.util.Collection<java.lang.String> getAllPackagesInterruptibly()
                                                                   throws java.lang.InterruptedException
Description copied from interface: JavaClassLocator2
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:
getAllPackagesInterruptibly in interface JavaClassLocator2
Returns:
a collection of (String) full package names known by this lcoator
Throws:
java.lang.InterruptedException - if the operation is interrupted

getAllPackages

public java.util.Collection<java.lang.String> getAllPackages(PackageNameFilter filter)
Fetch all of the packages that are known by this locator that satisfies the given filter. This will return full package names, such as "java.util", or "java.io". This collection will not include the top-level package "".

Specified by:
getAllPackages in interface JavaClassLocator
Parameters:
filter - the package name filter to use for the search
Returns:
a collection of (String) full package names that are known by this locator, and filtered by the given name filter

getAllPackagesInterruptibly

public java.util.Collection<java.lang.String> getAllPackagesInterruptibly(PackageNameFilter filter)
                                                                   throws java.lang.InterruptedException
Description copied from interface: JavaClassLocator2
Fetch all of the packages that are known by this locator that satisfies the given filter. This will return full package names, such as "java.util", or "java.io". This collection will not include the top-level package "".

Specified by:
getAllPackagesInterruptibly in interface JavaClassLocator2
Parameters:
filter - the package name filter to use for the search
Returns:
a collection of (String) full package names that are known by this locator, and filtered by the given name filter
Throws:
java.lang.InterruptedException - if the operation is interrupted

getClassesByName

public java.util.Collection<java.lang.String> getClassesByName(java.lang.String name,
                                                               boolean matchCase)
Fetch all of the top-level classes that are known by this locator with the given class name. For example, if "List" were specified for the name, this might return an array containing "java.awt.List" and "java.util.List".

Specified by:
getClassesByName in interface JavaClassLocator
Parameters:
name - the unqualified name of the top-level class to locate
matchCase - whether to use case-sensitivity for matching the class name
Returns:
a collection of (String) fully-qualified class names known by this locator with the given class name

getClassesByNameInterruptibly

public java.util.Collection<java.lang.String> getClassesByNameInterruptibly(java.lang.String name,
                                                                            boolean matchCase)
                                                                     throws java.lang.InterruptedException
Description copied from interface: JavaClassLocator2
Fetch all of the top-level classes that are known by this locator with the given class name. For example, if "List" were specified for the name, this might return an array containing "java.awt.List" and "java.util.List".

Specified by:
getClassesByNameInterruptibly in interface JavaClassLocator2
Parameters:
name - the unqualified name of the top-level class to locate
matchCase - whether to use case-sensitivity for matching the class name
Returns:
a collection of (String) fully-qualified class names known by this locator with the given class name
Throws:
java.lang.InterruptedException - if the operation is interrupted

getClassesByPrefix

public java.util.Collection<java.lang.String> getClassesByPrefix(java.lang.String prefix,
                                                                 boolean matchCase)
Fetch all of the top-level classes that are known by this locator whose given class name starts with the specified prefix. For example, if "File" were specified for this name, this might return an array containing "java.io.File", "java.io.FileNotFoundException", and "java.io.FileInputStream", and so on.

Specified by:
getClassesByPrefix in interface JavaClassLocator
Parameters:
prefix - the starting prefix of the class name to locate
matchCase - whether to use case-sensitivity for matching the class name
Returns:
a collection of (String) fully-qualified class names known by this locator with the given class name prefix

getClassesByPrefixInterruptibly

public java.util.Collection<java.lang.String> getClassesByPrefixInterruptibly(java.lang.String prefix,
                                                                              boolean matchCase)
                                                                       throws java.lang.InterruptedException
Description copied from interface: JavaClassLocator2
Fetch all of the top-level classes that are known by this locator whose given class name starts with the specified prefix. For example, if "File" were specified for this name, this might return an array containing "java.io.File", "java.io.FileNotFoundException", and "java.io.FileInputStream", and so on.

Specified by:
getClassesByPrefixInterruptibly in interface JavaClassLocator2
Parameters:
prefix - the starting prefix of the class name to locate
matchCase - whether to use case-sensitivity for matching the class name
Returns:
a collection of (String) fully-qualified class names known by this locator with the given class name prefix
Throws:
java.lang.InterruptedException - if the operation is interrupted

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.

Specified by:
getURL in interface JavaClassLocator
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

getURLInterruptibly

public java.net.URL getURLInterruptibly(java.lang.String fqClassName)
                                 throws java.lang.InterruptedException
Description copied from interface: JavaClassLocator2
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.

Specified by:
getURLInterruptibly in interface JavaClassLocator2
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
Throws:
java.lang.InterruptedException - if the operation is interrupted

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.

Specified by:
getSourceURL in interface JavaClassLocator
Parameters:
fqClassName - the fully-qualified class name in dotted notation

getSourceURLInterruptibly

public java.net.URL getSourceURLInterruptibly(java.lang.String fqClassName)
                                       throws java.lang.InterruptedException
Description copied from interface: JavaClassLocator2
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.

Specified by:
getSourceURLInterruptibly in interface JavaClassLocator2
Parameters:
fqClassName - the fully-qualified class name in dotted notation
Throws:
java.lang.InterruptedException - if the operation is interrupted

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.

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

getClassURLInterruptibly

public java.net.URL getClassURLInterruptibly(java.lang.String fqClassName)
                                      throws java.lang.InterruptedException
Description copied from interface: JavaClassLocator2
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.

Specified by:
getClassURLInterruptibly in interface JavaClassLocator2
Parameters:
fqClassName - the fully-qualified class name in dotted notation
Throws:
java.lang.InterruptedException - if the operation is interrupted

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.

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

getResourceURLs

public java.util.Collection<java.net.URL> getResourceURLs(java.lang.String resourceName)
Description copied from interface: JavaResourceLocator
Fetch all the URL's for the Java resource file given the resource name. This should include the full path of the resource.

Specified by:
getResourceURLs in interface JavaResourceLocator
Parameters:
resourceName - the full name of the resource including any file extensions
Returns:
the collection of Java resource URL's, may be empty but not null.

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

E13403-07

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