public class ResolverUtil extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
ResolverUtil.Test
A simple interface that specifies how to test classes to determine if they
are to be included in the results produced by the ResolverUtil.
|
| Constructor and Description |
|---|
ResolverUtil() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addIfMatching(ResolverUtil.Test test,
String fqn)
Add the class designated by the fully qualified class name provided to the set of
resolved classes if and only if it is approved by the Test supplied.
|
void |
find(ResolverUtil.Test test,
String... packageNames)
Attempts to discover classes that pass the test.
|
void |
findInPackage(ResolverUtil.Test test,
String packageName)
Scans for classes starting at the package provided and descending into subpackages.
|
Set<Class<?>> |
getClasses()
Provides access to the classes discovered so far.
|
ClassLoader |
getClassLoader()
Returns the classloader that will be used for scanning for classes.
|
Set<URI> |
getResources()
Returns the matching resources.
|
void |
setClassLoader(ClassLoader classloader)
Sets an explicit ClassLoader that should be used when scanning for classes.
|
public Set<Class<?>> getClasses()
find() methods, this set will be empty.public Set<URI> getResources()
public ClassLoader getClassLoader()
public void setClassLoader(ClassLoader classloader)
classloader - a ClassLoader to use when scanning for classespublic void find(ResolverUtil.Test test, String... packageNames)
getClasses().test - the test to determine matching classespackageNames - one or more package names to scan (including subpackages) for classespublic void findInPackage(ResolverUtil.Test test, String packageName)
getClasses().test - an instance of ResolverUtil.Test that will be used to filter classespackageName - the name of the package from which to start scanning for
classes, e.g. net.sourceforge.stripesprotected void addIfMatching(ResolverUtil.Test test, String fqn)
test - the test used to determine if the class matchesfqn - the fully qualified name of a classCopyright © 2006-2015 OPS4J - Open Participation Software for Java. All Rights Reserved.