jp.terasoluna.fw.web.taglib
Class TrimTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by jp.terasoluna.fw.web.taglib.StringFormatterTagBase
          extended by jp.terasoluna.fw.web.taglib.TrimTag
All Implemented Interfaces:
java.io.Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag

public class TrimTag
extends StringFormatterTagBase

Implementation class of trim tag that deletes the white space on both the sides (left and right side) of the string.

Deletes the white space on both the sides (left and right) of the string by using trim() method of jp.terasoluna.fw.util.StringUtil class.

Inherits jp.terasoluna.web.taglib.StringFormatterTagBase for tag attribute and scripting variable. For details, refer to jp.terasoluna.web.taglib.StringFormatterTagBase document. .

For the characters that have been identified as white space, refer to the documents of jp.terasoluna.fw.util.StringUtilclass.

To output the "field001" property value of "form0001" bean by trimming the white space on both the sides, see the following example.

Example:

  <t:trim name="form0001"
             property="field001" />
 

To set the bean property in "trimmed" scripting variable without outputting it to the custom tag, see the following example.

Example:

  <t:trim id="trimmed"
             name="form0001"
             property="field001" />
 

In the following example, the string to be trimmed is not derived from bean but specified in the value attribute of custom tag.

Example:

  <t:trim value="String before deleting the white space on both the sides (left and right) " />
 

See Also:
StringFormatterTagBase, Serialized Form

Field Summary
private static long serialVersionUID
          Serial version ID
protected  boolean zenkaku
          Full-width space trim attribute.
 
Fields inherited from class jp.terasoluna.fw.web.taglib.StringFormatterTagBase
filter, id, ignore, name, property, replaceSpToNbsp, scope, value
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext
 
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
TrimTag()
           
 
Method Summary
protected  java.lang.String doFormat(java.lang.String s)
          Deletes the white space on the right side of specified string.
 boolean getZenkaku()
          Fetches full-width space trim attribute.
 void setZenkaku(boolean zenkaku)
          Sets full-width space trim attribute.
 
Methods inherited from class jp.terasoluna.fw.web.taglib.StringFormatterTagBase
doStartTag, getFilter, getId, getIgnore, getName, getProperty, getReplaceSpToNbsp, getScope, getValue, release, setFilter, setId, setIgnore, setName, setProperty, setReplaceSpToNbsp, setScope, setValue
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getParent, getValue, getValues, removeValue, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serial version ID

See Also:
Constant Field Values

zenkaku

protected boolean zenkaku
Full-width space trim attribute.

Constructor Detail

TrimTag

public TrimTag()
Method Detail

getZenkaku

public boolean getZenkaku()
Fetches full-width space trim attribute.

Returns:
Full-width space trim attribute

setZenkaku

public void setZenkaku(boolean zenkaku)
Sets full-width space trim attribute.

Parameters:
zenkaku - Full-width space trim attribute

doFormat

protected java.lang.String doFormat(java.lang.String s)

Deletes white space on the right side of specified string.

Specified by:
doFormat in class StringFormatterTagBase
Parameters:
s - String to be formatted
Returns:
String in which the white space on both the sides (left and right side) is deleted.