classycle.util
Class Text

java.lang.Object
  extended by classycle.util.Text

public class Text
extends java.lang.Object

Collection of useful static method concerning string manipulation.

Author:
Franz-Josef Elmer

Method Summary
static java.lang.String excapeForXML(java.lang.String text)
          Escapes special XML characters in the specified text.
static java.lang.String readTextFile(java.io.File file)
          Reads multi-line text from the specified file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

excapeForXML

public static java.lang.String excapeForXML(java.lang.String text)
Escapes special XML characters in the specified text.

Parameters:
text - Text to be escaped. Must be not null.
Returns:
copy of the text where the special XML characters has been replaced by the escape sequences.

readTextFile

public static java.lang.String readTextFile(java.io.File file)
                                     throws java.io.IOException
Reads multi-line text from the specified file.

Parameters:
file - Text file.
Returns:
read text file with standard Java newline characters.
Throws:
java.io.IOException - if some reading error occurs.