Package org.apache.tiles.autotag.tool
Class StringTool
java.lang.Object
org.apache.tiles.autotag.tool.StringTool
A Velocity tools to manipulate strings.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncapitalizeFirstLetter
(String string) Creates a string in which the first character is capitalized.getClassToCast
(String type) Returns the class to be used to cast an Object.getDefaultValue
(String type, String overriddenDefaultValue) Returns the default value for a type.splitOnNewlines
(String toSplit) Creates a list of strings, separating a string when a newline is encountered.
-
Constructor Details
-
StringTool
public StringTool()Constructor.
-
-
Method Details
-
splitOnNewlines
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
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
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
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.
-