/** * 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 Tag createTag(String name, Attributes attributes) throws JellyException { return DynamicTagLibrary.this.createTag(name, attributes); } }
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()); }
public void doTag(XMLOutput output) throws JellyTagException { String uri = getUri(); tagLibrary = new DynamicTagLibrary( uri ); // inherit tags from an existing tag library if ( isInherit() ) { tagLibrary.setParent( context.getTagLibrary( uri ) ); } context.registerTagLibrary( uri, tagLibrary ); invokeBody(output); tagLibrary = null; }
public void doTag(XMLOutput output) throws MissingAttributeException, JellyTagException { invokeBody(output); if (name == null) { throw new MissingAttributeException("name"); } if (dynaClass == null) { throw new MissingAttributeException("dynaClass"); } final DynaClass theDynaClass = dynaClass; final Map beanAttributes = (attributes != null) ? attributes : EMPTY_MAP; TagFactory factory = new TagFactory() { public Tag createTag(String name, Attributes attributes) { return new DynamicDynaBeanTag(theDynaClass, beanAttributes, varAttribute); } }; getTagLibrary().registerBeanTag(name, factory); // now lets clear the attributes for next invocation and help the GC attributes = null; }
public void doTag(XMLOutput output) throws JellyTagException { getTagLibrary().registerDynamicTag( getName(), getBody() ); }
getTagLibrary().registerBeanTag(name, factory);
/** * 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 Tag createTag(String name, Attributes attributes) throws JellyException { return DynamicTagLibrary.this.createTag(name, attributes); } }
/** * 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 Tag createTag(String name, Attributes attributes) throws JellyException { return DynamicTagLibrary.this.createTag(name, attributes); } }
/** * 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 Tag createTag(String name, Attributes attributes) throws JellyException { return DynamicTagLibrary.this.createTag(name, attributes); } }