public interface JavaClassLocator
JavaClassLocator
is the interface for locating Java
classes and packages, and for resolving the URLs for Java classes. This interface is intended primarily for locating top-level classes (not inner classes). Implementations are not required to provide locator support for inner classes (for performance reasons).
Modifier and Type | Method and Description |
---|---|
void |
buildIndex()
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> |
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> |
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> |
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> |
getClassesInPackage(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.util.Collection<java.lang.String> |
getPackages(java.lang.String packagePrefix)
Fetch the list of subpackages within the given package.
|
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.
|
void buildIndex()
java.util.Collection<java.lang.String> getPackages(java.lang.String packagePrefix)
packagePrefix
- the package prefix, i.e., "java.io"java.util.Collection<java.lang.String> getClassesInPackage(java.lang.String packagePrefix)
packagePrefix
- the package prefix, i.e., "java.io"java.util.Collection<java.lang.String> getAllClasses()
java.util.Collection<java.lang.String> getAllClasses(ClassNameFilter filter)
filter
- the class name filter to use for the searchjava.util.Collection<java.lang.String> getAllPackages()
java.util.Collection<java.lang.String> getAllPackages(PackageNameFilter filter)
filter
- the package name filter to use for the searchjava.util.Collection<java.lang.String> getClassesByName(java.lang.String name, boolean matchCase)
name
- the unqualified name of the top-level class to locatematchCase
- whether to use case-sensitivity for matching the
class namejava.util.Collection<java.lang.String> getClassesByPrefix(java.lang.String prefix, boolean matchCase)
prefix
- the starting prefix of the class name to locatematchCase
- whether to use case-sensitivity for matching the
class namejava.net.URL getURL(java.lang.String fqClassName)
fqClassName
- the fully-qualified class name in dotted notation,
i.e., java.util.Listjava.net.URL getSourceURL(java.lang.String fqClassName)
fqClassName
- the fully-qualified class name in dotted notationjava.net.URL getClassURL(java.lang.String fqClassName)
fqClassName
- the fully-qualified class name in dotted notation