1 10 package org.mmbase.bridge.jsp.taglib.containers; 11 12 import java.util.*; 13 14 import javax.servlet.jsp.JspTagException ; 15 16 import org.mmbase.util.Entry; 17 import org.mmbase.bridge.jsp.taglib.functions.AbstractFunctionTag; 18 import org.mmbase.bridge.jsp.taglib.util.Attribute; 19 import org.mmbase.bridge.jsp.taglib.util.Referids; 20 21 28 public class FunctionContainerTag extends AbstractFunctionTag implements FunctionContainer { 29 31 private List parameters ; 32 33 public void addParameter(String key, Object value) throws JspTagException { 35 parameters.add(new Entry(key, value)); 36 } 37 38 public List getParameters() { 40 return Collections.unmodifiableList(parameters); 41 } 42 43 44 public String getName() throws JspTagException { 45 return name.getString(this); 46 } 47 48 public int doStartTag() throws JspTagException { 49 parameters = new ArrayList(); 50 if (referids != Attribute.NULL) { 51 parameters.addAll(Referids.getReferids(referids, this).entrySet()); 52 } 53 return EVAL_BODY; 54 } 55 56 public int doAfterBody() throws JspTagException { 57 if (EVAL_BODY == EVAL_BODY_BUFFERED) { 58 try { 59 if (bodyContent != null) { 60 bodyContent.writeOut(bodyContent.getEnclosingWriter()); 61 } 62 } catch (java.io.IOException ioe){ 63 throw new JspTagException (ioe.toString()); 64 } 65 } 66 return SKIP_BODY; 67 } 68 public int doEndTag() throws JspTagException { 69 parameters = null; 70 return super.doEndTag(); 71 } 72 73 74 } 75 | Popular Tags |