|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.dyuproject.ioc.AbstractResolver
com.dyuproject.ioc.ClasspathResolver
public final class ClasspathResolver
A resolver that resolves a resource by loading it from the classpath.
Field Summary | |
---|---|
static ClasspathResolver |
DEFAULT
The default instance |
static String |
TYPE
The type of this resolver. |
Fields inherited from class com.dyuproject.ioc.AbstractResolver |
---|
_bufferSize, _encoding, DEFAULT_BUFFER_SIZE, DEFAULT_ENCODING |
Constructor Summary | |
---|---|
ClasspathResolver()
|
Method Summary | |
---|---|
Resource |
createResource(String path)
Creates a resource from a given path string. |
static ClasspathResolver |
getDefault()
Gets the default instance. |
static URL |
getResource(String path)
Loads a URL resource from the classloader. |
static URL |
getResource(String path,
Class<?> context)
Loads a URL resource from the classloader;
If not found, the classloader of the context class specified will be used. |
String |
getType()
Gets the type (id) of resolver |
static boolean |
isCheckParents()
Gets the flag whether to lookup the resource from the classloader including its parent. |
static Class<?> |
loadClass(String className)
Loads a class from the classloader. |
static Class<?> |
loadClass(String className,
Class<?> context)
Loads a class from the classloader; If not found, the classloader of the context class specified will be used. |
void |
resolve(Resource resource,
Context context)
Resolves a resource by setting the Reader property of the Resource . |
static void |
setCheckParents(boolean checkParents)
Sets the flag whether to lookup the resource from the classloader including its parent. |
Methods inherited from class com.dyuproject.ioc.AbstractResolver |
---|
generateTypeFromClass, getBufferSize, getEncoding, newReader |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String TYPE
public static final ClasspathResolver DEFAULT
Constructor Detail |
---|
public ClasspathResolver()
Method Detail |
---|
public static ClasspathResolver getDefault()
public static boolean isCheckParents()
public static void setCheckParents(boolean checkParents)
public static Class<?> loadClass(String className, Class<?> context)
context
class specified will be used.
public static Class<?> loadClass(String className)
className
-
public static URL getResource(String path, Class<?> context)
URL
resource from the classloader;
If not found, the classloader of the context
class specified will be used.
public static URL getResource(String path)
URL
resource from the classloader.
public String getType()
Resource.Resolver
public void resolve(Resource resource, Context context) throws IOException
Resource.Resolver
Reader
property of the Resource
.
That is done via Resource.resolve(Reader)
.
IOException
public Resource createResource(String path) throws IOException
Resource.Resolver
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |