public class LocatorWrapper extends java.lang.Object implements JavaClassLocator2, JavaResourceLocator
LocatorWrapper
is a JavaClassLocator implementation
that simply wraps a BaseFileProvider instance.Constructor and Description |
---|
LocatorWrapper(BaseFileProvider provider)
Construct a JavaClassLocator wrapper for the given provider.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public LocatorWrapper(BaseFileProvider provider)
public void buildIndex()
buildIndex
in interface JavaClassLocator
public void buildIndexInterruptibly() throws java.lang.InterruptedException
JavaClassLocator2
buildIndexInterruptibly
in interface JavaClassLocator2
java.lang.InterruptedException
- if the build is interruptedpublic java.util.Collection<java.lang.String> getPackages(java.lang.String packagePrefix)
getPackages
in interface JavaClassLocator
packagePrefix
- the package prefix, i.e., "java.io"public java.util.Collection<java.lang.String> getPackagesInterruptibly(java.lang.String packagePrefix) throws java.lang.InterruptedException
JavaClassLocator2
getPackagesInterruptibly
in interface JavaClassLocator2
packagePrefix
- the package prefix, i.e., "java.io"java.lang.InterruptedException
- if the operation is interruptedpublic java.util.Collection<java.lang.String> getClassesInPackage(java.lang.String packagePrefix)
getClassesInPackage
in interface JavaClassLocator
packagePrefix
- the package prefix, i.e., "java.io"public java.util.Collection<java.lang.String> getClassesInPackageInterruptibly(java.lang.String packagePrefix) throws java.lang.InterruptedException
JavaClassLocator2
getClassesInPackageInterruptibly
in interface JavaClassLocator2
packagePrefix
- the package prefix, i.e., "java.io"java.lang.InterruptedException
- if the operation is interruptedpublic java.util.Collection<java.lang.String> getAllClasses()
getAllClasses
in interface JavaClassLocator
public java.util.Collection<java.lang.String> getAllClassesInterruptibly() throws java.lang.InterruptedException
JavaClassLocator2
getAllClassesInterruptibly
in interface JavaClassLocator2
java.lang.InterruptedException
- if the operation is interruptedpublic java.util.Collection<java.lang.String> getAllClasses(ClassNameFilter filter)
getAllClasses
in interface JavaClassLocator
filter
- the class name filter to use for the searchpublic java.util.Collection<java.lang.String> getAllClassesInterruptibly(ClassNameFilter filter) throws java.lang.InterruptedException
JavaClassLocator2
getAllClassesInterruptibly
in interface JavaClassLocator2
filter
- the class name filter to use for the searchjava.lang.InterruptedException
- if the operation is interruptedpublic java.util.Collection<java.lang.String> getAllPackages()
getAllPackages
in interface JavaClassLocator
public java.util.Collection<java.lang.String> getAllPackagesInterruptibly() throws java.lang.InterruptedException
JavaClassLocator2
getAllPackagesInterruptibly
in interface JavaClassLocator2
java.lang.InterruptedException
- if the operation is interruptedpublic java.util.Collection<java.lang.String> getAllPackages(PackageNameFilter filter)
getAllPackages
in interface JavaClassLocator
filter
- the package name filter to use for the searchpublic java.util.Collection<java.lang.String> getAllPackagesInterruptibly(PackageNameFilter filter) throws java.lang.InterruptedException
JavaClassLocator2
getAllPackagesInterruptibly
in interface JavaClassLocator2
filter
- the package name filter to use for the searchjava.lang.InterruptedException
- if the operation is interruptedpublic java.util.Collection<java.lang.String> getClassesByName(java.lang.String name, boolean matchCase)
getClassesByName
in interface JavaClassLocator
name
- the unqualified name of the top-level class to locatematchCase
- whether to use case-sensitivity for matching the
class namepublic java.util.Collection<java.lang.String> getClassesByNameInterruptibly(java.lang.String name, boolean matchCase) throws java.lang.InterruptedException
JavaClassLocator2
getClassesByNameInterruptibly
in interface JavaClassLocator2
name
- the unqualified name of the top-level class to locatematchCase
- whether to use case-sensitivity for matching the
class namejava.lang.InterruptedException
- if the operation is interruptedpublic java.util.Collection<java.lang.String> getClassesByPrefix(java.lang.String prefix, boolean matchCase)
getClassesByPrefix
in interface JavaClassLocator
prefix
- the starting prefix of the class name to locatematchCase
- whether to use case-sensitivity for matching the
class namepublic java.util.Collection<java.lang.String> getClassesByPrefixInterruptibly(java.lang.String prefix, boolean matchCase) throws java.lang.InterruptedException
JavaClassLocator2
getClassesByPrefixInterruptibly
in interface JavaClassLocator2
prefix
- the starting prefix of the class name to locatematchCase
- whether to use case-sensitivity for matching the
class namejava.lang.InterruptedException
- if the operation is interruptedpublic java.net.URL getURL(java.lang.String fqClassName)
getURL
in interface JavaClassLocator
fqClassName
- the fully-qualified class name in dotted notation,
i.e., java.util.Listpublic java.net.URL getURLInterruptibly(java.lang.String fqClassName) throws java.lang.InterruptedException
JavaClassLocator2
getURLInterruptibly
in interface JavaClassLocator2
fqClassName
- the fully-qualified class name in dotted notation,
i.e., java.util.Listjava.lang.InterruptedException
- if the operation is interruptedpublic java.net.URL getSourceURL(java.lang.String fqClassName)
getSourceURL
in interface JavaClassLocator
fqClassName
- the fully-qualified class name in dotted notationpublic java.net.URL getSourceURLInterruptibly(java.lang.String fqClassName) throws java.lang.InterruptedException
JavaClassLocator2
getSourceURLInterruptibly
in interface JavaClassLocator2
fqClassName
- the fully-qualified class name in dotted notationjava.lang.InterruptedException
- if the operation is interruptedpublic java.net.URL getClassURL(java.lang.String fqClassName)
getClassURL
in interface JavaClassLocator
getClassURL
in interface JavaResourceLocator
fqClassName
- the fully-qualified class name in dotted notationpublic java.net.URL getClassURLInterruptibly(java.lang.String fqClassName) throws java.lang.InterruptedException
JavaClassLocator2
getClassURLInterruptibly
in interface JavaClassLocator2
fqClassName
- the fully-qualified class name in dotted notationjava.lang.InterruptedException
- if the operation is interruptedpublic java.net.URL getResourceURL(java.lang.String resourceName)
getResourceURL
in interface JavaResourceLocator
resourceName
- the full name of the resource including any file
extensionspublic java.util.Collection<java.net.URL> getResourceURLs(java.lang.String resourceName)
JavaResourceLocator
getResourceURLs
in interface JavaResourceLocator
resourceName
- the full name of the resource including any file
extensions