public class ClassResolver extends Object
Limitations: this does not handle inner classes very well.
コンストラクタと説明 |
---|
ClassResolver(ClassLoader aLoader,
String aPkg,
Set<String> aImports)
Creates a new
ClassResolver instance. |
public ClassResolver(ClassLoader aLoader, String aPkg, Set<String> aImports)
ClassResolver
instance.aLoader
- the ClassLoader to load classes with.aPkg
- the name of the package the class may belong toaImports
- set of imports to check if the class belongs topublic Class<?> resolve(String aName, String aCurrentClass) throws ClassNotFoundException
aName
- name of the class to resolveaCurrentClass
- name of current class (for inner classes).ClassNotFoundException
- if unable to resolve the classpublic boolean isLoadable(String aName)
aName
- name of the class to checkpublic Class<?> safeLoad(String aName) throws ClassNotFoundException
aName
- name of the class to loadClass
for the specified classClassNotFoundException
- if an error occursCopyright © 2001-2013. All Rights Reserved.