public class CompoundClassResolver extends Object implements IClassResolver
IClassResolver. Class resolving is done by iterating through all
IClassResolvers until the class is found. Resource resolving is done by combining the
results of all IClassResolvers.| Constructor and Description |
|---|
CompoundClassResolver() |
| Modifier and Type | Method and Description |
|---|---|
CompoundClassResolver |
add(IClassResolver resolver)
Adds a resolver
|
ClassLoader |
getClassLoader()
Returns the
ClassLoader to be used for resolving classes |
Iterator<URL> |
getResources(String name)
Tries to load all the resources by the name that is given.
|
CompoundClassResolver |
remove(IClassResolver resolver)
Removes a resolver
|
Class<?> |
resolveClass(String className)
Resolves a class by name (which may or may not involve loading it; thus the name class
*resolver* not *loader*).
|
public Class<?> resolveClass(String className) throws ClassNotFoundException
This implementation iterates through all the IClassResolver trying to load the class
until the class is found.
resolveClass in interface IClassResolverclassName - The name of the class to resolve.Class, if it is found.ClassNotFoundException - If the class was not foundpublic Iterator<URL> getResources(String name)
This implementation iterates through all IClassResolvers added, and combines the
results into one Set of URLs, and returns an Iterator for the set.
URLs are unique in the set.
getResources in interface IClassResolvername - The name of the resource to find.Iterator of all the URLs matching the resource name.public ClassLoader getClassLoader()
IClassResolverClassLoader to be used for resolving classesgetClassLoader in interface IClassResolverpublic CompoundClassResolver add(IClassResolver resolver)
resolver - The resolver to addthis for chainingpublic CompoundClassResolver remove(IClassResolver resolver)
resolver - The resolver to removethis for chainingCopyright © 2006–2014 Apache Software Foundation. All rights reserved.