|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
org.apache.taglibs.regexp.MatchTag
public class MatchTag
JSP Tag match, used to implement a perl style match on the text.
The body of the tag iterates through each match found. The normal <jsp:getProperty/> can be used to get the match results using the id of the match tag script variable.
The attribute text must be set to the id of a text tag, and the regexp attribute must be set to the id of a regexp tag.
JSP Tag Lib Descriptor
<name>match</name> <tagclass>org.apache.taglibs.regexp.MatchTag</tagclass> <bodycontent>JSP</bodycontent> <info>Uses the regexp to find matches in text, loops for each match found.</info> <attribute> <name>id</name> <required>true</required> <rtexprvalue>false</rtexprvalue> </attribute> <attribute> <name>text</name> <required>true</required> <rtexprvalue>false</rtexprvalue> </attribute> <attribute> <name>regexp</name> <required>true</required> <rtexprvalue>false</rtexprvalue> </attribute>
RegexpTag
,
TextTag
,
RegexpData
,
TextData
,
Serialized FormField Summary |
---|
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
---|
bodyContent |
Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
id, pageContext |
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag |
---|
EVAL_BODY_BUFFERED, EVAL_BODY_TAG |
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 | |
---|---|
MatchTag()
|
Method Summary | |
---|---|
int |
doAfterBody()
Method called at end of each iteration of the match tag |
int |
doEndTag()
Method called at end of match Tag |
int |
doStartTag()
Setup to loop through matches found in the text using regexp |
java.lang.String |
getGroup(int i)
Returns the string for the group parenthesized number |
java.lang.String |
getMatch()
Returns the entire string that was matched on using <jsp:getProperty name="id" property="match"/> |
java.lang.String |
getPostMatch()
Returns the string after the current match using <jsp:getProperty name="id" property="postMatch"/> |
java.lang.String |
getPreMatch()
Returns the string preceding the current match using <jsp:getProperty name="id" property="preMatch"/> |
void |
setRegexp(java.lang.String str)
|
void |
setText(java.lang.String str)
|
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
---|
doInitBody, getBodyContent, getPreviousOut, release, setBodyContent |
Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
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 |
Methods inherited from interface javax.servlet.jsp.tagext.Tag |
---|
getParent, setPageContext, setParent |
Constructor Detail |
---|
public MatchTag()
Method Detail |
---|
public final int doStartTag() throws javax.servlet.jsp.JspException
doStartTag
in interface javax.servlet.jsp.tagext.Tag
doStartTag
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspException
public final int doAfterBody() throws javax.servlet.jsp.JspException
doAfterBody
in interface javax.servlet.jsp.tagext.IterationTag
doAfterBody
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspException
public final int doEndTag() throws javax.servlet.jsp.JspException
doEndTag
in interface javax.servlet.jsp.tagext.Tag
doEndTag
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspException
public final void setRegexp(java.lang.String str)
public final void setText(java.lang.String str)
public final java.lang.String getMatch()
public final java.lang.String getPreMatch()
public final java.lang.String getPostMatch()
public final java.lang.String getGroup(int i)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |