org.apache.taglibs.string
Class ReplaceTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by org.apache.taglibs.string.StringTagSupport
              extended by org.apache.taglibs.string.ReplaceTag
All Implemented Interfaces:
java.io.Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.Tag

public class ReplaceTag
extends StringTagSupport

Replace a specified substring with another string. A number of times may be specified to say how many times to replace the substring.

replace
Value to find to replace. Required.
with
Value to replace with. Required.
count
Number of times to replace. Default is all matches.
newlineToken
Token to use as a newline. This gets around the pain of haivng a literal newline in the jsp. By default this is ignored.
carriageToken
Token to use as a carriage return. This gets around the pain of haivng a literal carriage return in the jsp. By default this is ignored.

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
ReplaceTag()
           
 
Method Summary
 java.lang.String changeString(java.lang.String text)
          Perform a transformation on the passed in String.
 java.lang.String getCarriageToken()
          Get the carriageToken property
 java.lang.String getCount()
          Get the count property
 java.lang.String getNewlineToken()
          Get the newlineToken property
 java.lang.String getReplace()
          Get the replace property
 java.lang.String getWith()
          Get the with property
 void initAttributes()
          Initialise any properties to default values.
 void setCarriageToken(java.lang.String carriageToken)
          Set the carriageToken property
 void setCount(java.lang.String count)
          Set the count property
 void setNewlineToken(java.lang.String newlineToken)
          Set the newlineToken property
 void setReplace(java.lang.String replace)
          Set the replace property
 void setWith(java.lang.String with)
          Set the with property
 
Methods inherited from class org.apache.taglibs.string.StringTagSupport
doEndTag, evaluateString, getVar, setVar
 
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

ReplaceTag

public ReplaceTag()
Method Detail

getReplace

public java.lang.String getReplace()
Get the replace property

Returns:
String property

setReplace

public void setReplace(java.lang.String replace)
Set the replace property

Parameters:
replace - String property

getNewlineToken

public java.lang.String getNewlineToken()
Get the newlineToken property

Returns:
String property

setNewlineToken

public void setNewlineToken(java.lang.String newlineToken)
Set the newlineToken property

Parameters:
newlineToken - String property

getCarriageToken

public java.lang.String getCarriageToken()
Get the carriageToken property

Returns:
String property

setCarriageToken

public void setCarriageToken(java.lang.String carriageToken)
Set the carriageToken property

Parameters:
carriageToken - String property

getWith

public java.lang.String getWith()
Get the with property

Returns:
String property

setWith

public void setWith(java.lang.String with)
Set the with property

Parameters:
with - String property

getCount

public java.lang.String getCount()
Get the count property

Returns:
String property

setCount

public void setCount(java.lang.String count)
Set the count property

Parameters:
count - String property

changeString

public java.lang.String changeString(java.lang.String text)
                              throws javax.servlet.jsp.JspException
Description copied from class: StringTagSupport
Perform a transformation on the passed in String.

Specified by:
changeString in class StringTagSupport
Parameters:
text - String to be manipulated
Returns:
String result of operation upon passed in String
Throws:
javax.servlet.jsp.JspException

initAttributes

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

Overrides:
initAttributes in class StringTagSupport


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