org.apache.commons.jelly.tags.util
Class ReplaceTag

java.lang.Object
  extended byorg.apache.commons.jelly.TagSupport
      extended byorg.apache.commons.jelly.tags.util.ReplaceTag
All Implemented Interfaces:
org.apache.commons.jelly.Tag

public class ReplaceTag
extends org.apache.commons.jelly.TagSupport

A tag that replaces occurrences of a character or string in its body or (or value) and places the result into the context

Author:
dion

Field Summary
private static org.apache.commons.logging.Log log
          The Log to which logging calls will be made.
private  java.lang.String newChar
          the new character that will replace the old
private  java.lang.String newString
          the new string that will replace the old
private  java.lang.String oldChar
          the old character to be replaced
private  java.lang.String oldString
          the old string to be replace
private  org.apache.commons.jelly.expression.Expression value
          The expression to evaluate.
private  java.lang.String var
          The variable name to export.
 
Fields inherited from class org.apache.commons.jelly.TagSupport
body, context, hasTrimmed, parent, shouldTrim
 
Constructor Summary
ReplaceTag()
           
 
Method Summary
 void doTag(org.apache.commons.jelly.XMLOutput output)
           
 java.lang.String getNew()
          Returns the newString that will be replaced.
 java.lang.String getNewChar()
          Returns the newChar used in replacing.
 java.lang.String getOld()
          Returns the oldString that will be replaced.
 java.lang.String getOldChar()
          Returns the oldChar that will be replaced.
 org.apache.commons.jelly.expression.Expression getValue()
          Returns the value.
 java.lang.String getVar()
          Returns the var.
 void setNew(java.lang.String newString)
          Sets the newString.
 void setNewChar(java.lang.String newChar)
          Sets the newChar.
 void setOld(java.lang.String oldString)
          Sets the oldString.
 void setOldChar(java.lang.String oldChar)
          Sets the oldChar.
 void setValue(org.apache.commons.jelly.expression.Expression value)
          Sets the value.
 void setVar(java.lang.String var)
          Sets the var.
 
Methods inherited from class org.apache.commons.jelly.TagSupport
findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isEscapeText, isTrim, setBody, setContext, setEscapeText, setParent, setTrim, trimBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.apache.commons.logging.Log log
The Log to which logging calls will be made.


var

private java.lang.String var
The variable name to export.


value

private org.apache.commons.jelly.expression.Expression value
The expression to evaluate.


oldChar

private java.lang.String oldChar
the old character to be replaced


newChar

private java.lang.String newChar
the new character that will replace the old


oldString

private java.lang.String oldString
the old string to be replace


newString

private java.lang.String newString
the new string that will replace the old

Constructor Detail

ReplaceTag

public ReplaceTag()
Method Detail

doTag

public void doTag(org.apache.commons.jelly.XMLOutput output)
           throws org.apache.commons.jelly.MissingAttributeException,
                  org.apache.commons.jelly.JellyTagException
Throws:
org.apache.commons.jelly.MissingAttributeException
org.apache.commons.jelly.JellyTagException

getNewChar

public java.lang.String getNewChar()
Returns the newChar used in replacing. Should only be a single character.

Returns:
String

getOldChar

public java.lang.String getOldChar()
Returns the oldChar that will be replaced. Should only be a single character.

Returns:
String

getNew

public java.lang.String getNew()
Returns the newString that will be replaced.

Returns:
String

getOld

public java.lang.String getOld()
Returns the oldString that will be replaced.

Returns:
String

getValue

public org.apache.commons.jelly.expression.Expression getValue()
Returns the value.

Returns:
Expression

getVar

public java.lang.String getVar()
Returns the var.

Returns:
String

setNewChar

public void setNewChar(java.lang.String newChar)
Sets the newChar.

Parameters:
newChar - The newChar to set

setOldChar

public void setOldChar(java.lang.String oldChar)
Sets the oldChar.

Parameters:
oldChar - The oldChar to set

setNew

public void setNew(java.lang.String newString)
Sets the newString.

Parameters:
newString - The newString to set

setOld

public void setOld(java.lang.String oldString)
Sets the oldString.

Parameters:
oldString - The oldString to set

setValue

public void setValue(org.apache.commons.jelly.expression.Expression value)
Sets the value.

Parameters:
value - The value to set

setVar

public void setVar(java.lang.String var)
Sets the var.

Parameters:
var - The var to set