org.apache.tiles.autotag.tool

## Class StringTool

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

-     public class StringTool
      extends Object

  A Velocity tools to manipulate strings.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `StringTool()` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `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 © 2000–2026 Apache Software Foundation. All rights reserved.