Class BaseCheckTag
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
FieldsModifier and TypeFieldDescriptionprotected ObjectThe object to compare against the implicit object provided by the container.protected StringThe name of the implicit object under testprotected ObjectThe implicit EL object under testFields inherited from class jakarta.servlet.jsp.tagext.TagSupport
id, pageContextFields inherited from interface jakarta.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAINFields inherited from interface jakarta.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddisplayTestStatus(String message) Displays the status of the current test, or set of nested tests.intPerforms the implemented check provided by the base classes.Returns the current message.protected abstract voidImplemented by concrete validation tags to perform validation against the provided control and test objects.voidsetControl(Object o) Sets the control object for the test.voidsetDisplay(boolean display) Will cause any error message to be displayed.voidThe name of the implicit object under testvoidSets 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
-
Field Details
-
_object
The implicit EL object under test -
_name
The name of the implicit object under test -
_control
The object to compare against the implicit object provided by the container.
-
-
Constructor Details
-
BaseCheckTag
public BaseCheckTag()
-
-
Method Details
-
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
Sets the object under test.- Parameters:
o- - the implicit object under test
-
setName
The name of the implicit object under test- Parameters:
name- - the name of the implicit object
-
setControl
Sets the control object for the test.- Parameters:
o- - the control object
-
doStartTag
public int doStartTag() throws jakarta.servlet.jsp.JspExceptionPerforms the implemented check provided by the base classes.- Specified by:
doStartTagin interfacejakarta.servlet.jsp.tagext.Tag- Overrides:
doStartTagin classjakarta.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.JspExceptionImplemented by concrete validation tags to perform validation against the provided control and test objects.- Throws:
jakarta.servlet.jsp.JspException- - if an error occurs
-
displayTestStatus
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
-