info.magnolia.cms.taglibs
Class BaseConditionalContentTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by info.magnolia.cms.taglibs.BaseContentTag
          extended by info.magnolia.cms.taglibs.BaseConditionalContentTag
All Implemented Interfaces:
Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag
Direct Known Subclasses:
IfEmpty, IfExisting

public abstract class BaseConditionalContentTag
extends BaseContentTag

Base class for implementing conditional tags (e.g. IfEmpty). Subclasses need to implement the condition() method.

Version:
$Id: BaseConditionalContentTag.java 41137 2011-01-06 18:19:25Z gjoseph $
Author:
philipp
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
BaseConditionalContentTag()
           
 
Method Summary
protected abstract  boolean condition()
          Subclasses implement this method to compute the boolean result of the conditional action.
 int doStartTag()
          Includes its body if condition() evaluates to true.
 
Methods inherited from class info.magnolia.cms.taglibs.BaseContentTag
getContentNode, getContentNodeCollectionName, getContentNodeName, getCurrentPage, getFirstMatchingNode, getFirtMatchingNode, getNodeDataName, getPath, getRepository, getUuid, isActpage, release, resolveNode, setActpage, setContentNode, setContentNodeCollectionName, setContentNodeName, setInherit, setNodeDataName, setPath, setRepository, setUuid
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseConditionalContentTag

public BaseConditionalContentTag()
Method Detail

condition

protected abstract boolean condition()
                              throws javax.servlet.jsp.JspTagException

Subclasses implement this method to compute the boolean result of the conditional action. This method is invoked once per tag invocation by doStartTag().

Returns:
a boolean representing the condition that a particular subclass uses to drive its conditional logic.
Throws:
javax.servlet.jsp.JspTagException

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Includes its body if condition() evaluates to true.

Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport
Throws:
javax.servlet.jsp.JspException


Copyright © 2003-2011 Magnolia International Ltd.. All Rights Reserved.