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 Details

    • DynamicTagLibrary

      public DynamicTagLibrary()
    • DynamicTagLibrary

      public DynamicTagLibrary(String uri)
  • Method Details

    • 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 class TagLibrary
      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 class TagLibrary
      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, or null 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