public void doTag(XMLOutput output) throws JellyTagException { if ( log.isDebugEnabled() ) { log.debug("Invoking dynamic tag with attributes: " + attributes); } attributes.put("org.apache.commons.jelly.body", getBody()); // create new context based on current attributes JellyContext newJellyContext = context.newJellyContext(attributes); Map attrMap = new HashMap(); for ( Iterator keyIter = this.attributes.keySet().iterator(); keyIter.hasNext();) { String key = (String) keyIter.next(); if ( key.endsWith( "Attr" ) ) { Object value = this.attributes.get( key ); attrMap.put( key, value ); attrMap.put( key.substring( 0, key.length()-4 ), value ); } } newJellyContext.setVariable( "attrs", attrMap ); getTemplate().run(newJellyContext, output); }
/** Creates a new Tag for the given tag name if it exists */ public Tag createTag(String name, Attributes attributes) throws JellyException { Object value = templates.get(name); if ( value instanceof Script ) { Script template = (Script) value; return new DynamicTag(template); } else if ( value instanceof TagFactory ) { TagFactory factory = (TagFactory) value; return factory.createTag(name, attributes); } else if ( parent != null ) { // delegate to the parent return parent.createTag(name, attributes); } return null; }
/** Creates a new Tag for the given tag name if it exists */ public Tag createTag(String name, Attributes attributes) throws JellyException { Object value = templates.get(name); if ( value instanceof Script ) { Script template = (Script) value; return new DynamicTag(template); } else if ( value instanceof TagFactory ) { TagFactory factory = (TagFactory) value; return factory.createTag(name, attributes); } else if ( parent != null ) { // delegate to the parent return parent.createTag(name, attributes); } return null; }
public void doTag(XMLOutput output) throws JellyTagException { if ( log.isDebugEnabled() ) { log.debug("Invoking dynamic tag with attributes: " + attributes); } attributes.put("org.apache.commons.jelly.body", getBody()); attributes.put("org.apache.commons.jelly.body.scope", context); // create new context based on current attributes JellyContext newJellyContext = context.newJellyContext(attributes); Map attrMap = new HashMap(); attrMap.put("ownerTag",this); for ( Iterator keyIter = this.attributes.keySet().iterator(); keyIter.hasNext();) { String key = (String) keyIter.next(); if ( key.endsWith( "Attr" ) ) { Object value = this.attributes.get( key ); attrMap.put( key, value ); attrMap.put( key.substring( 0, key.length()-4 ), value ); } } newJellyContext.setVariable( "attrs", attrMap ); getTemplate().run(newJellyContext, output); }
/** Creates a new Tag for the given tag name if it exists */ public Tag createTag(String name, Attributes attributes) throws JellyException { Object value = templates.get(name); if ( value instanceof Script ) { Script template = (Script) value; return new DynamicTag(template); } else if ( value instanceof TagFactory ) { TagFactory factory = (TagFactory) value; return factory.createTag(name, attributes); } else if ( parent != null ) { // delegate to the parent return parent.createTag(name, attributes); } return null; }
public void doTag(XMLOutput output) throws JellyTagException { if ( log.isDebugEnabled() ) { log.debug("Invoking dynamic tag with attributes: " + attributes); } attributes.put("org.apache.commons.jelly.body", getBody()); attributes.put("org.apache.commons.jelly.body.scope", context); // create new context based on current attributes JellyContext newJellyContext = context.newJellyContext(attributes); Map attrMap = new HashMap(); attrMap.put("ownerTag",this); for ( Iterator keyIter = this.attributes.keySet().iterator(); keyIter.hasNext();) { String key = (String) keyIter.next(); if ( key.endsWith( "Attr" ) ) { Object value = this.attributes.get( key ); attrMap.put( key, value ); attrMap.put( key.substring( 0, key.length()-4 ), value ); } } newJellyContext.setVariable( "attrs", attrMap ); getTemplate().run(newJellyContext, output); }
/** Creates a new Tag for the given tag name if it exists */ public Tag createTag(String name, Attributes attributes) throws JellyException { Object value = templates.get(name); if ( value instanceof Script ) { Script template = (Script) value; return new DynamicTag(template); } else if ( value instanceof TagFactory ) { TagFactory factory = (TagFactory) value; return factory.createTag(name, attributes); } else if ( parent != null ) { // delegate to the parent return parent.createTag(name, attributes); } return null; }
public void doTag(XMLOutput output) throws JellyTagException { if ( log.isDebugEnabled() ) { log.debug("Invoking dynamic tag with attributes: " + attributes); } attributes.put("org.apache.commons.jelly.body", getBody()); attributes.put("org.apache.commons.jelly.body.scope", context); // create new context based on current attributes JellyContext newJellyContext = context.newJellyContext(attributes); Map attrMap = new HashMap(); attrMap.put("ownerTag",this); for ( Iterator keyIter = this.attributes.keySet().iterator(); keyIter.hasNext();) { String key = (String) keyIter.next(); if ( key.endsWith( "Attr" ) ) { Object value = this.attributes.get( key ); attrMap.put( key, value ); attrMap.put( key.substring( 0, key.length()-4 ), value ); } } newJellyContext.setVariable( "attrs", attrMap ); getTemplate().run(newJellyContext, output); }