1 23 package org.infoglue.deliver.taglib.content; 24 25 import javax.servlet.jsp.JspException ; 26 import javax.servlet.jsp.JspTagException ; 27 28 import org.infoglue.deliver.taglib.AbstractTag; 29 30 36 public class ContentVersionAttributeParameterTag extends AbstractTag 37 { 38 41 private static final long serialVersionUID = 4482006814634520239L; 42 43 46 private String name; 47 48 51 private String value; 52 53 56 public ContentVersionAttributeParameterTag() 57 { 58 super(); 59 } 60 61 68 public int doEndTag() throws JspException 69 { 70 addContentVersionAttribute(); 71 return EVAL_PAGE; 72 } 73 74 79 protected void addContentVersionAttribute() throws JspException 80 { 81 final ContentVersionParameterInterface parent = (ContentVersionParameterInterface) findAncestorWithClass(this, ContentVersionParameterInterface.class); 82 if(parent == null) 83 { 84 throw new JspTagException ("ContentVersionAttributeParameterTag must have a ContentVersionParameterTag ancestor."); 85 } 86 ((ContentVersionParameterInterface) parent).addContentVersionAttribute(name, value); 87 } 88 89 95 public void setName(final String name) throws JspException 96 { 97 this.name = evaluateString("parameter", "name", name); 98 } 99 100 106 public void setValue(final String value) throws JspException 107 { 108 this.value = evaluateString("parameter", "value", value); 109 } 110 } 111 | Popular Tags |