public interface ClassResolver
Has same effect as calling Class.forName(String),  but uses the
 appropriate ClassLoader.
| Modifier and Type | Interface and Description | 
|---|---|
| static class  | ClassResolver.AbstractClassResolverPartial implementation of  ClassResolver. | 
| static class  | ClassResolver.ThreadContextClassResolverImplementation of  ClassResolverthat callsThread.getContextClassLoader()on the current thread. | 
| Modifier and Type | Field and Description | 
|---|---|
| static ClassResolver | INSTANCEDefault resolver. | 
| Modifier and Type | Method and Description | 
|---|---|
| <T> Class<T> | forName(String className,
       boolean initialize)Equivalent of  Class.forName(String, boolean, ClassLoader). | 
| Iterable<URL> | getResources(String lookupName)Equivalent of  ClassLoader.getResources(String). | 
| <T> T | instantiateSafe(String className,
               Object... args)Instantiates a class and constructs an instance using the given
 arguments. | 
static final ClassResolver INSTANCE
<T> Class<T> forName(String className, boolean initialize) throws ClassNotFoundException
Class.forName(String, boolean, ClassLoader).ClassNotFoundException<T> T instantiateSafe(String className, Object... args)
T - Desired typeclassName - Class nameargs - ArgumentsClassCastException - if resulting object is not an instance of TIterable<URL> getResources(String lookupName) throws IOException
ClassLoader.getResources(String).IOExceptionCopyright © 2021 Hitachi Vantara. All rights reserved.