|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.jelly.impl.DefaultTagLibraryResolver
public class DefaultTagLibraryResolver
DefaultTagLibraryResolver
is a default implemenation
which attempts to interpret the URI as a String called 'jelly:className'
and class load the given Java class. Otherwise META-INF/services/jelly/uri
is searched for on the thread context's class path and, if found, that
class will be loaded.
Field Summary | |
---|---|
private java.lang.ClassLoader |
classLoader
The class loader to use for instantiating application objects. |
private org.apache.commons.discovery.resource.classes.DiscoverClasses |
discovery
|
private static org.apache.commons.logging.Log |
log
The Log to which logging calls will be made. |
private boolean |
useContextClassLoader
Do we want to use the Context ClassLoader when loading classes for instantiating new objects? Default is false . |
Constructor Summary | |
---|---|
DefaultTagLibraryResolver()
|
Method Summary | |
---|---|
java.lang.ClassLoader |
getClassLoader()
Return the class loader to be used for instantiating application objects when required. |
org.apache.commons.discovery.resource.classes.DiscoverClasses |
getDiscoverClasses()
|
boolean |
getUseContextClassLoader()
Return the boolean as to whether the context classloader should be used. |
protected TagLibrary |
loadClass(java.lang.String uri,
java.lang.String className)
Instantiates the given class name. |
protected TagLibrary |
newInstance(java.lang.String uri,
java.lang.Class theClass)
Creates a new instance of the given TagLibrary class or return null if it could not be instantiated. |
TagLibrary |
resolveTagLibrary(java.lang.String uri)
Attempts to resolve the given URI to be associated with a TagLibrary otherwise null is returned to indicate no tag library could be found so that the namespace URI should be treated as just vanilla XML. |
void |
setClassLoader(java.lang.ClassLoader classLoader)
Set the class loader to be used for instantiating application objects when required. |
void |
setDiscoverClasses(org.apache.commons.discovery.resource.classes.DiscoverClasses discovery)
Sets the fully configured DiscoverClasses instance to be used to lookup services |
void |
setUseContextClassLoader(boolean use)
Determine whether to use the Context ClassLoader (the one found by calling Thread.currentThread().getContextClassLoader() )
to resolve/load classes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final org.apache.commons.logging.Log log
private org.apache.commons.discovery.resource.classes.DiscoverClasses discovery
private java.lang.ClassLoader classLoader
useContextClassLoader
variable.
private boolean useContextClassLoader
false
.
Constructor Detail |
---|
public DefaultTagLibraryResolver()
Method Detail |
---|
public TagLibrary resolveTagLibrary(java.lang.String uri)
resolveTagLibrary
in interface TagLibraryResolver
public java.lang.ClassLoader getClassLoader()
setClassLoader()
, if anyuseContextClassLoader
property is set to true
public void setClassLoader(java.lang.ClassLoader classLoader)
classLoader
- The new class loader to use, or null
to revert to the standard rulespublic boolean getUseContextClassLoader()
public void setUseContextClassLoader(boolean use)
Thread.currentThread().getContextClassLoader()
)
to resolve/load classes. If not
using Context ClassLoader, then the class-loading defaults to
using the calling-class' ClassLoader.
boolean
- determines whether to use JellyContext ClassLoader.public org.apache.commons.discovery.resource.classes.DiscoverClasses getDiscoverClasses()
public void setDiscoverClasses(org.apache.commons.discovery.resource.classes.DiscoverClasses discovery)
protected TagLibrary loadClass(java.lang.String uri, java.lang.String className)
protected TagLibrary newInstance(java.lang.String uri, java.lang.Class theClass)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |