public interface ClassResolver
The class loader for the framework needs to be able to see resources in the application, but the application's class loader is a descendent of the framework's class loader. To resolve this, we need a 'hook', an instance that provides access to the application's class loader.
Modifier and Type | Method and Description |
---|---|
java.lang.Class |
checkForClass(java.lang.String type)
Like
findClass(String) , but simply returns null if the class does not exist (i.e.,
if ClassNotFoundException is thrown). |
java.lang.Class |
findClass(java.lang.String type)
Forwarded, to the the method
Class.forName(String, boolean, ClassLoader) ,
using the resolver's class loader. |
java.lang.ClassLoader |
getClassLoader()
Returns a
ClassLoader that can see all the classes the resolver can access. |
java.net.URL |
getResource(java.lang.String name)
Forwarded, unchanged, to the class loader.
|
java.net.URL getResource(java.lang.String name)
java.lang.Class findClass(java.lang.String type)
Class.forName(String, boolean, ClassLoader)
,
using the resolver's class loader.
Since 1.1, the type may include primitive types and arrays (of primitives or of objects).
ApplicationRuntimeException
- on any error.java.lang.Class checkForClass(java.lang.String type)
findClass(String)
, but simply returns null if the class does not exist (i.e.,
if ClassNotFoundException
is thrown). This is used in certain spots when (typically)
the exact package for a class is not known.java.lang.ClassLoader getClassLoader()
ClassLoader
that can see all the classes the resolver can access.