java.lang.Object
jakarta.servlet.jsp.tagext.TagSupport
ee.jakarta.tck.pages.spec.core_syntax.scripting.el.BaseCheckTag
All Implemented Interfaces:
jakarta.servlet.jsp.tagext.IterationTag, jakarta.servlet.jsp.tagext.JspTag, jakarta.servlet.jsp.tagext.Tag, Serializable
Direct Known Subclasses:
CheckCoercionTag, CheckECMATag, CheckLiteralTag, CheckObjectTag, CheckOperatorTag

public abstract class BaseCheckTag extends jakarta.servlet.jsp.tagext.TagSupport
Base class to perform validation of the JSP 2.0 expression language. This class provides facilities to set a control object which a test object is compared against. It's up to the concrete implementation of this class to provided the logic to handle the validation.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected Object
    The object to compare against the implicit object provided by the container.
    protected String
    The name of the implicit object under test
    protected Object
    The implicit EL object under test

    Fields inherited from class jakarta.servlet.jsp.tagext.TagSupport

    id, pageContext

    Fields inherited from interface jakarta.servlet.jsp.tagext.IterationTag

    EVAL_BODY_AGAIN

    Fields inherited from interface jakarta.servlet.jsp.tagext.Tag

    EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    Displays the status of the current test, or set of nested tests.
    int
    Performs the implemented check provided by the base classes.
    Returns the current message.
    protected abstract void
    Implemented by concrete validation tags to perform validation against the provided control and test objects.
    void
    Sets the control object for the test.
    void
    setDisplay(boolean display)
    Will cause any error message to be displayed.
    void
    The name of the implicit object under test
    void
    Sets the object under test.

    Methods inherited from class jakarta.servlet.jsp.tagext.TagSupport

    doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • _object

      protected Object _object
      The implicit EL object under test
    • _name

      protected String _name
      The name of the implicit object under test
    • _control

      protected Object _control
      The object to compare against the implicit object provided by the container.
  • Constructor Details

    • BaseCheckTag

      public BaseCheckTag()
  • Method Details

    • getMessage

      public String getMessage()
      Returns the current message.
      Returns:
      the current message or null of there is no failure
    • setDisplay

      public void setDisplay(boolean display)
      Will cause any error message to be displayed.
      Parameters:
      display -
    • setObject

      public void setObject(Object o)
      Sets the object under test.
      Parameters:
      o - - the implicit object under test
    • setName

      public void setName(String name)
      The name of the implicit object under test
      Parameters:
      name - - the name of the implicit object
    • setControl

      public void setControl(Object o)
      Sets the control object for the test.
      Parameters:
      o - - the control object
    • doStartTag

      public int doStartTag() throws jakarta.servlet.jsp.JspException
      Performs the implemented check provided by the base classes.
      Specified by:
      doStartTag in interface jakarta.servlet.jsp.tagext.Tag
      Overrides:
      doStartTag in class jakarta.servlet.jsp.tagext.TagSupport
      Returns:
      EVAL_BODY_INCLUDE
      Throws:
      jakarta.servlet.jsp.JspException - if an error occurs
    • performCheck

      protected abstract void performCheck() throws jakarta.servlet.jsp.JspException
      Implemented by concrete validation tags to perform validation against the provided control and test objects.
      Throws:
      jakarta.servlet.jsp.JspException - - if an error occurs
    • displayTestStatus

      protected void displayTestStatus(String message) throws jakarta.servlet.jsp.JspException
      Displays the status of the current test, or set of nested tests. If a particular tag has the display attribute set to true, this method will recurse though it's ancestor tags and obtain any failure notifications. If this particular instance doesn't have the display attribute set, then the error generated by the check will be stored to be retrieved by another action nested further down.
      Parameters:
      message - - the message to display or store
      Throws:
      jakarta.servlet.jsp.JspException - - if an error occurs