org.apache.taglibs.string
Class StringTagSupport

java.lang.Object
  extended byjavax.servlet.jsp.tagext.TagSupport
      extended byjavax.servlet.jsp.tagext.BodyTagSupport
          extended byorg.apache.taglibs.string.StringTagSupport
All Implemented Interfaces:
javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag
Direct Known Subclasses:
CapitalizeAllWordsTag, CapitalizeTag, CenterTag, ChompTag, ChopNewlineTag, ChopTag, CountMatchesTag, CountTag, DecodeUrlTag, DefaultTag, DeleteTag, EncodeUrlTag, EscapeTag, GetChompTag, GetPrechompTag, JoinTag, LeftPadTag, LeftTag, LengthTag, LowerCaseTag, MetaphoneTag, MidTag, NestedStringTag, OverlayTag, PrechompTag, QuoteRegexpTag, RandomStringTag, RemoveXmlTag, RepeatTag, ReplaceTag, ReverseDelimitedStringTag, ReverseTag, RightPadTag, RightTag, SoundexTag, SplitTag, SqueezeTag, StripEndTag, StripStartTag, StripTag, SubstringTag, SwapCaseTag, TrimTag, TruncateNicelyTag, UncapitalizeTag, UpperCaseTag, WordWrapTag

public abstract class StringTagSupport
extends javax.servlet.jsp.tagext.BodyTagSupport

Abstract support class for the String Taglib. It handles the JSP taglib side of things and calls abstract protected methods to delegate the String functionality.

var
PageContext variable to put the return result in instead of pushing out to the html page.

Author:
bayard@generationjava.com
See Also:
Serialized Form

Field 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
StringTagSupport()
          Empty constructor.
 
Method Summary
abstract  java.lang.String changeString(java.lang.String str)
          Perform a transformation on the passed in String.
 int doEndTag()
          Handles the manipulation of the String tag, evaluating the body of the tag.
 java.lang.Object evaluateString(java.lang.String str)
          Perform an operation on the passed String.
 java.lang.String getVar()
          Get the PageContext attribute to store the result in.
 void initAttributes()
          Initialise any properties to default values.
 void setVar(java.lang.String var)
          Set the PageContext attribute to store the result in.
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doInitBody, doStartTag, 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

StringTagSupport

public StringTagSupport()
Empty constructor. Initialises the attributes.

Method Detail

getVar

public java.lang.String getVar()
Get the PageContext attribute to store the result in.


setVar

public void setVar(java.lang.String var)
Set the PageContext attribute to store the result in.


doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
Handles the manipulation of the String tag, evaluating the body of the tag. The evaluation is delegated to the changeString(String) method

Throws:
javax.servlet.jsp.JspException

evaluateString

public java.lang.Object evaluateString(java.lang.String str)
                                throws javax.servlet.jsp.JspException
Perform an operation on the passed String. The object returned by this operation (if not null) will be associated to PageContext attribute represented by this.var.

Parameters:
str - String to be manipulated
Returns:
Object result of operation upon passed String
Throws:
javax.servlet.jsp.JspException

changeString

public abstract java.lang.String changeString(java.lang.String str)
                                       throws javax.servlet.jsp.JspException
Perform a transformation on the passed in String.

Parameters:
str - String to be manipulated
Returns:
String result of operation upon passed in String
Throws:
javax.servlet.jsp.JspException

initAttributes

public void initAttributes()
Initialise any properties to default values. This method is called upon construction, and after changeString(String) is called. This is a default empty implementation.



Copyright ? 2000-2004 The Apache Software Foundation. All Rights Reserved.