org.apache.struts.taglib.logic
Class CompareTagBase

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by org.apache.struts.taglib.logic.ConditionalTagBase
          extended by org.apache.struts.taglib.logic.CompareTagBase
All Implemented Interfaces:
Serializable, IterationTag, Tag
Direct Known Subclasses:
EqualTag, GreaterEqualTag, GreaterThanTag, LessEqualTag, LessThanTag, NotEqualTag

public abstract class CompareTagBase
extends ConditionalTagBase

Abstract base class for comparison tags. Concrete subclasses need only define values for desired1 and desired2.

Version:
$Rev: 471754 $ $Date: 2004-10-16 12:38:42 -0400 (Sat, 16 Oct 2004) $
See Also:
Serialized Form

Field Summary
protected static int DOUBLE_COMPARE
          We will do a double/float comparison.
protected static int LONG_COMPARE
          We will do a long/int comparison.
protected static org.apache.struts.util.MessageResources messages
          The message resources for this package.
protected static int STRING_COMPARE
          We will do a String comparison.
 String value
          The value to which the variable specified by other attributes of this tag will be compared.
 
Fields inherited from class org.apache.struts.taglib.logic.ConditionalTagBase
cookie, header, name, parameter, property, role, scope, user
 
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
CompareTagBase()
           
 
Method Summary
protected abstract  boolean condition()
          Evaluate the condition that is being tested by this particular tag, and return true if the nested body content of this tag should be evaluated, or false if it should be skipped.
protected  boolean condition(int desired1, int desired2)
          Evaluate the condition that is being tested by this particular tag, and return true if the nested body content of this tag should be evaluated, or false if it should be skipped.
 String getValue()
           
 void release()
          Release all allocated resources.
 void setValue(String value)
           
 
Methods inherited from class org.apache.struts.taglib.logic.ConditionalTagBase
doEndTag, doStartTag, getCookie, getHeader, getName, getParameter, getProperty, getRole, getScope, getUser, setCookie, setHeader, setName, setParameter, setProperty, setRole, setScope, setUser
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, 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
 

Field Detail

DOUBLE_COMPARE

protected static final int DOUBLE_COMPARE
We will do a double/float comparison.

See Also:
Constant Field Values

LONG_COMPARE

protected static final int LONG_COMPARE
We will do a long/int comparison.

See Also:
Constant Field Values

STRING_COMPARE

protected static final int STRING_COMPARE
We will do a String comparison.

See Also:
Constant Field Values

messages

protected static org.apache.struts.util.MessageResources messages
The message resources for this package.


value

public String value
The value to which the variable specified by other attributes of this tag will be compared.

Constructor Detail

CompareTagBase

public CompareTagBase()
Method Detail

getValue

public String getValue()

setValue

public void setValue(String value)

release

public void release()
Release all allocated resources.

Specified by:
release in interface Tag
Overrides:
release in class ConditionalTagBase

condition

protected abstract boolean condition()
                              throws JspException
Evaluate the condition that is being tested by this particular tag, and return true if the nested body content of this tag should be evaluated, or false if it should be skipped. This method must be implemented by concrete subclasses.

Specified by:
condition in class ConditionalTagBase
Throws:
JspException - if a JSP exception occurs

condition

protected boolean condition(int desired1,
                            int desired2)
                     throws JspException
Evaluate the condition that is being tested by this particular tag, and return true if the nested body content of this tag should be evaluated, or false if it should be skipped. This method must be implemented by concrete subclasses.

Parameters:
desired1 - First desired value for a true result (-1, 0, +1)
desired2 - Second desired value for a true result (-1, 0, +1)
Throws:
JspException - if a JSP exception occurs


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.