Package org.apache.commons.jelly.impl
Class DynamicTagLibrary
- java.lang.Object
-
- org.apache.commons.jelly.TagLibrary
-
- org.apache.commons.jelly.impl.DynamicTagLibrary
-
public class DynamicTagLibrary extends TagLibrary
DynamicTagLibrary
represents a TagLibrary which gets created by running a Jelly script.- Version:
- $Revision: 155420 $
- Author:
- James Strachan
-
-
Constructor Summary
Constructors Constructor Description DynamicTagLibrary()
DynamicTagLibrary(String uri)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tag
createTag(String name, Attributes attributes)
Creates a new Tag for the given tag name if it existsTagScript
createTagScript(String name, Attributes attributes)
Creates a new script to execute the given tag name and attributesDynamicTagLibrary
find(String name)
Returns the tag library instance which contains the named tag.Script
getDynamicTag(String name)
Returns the script associated with the given tag nameTagLibrary
getParent()
Returns the parent library which will be used to resolve unknown tags.String
getUri()
void
registerBeanTag(String name, TagFactory factory)
Creates a new Jelly Bean Tag with the given namevoid
registerDynamicTag(String name, Script template)
Creates a new tag with the given name and templatevoid
setParent(TagLibrary parent)
Sets the parent to inherit tags from that are not defined in this library.void
setUri(String uri)
-
Methods inherited from class org.apache.commons.jelly.TagLibrary
createExpression, getExpressionFactory, getTagClasses, registerTag, registerTagFactory
-
-
-
-
Constructor Detail
-
DynamicTagLibrary
public DynamicTagLibrary()
-
DynamicTagLibrary
public DynamicTagLibrary(String uri)
-
-
Method Detail
-
createTagScript
public TagScript createTagScript(String name, Attributes attributes) throws JellyException
Creates a new script to execute the given tag name and attributes- Overrides:
createTagScript
in classTagLibrary
- Throws:
JellyException
-
createTag
public Tag createTag(String name, Attributes attributes) throws JellyException
Creates a new Tag for the given tag name if it exists- Overrides:
createTag
in classTagLibrary
- Throws:
JellyException
-
registerDynamicTag
public void registerDynamicTag(String name, Script template)
Creates a new tag with the given name and template
-
registerBeanTag
public void registerBeanTag(String name, TagFactory factory)
Creates a new Jelly Bean Tag with the given name
-
getDynamicTag
public Script getDynamicTag(String name)
Returns the script associated with the given tag name- Parameters:
name
- The tag name- Returns:
- The script associated with
name
, ornull
if the tag doesn't exist or isn't a script
-
find
public DynamicTagLibrary find(String name)
Returns the tag library instance which contains the named tag.If the tag is not registered within this library, the set of parent libraries will be searched.
- Parameters:
name
- The tag name- Returns:
- The tag library containing the named tag, or
null
if the tag is not registered.
-
getUri
public String getUri()
-
setUri
public void setUri(String uri)
-
getParent
public TagLibrary getParent()
Returns the parent library which will be used to resolve unknown tags.- Returns:
- TagLibrary
-
setParent
public void setParent(TagLibrary parent)
Sets the parent to inherit tags from that are not defined in this library.- Parameters:
parent
- The parent to set
-
-