/** * Returns the tag library instance which contains the named tag. * <p/> * If the tag is not registered within this library, the set of * parent libraries will be searched. * * @param name The tag name * @return The tag library containing the named tag, or <code>null</code> * if the tag is not registered. */ public DynamicTagLibrary find(String name) { DynamicTagLibrary result = null; if (templates.get(name) != null) { result = this; } else if (parent instanceof DynamicTagLibrary) { result = ((DynamicTagLibrary) parent).find(name); } return result; }
/** * Returns the tag library instance which contains the named tag. * <p/> * If the tag is not registered within this library, the set of * parent libraries will be searched. * * @param name The tag name * @return The tag library containing the named tag, or <code>null</code> * if the tag is not registered. */ public DynamicTagLibrary find(String name) { DynamicTagLibrary result = null; if (templates.get(name) != null) { result = this; } else if (parent instanceof DynamicTagLibrary) { result = ((DynamicTagLibrary) parent).find(name); } return result; }
/** * Returns the tag library instance which contains the named tag. * <p/> * If the tag is not registered within this library, the set of * parent libraries will be searched. * * @param name The tag name * @return The tag library containing the named tag, or <code>null</code> * if the tag is not registered. */ public DynamicTagLibrary find(String name) { DynamicTagLibrary result = null; if (templates.get(name) != null) { result = this; } else if (parent instanceof DynamicTagLibrary) { result = ((DynamicTagLibrary) parent).find(name); } return result; }
/** * Returns the tag library instance which contains the named tag. * <p/> * If the tag is not registered within this library, the set of * parent libraries will be searched. * * @param name The tag name * @return The tag library containing the named tag, or <code>null</code> * if the tag is not registered. */ public DynamicTagLibrary find(String name) { DynamicTagLibrary result = null; if (templates.get(name) != null) { result = this; } else if (parent instanceof DynamicTagLibrary) { result = ((DynamicTagLibrary) parent).find(name); } return result; }
public void doTag(XMLOutput output) throws JellyTagException { DynamicTagLibrary library = getTagLibrary(); DynamicTagLibrary owner = library.find(getName()); if (owner == null) { throw new JellyTagException( "Cannot extend " + getName() + ": dynamic tag not defined"); } if (owner == library) { // disallow extension of tags defined within the same tag // library throw new JellyTagException("Cannot extend " + getName() + ": dynamic tag defined locally"); } superScript = owner.getDynamicTag(name); if (superScript == null) { // tag doesn't define a script - disallow this for the moment. throw new JellyTagException("Cannot extend " + getName() + ": tag is not a dynamic tag"); } owner.registerDynamicTag(getName() , getBody()); }