/** * Adds a new attribute definition to this dynamic tag */ public void addAttribute(Attribute attribute) { if ( attributes == null ) { attributes = new HashMap(); } attributes.put( attribute.getName(), attribute ); }
public AttributeTag() { attribute = new Attribute(); }
/** * Sets the default value of this attribute */ public void setDefaultValue(Expression defaultValue) { attribute.setDefaultValue(defaultValue); } }
public void doTag(XMLOutput output) throws JellyTagException { // lets find any attributes that are not set and for ( Iterator iter = attributes.values().iterator(); iter.hasNext(); ) { Attribute attribute = (Attribute) iter.next(); String name = attribute.getName(); if ( ! setAttributesSet.contains( name ) ) { if ( attribute.isRequired() ) { throw new MissingAttributeException(name); } // lets get the default value Object value = null; Expression expression = attribute.getDefaultValue(); if ( expression != null ) { value = expression.evaluate(context); } // only set non-null values? if ( value != null ) { super.setAttribute(name, value); } } } invokeBody(output); // export the bean if required if ( var != null ) { context.setVariable(var, getDynaBean()); } }
/** * Sets the name of the attribute */ public void setName(String name) { attribute.setName(name); }
public void doTag(XMLOutput output) throws JellyTagException { // lets find any attributes that are not set and for ( Iterator iter = attributes.values().iterator(); iter.hasNext(); ) { Attribute attribute = (Attribute) iter.next(); String name = attribute.getName(); if ( ! setAttributesSet.contains( name ) ) { if ( attribute.isRequired() ) { throw new MissingAttributeException(name); } // lets get the default value Object value = null; Expression expression = attribute.getDefaultValue(); if ( expression != null ) { value = expression.evaluate(context); } // only set non-null values? if ( value != null ) { super.setAttribute(name, value); } } } invokeBody(output); // export the bean if required if ( var != null ) { context.setVariable(var, getDynaBean()); } }
public void doTag(XMLOutput output) throws JellyTagException { // lets find any attributes that are not set and for ( Iterator iter = attributes.values().iterator(); iter.hasNext(); ) { Attribute attribute = (Attribute) iter.next(); String name = attribute.getName(); if ( ! setAttributesSet.contains( name ) ) { if ( attribute.isRequired() ) { throw new MissingAttributeException(name); } // lets get the default value Object value = null; Expression expression = attribute.getDefaultValue(); if ( expression != null ) { value = expression.evaluate(context); } // only set non-null values? if ( value != null ) { super.setAttribute(name, value); } } } invokeBody(output); // export the bean if required if ( var != null ) { context.setVariable(var, getDynaBean()); } }
/** * Adds a new attribute definition to this dynamic tag */ public void addAttribute(Attribute attribute) { if ( attributes == null ) { attributes = new HashMap(); } attributes.put( attribute.getName(), attribute ); }
public void doTag(XMLOutput output) throws JellyTagException { // lets find any attributes that are not set and for ( Iterator iter = attributes.values().iterator(); iter.hasNext(); ) { Attribute attribute = (Attribute) iter.next(); String name = attribute.getName(); if ( ! setAttributesSet.contains( name ) ) { if ( attribute.isRequired() ) { throw new MissingAttributeException(name); } // lets get the default value Object value = null; Expression expression = attribute.getDefaultValue(); if ( expression != null ) { value = expression.evaluate(context); } // only set non-null values? if ( value != null ) { super.setAttribute(name, value); } } } invokeBody(output); // export the bean if required if ( var != null ) { context.setVariable(var, getDynaBean()); } }
String name = attribute.getName(); if ( ! setAttributesSet.contains( name ) ) { if ( attribute.isRequired() ) { throw new MissingAttributeException(name); Expression expression = attribute.getDefaultValue(); if ( expression != null ) { value = expression.evaluate(context);
String name = attribute.getName(); if ( ! setAttributesSet.contains( name ) ) { if ( attribute.isRequired() ) { throw new MissingAttributeException(name); Expression expression = attribute.getDefaultValue(); if ( expression != null ) { value = expression.evaluate(context);
String name = attribute.getName(); if ( ! setAttributesSet.contains( name ) ) { if ( attribute.isRequired() ) { throw new MissingAttributeException(name); Expression expression = attribute.getDefaultValue(); if ( expression != null ) { value = expression.evaluate(context);
String name = attribute.getName(); if ( ! setAttributesSet.contains( name ) ) { if ( attribute.isRequired() ) { throw new MissingAttributeException(name); Expression expression = attribute.getDefaultValue(); if ( expression != null ) { value = expression.evaluate(context);