Class TextTool

All Implemented Interfaces:
ITool, IVariable, Serializable, Cloneable

@OpenApiAll public class TextTool extends Tool
Contains utilities functions for text renderer. Recommended context name of this class is "text".
Since:
Jun 6, 2008
See Also:
  • Constructor Details

    • TextTool

      public TextTool()
  • Method Details

    • noLineBreak

      public String noLineBreak(String text)
      Remove all control characters such as U+0009 (Tab), U+000A (Line Feed) and U+000D (Carriage Return) from given text. This method will performs text filtering under category "Cc" in the Unicode specification.
      Parameters:
      text - input text
      Returns:
      new text
    • toInteger

      public Integer toInteger(String text)
      Convert the string argument to signed decimal integer.
      Parameters:
      text - a String containing the int representation to be converted
      Returns:
      the integer value represented by the argument in decimal
    • toDouble

      public Double toDouble(String text)
      Convert the string argument to signed decimal double.
      Parameters:
      text - a String containing the int representation to be converted
      Returns:
      the integer value represented by the argument in decimal
    • italic

      public ITool.HTMLString italic(String text)
      Force report to render given text in italic style.
      Parameters:
      text - input text
      Returns:
      HTML text in italic style.
    • bold

      public ITool.HTMLString bold(String text)
      Force report to render given text in bold style.
      Parameters:
      text - input text
      Returns:
      HTML text in bold style.
    • underline

      public ITool.HTMLString underline(String text)
      Force report to render given text in underline style.
      Parameters:
      text - input text
      Returns:
      HTML text in underline style.
    • html

      public ITool.HTMLString html(String text)
      Force report to render given text in HTML.

      For example:

          $text.html('<ul><li>A</li><li>B</li></ul>')
       

      Parameters:
      text - input text
      Returns:
      HTML text.
    • equals

      public boolean equals(String str1, String str2)
      Compares two strings. The result is true if and only if the str1 is represents the same sequence of characters as str2.
      Parameters:
      str1 - first string
      str2 - second string
      Returns:
      true if the String are equal; false otherwise.
    • getString

      public String getString(String str)
      Convert text from RTF into Java String.

      For example:

              #set ($str = $text.getString("bersetzer"))
       

      Parameters:
      str - a RTF text.
      Returns:
      a Java String
    • getPureText

      public String getPureText(String source)
      Get Pure text from html source.
      Parameters:
      source - The given html source.
      Returns:
      pure text from html source.