Class BaseClassLoaderTag
java.lang.Object
org.apache.commons.jelly.TagSupport
org.apache.commons.jelly.tags.core.BaseClassLoaderTag
- All Implemented Interfaces:
Tag
Abstract base tag providing
ClassLoader support.- Version:
- $Revision: 155420 $
- Author:
- James Strachan, Rodney Waldhoff
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ClassLoaderThe class loader to use for instantiating application objects.protected booleanDo we want to use the Context ClassLoader when loading classes for instantiating new objects? Default isfalse.Fields inherited from class org.apache.commons.jelly.TagSupport
body, context, parent -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn the class loader to be used for instantiating application objects when required.booleanReturn the boolean as to whether the context classloader should be used.voidsetClassLoader(ClassLoader classLoader) Set the class loader to be used for instantiating application objects when required.voidsetUseContextClassLoader(boolean use) Determine whether to use the Context ClassLoader (the one found by callingThread.currentThread().getContextClassLoader()) to resolve/load classes.Methods inherited from class org.apache.commons.jelly.TagSupport
findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isEscapeText, isTrim, setBody, setContext, setEscapeText, setParent, setTrim, trimBody
-
Field Details
-
classLoader
The class loader to use for instantiating application objects. If not specified, the context class loader, or the class loader used to load XMLParser itself, is used, based on the value of theuseContextClassLoadervariable. -
useContextClassLoader
protected boolean useContextClassLoaderDo we want to use the Context ClassLoader when loading classes for instantiating new objects? Default isfalse.
-
-
Constructor Details
-
BaseClassLoaderTag
public BaseClassLoaderTag()
-
-
Method Details
-
getClassLoader
Return the class loader to be used for instantiating application objects when required. This is determined based upon the following rules:- The class loader set by
setClassLoader(), if any - The thread context class loader, if it exists and the
useContextClassLoaderproperty is set to true - The class loader used to load the XMLParser class itself.
- The class loader set by
-
setClassLoader
Set the class loader to be used for instantiating application objects when required.- Parameters:
classLoader- The new class loader to use, ornullto revert to the standard rules
-
getUseContextClassLoader
public boolean getUseContextClassLoader()Return the boolean as to whether the context classloader should be used. -
setUseContextClassLoader
public void setUseContextClassLoader(boolean use) Determine whether to use the Context ClassLoader (the one found by callingThread.currentThread().getContextClassLoader()) to resolve/load classes. If not using Context ClassLoader, then the class-loading defaults to using the calling-class' ClassLoader.- Parameters:
use- determines whether to use JellyContext ClassLoader.
-