Class StringTool

java.lang.Object
org.apache.tiles.autotag.tool.StringTool

public class StringTool extends Object
A Velocity tools to manipulate strings.
  • Constructor Details

    • StringTool

      public StringTool()
      Constructor.
  • Method Details

    • 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.