1 10 package org.mmbase.bridge.jsp.taglib; 11 import javax.servlet.jsp.*; 12 13 import org.mmbase.bridge.jsp.taglib.util.Attribute; 14 15 16 23 24 public class HasRelationsTag extends NodeReferrerTag implements Condition { 25 26 protected Attribute inverse = Attribute.NULL; 27 28 public void setInverse(String b) throws JspTagException { 29 inverse = getAttribute(b); 30 } 31 protected final boolean getInverse() throws JspTagException { 32 return inverse.getBoolean(this, false); 33 } 34 35 public int doStartTag() throws JspTagException { 36 if ((getNode().hasRelations()) != getInverse()) { 37 return EVAL_BODY_BUFFERED; 38 } else { 39 return SKIP_BODY; 40 } 41 } 42 public int doAfterBody() throws JspTagException { 43 try{ 44 if(bodyContent != null) { 45 bodyContent.writeOut(bodyContent.getEnclosingWriter()); 46 } 47 return SKIP_BODY; 48 } catch(java.io.IOException e){ 49 throw new JspTagException("IO Error: " + e.getMessage()); 50 } 51 } 52 53 54 } 55 | Popular Tags |