Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Content layer
id63861144
Content column
id63861146
Content block
id63861141

On this page

Table of Contents
maxLevel4
minLevel4

Content block
id63861145
Image Removed

Image Added

A Class diagram: TextTool

noLineBreak(String text)

This method removes all control characters such as U+0009 (Tab), U+000A (Line Feed), and U+000D (Carriage Return) from a given text. This method also filters text under the category "Cc" in the Unicode specification. 


Info
iconfalse
titleAn example of a use case that contains multiple lines

Code line:

    $usecase.name

The output:

Line 1

Line 2

Line 3

Info
iconfalse
titleAn example of the $text.noLineBreak() method

Code line:

	$text.noLineBreak($usecase.name)

The output:

	Line 1 Line 2 Line 3


toInteger(String text)

This method converts a string argument to a signed decimal integer.


Info
iconfalse
titleAn example of the toInteger(String text) method

Code line:

	#set ($int = $text.toInteger('2'))
	#set ($result = $int + 1)
	Result is $result


toDouble(String text)

This method converts a string argument to a signed decimal double.


Info
iconfalse
titleAn example of the toDouble(String text) method

Code line:

	#set ($d = $text.toDouble('10.1'))
	#set ($result = $d + 2)
	Result is $result


italic(String text)

This method forces a report to render a given text in the italic style.


Info
iconfalse
titleAn example of the italic(String text) method

Code line:

    The $text.italic($class.name) must provide interface for web services.

The output:

The BusinessServices must provide interface for web services.


bold(String text)

This method forces a report to render a given text in the bold style.


Info
iconfalse
titleAn example of the bold(String text) method

Code line:

    Method $text.bold($operator.name) must be implemented by implementation class.

The output:

Method doService must be implemented by implementation class.



underline(String text)

This method forces a report to render a given text in the underlined style. 


Info
iconfalse
titleAn example of the underline(String text) method

Code line:

    Attribute $text.underline ($attribute.name) contains a service name.

The output:

Attribute serverName contains a service name.



html(String text)

This method forces a report to render a given text as HTML.


Info
iconfalse
titleAn example of the html(String text) method

Code line:

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

The output:

  • A
  • B


For more information on supported HTML tags, see Appendix D: HTML Tag Support.


getString(String text)

This methods converts text from RTF to a Java String.


Info
iconfalse
titleAn example of the getString(String text) method

Code line:

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

The output:

Ubersetzer


equals(String str1, String str2)

This method compares two strings. The result will be true if and only if str1 represents the same sequence of characters as str2 does. This method supports RTF text comparison.


Info
iconfalse
titleAn example of the equals(String str1, String str2) method

Code line:

    #set ($str = $text.getString("Ubersetzer"))
    #if ($text.equals($str, "Ubersetzer"))
        true
    #end


getPureText(

htmlString

String HTMLString)

This method gets plain text from an HTML documentation. All HTML tags that are applied to the text will be removed from the text. Only plain text would be returned.


Info
iconfalse
titleAn example of the getPureText(htmlString String HTMLString) method

Code line:

	#set (\$html = '<html><body><b>Text</b></body></html>')
	$text.getPureText($html)