Package mondrian.util
Interface ClassResolver
- All Known Implementing Classes:
ClassResolver.AbstractClassResolver
,ClassResolver.ThreadContextClassResolver
public interface ClassResolver
Instantiates a class.
Has same effect as calling Class.forName(String)
, but uses the
appropriate ClassLoader
.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Partial implementation ofClassResolver
.static class
Implementation ofClassResolver
that callsThread.getContextClassLoader()
on the current thread. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescription<T> Class<T>
Equivalent ofClass.forName(String, boolean, ClassLoader)
.getResources
(String lookupName) Equivalent ofClassLoader.getResources(String)
.<T> T
instantiateSafe
(String className, Object... args) Instantiates a class and constructs an instance using the given arguments.
-
Field Details
-
INSTANCE
Default resolver.
-
-
Method Details
-
forName
Equivalent ofClass.forName(String, boolean, ClassLoader)
.- Throws:
ClassNotFoundException
-
instantiateSafe
Instantiates a class and constructs an instance using the given arguments.- Type Parameters:
T
- Desired type- Parameters:
className
- Class nameargs
- Arguments- Throws:
ClassCastException
- if resulting object is not an instance of T
-
getResources
Equivalent ofClassLoader.getResources(String)
.- Throws:
IOException
-