org.apache.tiles.autotag.tool
Class StringTool

Package class diagram package StringTool
java.lang.Object
  extended by org.apache.tiles.autotag.tool.StringTool

public class StringTool
extends Object

A Velocity tools to manipulate strings.

Version:
$Rev: 1044707 $ $Date: 2010-12-11 15:35:57 -0500 (Sat, 11 Dec 2010) $

Constructor Summary
StringTool()
          Constructor.
 
Method Summary
 String capitalizeFirstLetter(String string)
          Creates a string in which the first character is capitalized.
 String getClassToCast(String type)
          Returns the class to be used to cast an Object.
 String getDefaultValue(String type, String overriddenDefaultValue)
          Returns the default value for a type.
 List<String> splitOnNewlines(String toSplit)
          Creates a list of strings, separating a string when a newline is encountered.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringTool

public StringTool()
Constructor.

Method Detail

splitOnNewlines

public List<String> splitOnNewlines(String toSplit)
Creates a list of strings, separating a string when a newline is encountered.

Parameters:
toSplit - The string to split.
Returns:
The list of splitted strings.

capitalizeFirstLetter

public String capitalizeFirstLetter(String string)
Creates a string in which the first character is capitalized.

Parameters:
string - The string to use.
Returns:
The same string with the first character capitalized.

getDefaultValue

public String getDefaultValue(String type,
                              String overriddenDefaultValue)
Returns the default value for a type.

Parameters:
type - The type.
overriddenDefaultValue - The default value, as specified by developers.
Returns:
The default value to use.

getClassToCast

public String getClassToCast(String type)
Returns the class to be used to cast an Object.

Parameters:
type - The type to use, even a primitive type.
Returns:
The class to be used in casts.


Copyright © 2001-2012 Apache Software Foundation. All Rights Reserved.