|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hivemind.impl.DefaultClassResolver
public class DefaultClassResolver
Default implementation of ClassResolver
based around
Thread.getContextClassLoader()
(which is set by the servlet container).
Constructor Summary | |
---|---|
DefaultClassResolver()
Constructs a new instance using Thread.getContextClassLoader() . |
|
DefaultClassResolver(java.lang.ClassLoader loader)
|
Method Summary | |
---|---|
java.lang.Class |
checkForClass(java.lang.String type)
Like ClassResolver.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)
Invokes Class.forName(java.lang.String, boolean, java.lang.ClassLoader) . |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultClassResolver()
Thread.getContextClassLoader()
.
public DefaultClassResolver(java.lang.ClassLoader loader)
Method Detail |
---|
public java.net.URL getResource(java.lang.String name)
ClassResolver
getResource
in interface ClassResolver
public java.lang.Class findClass(java.lang.String type)
Class.forName(java.lang.String, boolean, java.lang.ClassLoader)
.
findClass
in interface ClassResolver
type
- the complete class name to locate and load; alternately, may be a primitive name
or an array type (primitive or object)
ApplicationRuntimeException
- if loading the class throws an exception (typically
ClassNotFoundException
or a security exception)JavaTypeUtils
public java.lang.Class checkForClass(java.lang.String type)
ClassResolver
ClassResolver.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.
checkForClass
in interface ClassResolver
public java.lang.ClassLoader getClassLoader()
ClassResolver
ClassLoader
that can see all the classes the resolver can access.
getClassLoader
in interface ClassResolver
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |