cookxml.core.util
Class TextUtils

java.lang.Object
  extended by cookxml.core.util.TextUtils

public class TextUtils
extends Object

Useful functions dealing with texts.

Since:
CookXml 3.1

Constructor Summary
TextUtils()
           
 
Method Summary
static String getText(Element elm)
          Get the text of an element.
static String readText(String input)
          This function reads from the file/resource using the default class loader for CookXml.
static String readText(String input, ClassLoader classLoader)
          This function reads from the file/resource using the ClassLoader provided.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextUtils

public TextUtils()
Method Detail

readText

public static String readText(String input,
                              ClassLoader classLoader)
                       throws IOException
This function reads from the file/resource using the ClassLoader provided.

Parameters:
input - the input file/resource location
classLoader - the ClassLoader that is used to locate the resource
Returns:
the text read.
Throws:
IOException - in case of error.
See Also:
ClassLoader

readText

public static String readText(String input)
                       throws IOException
This function reads from the file/resource using the default class loader for CookXml.

Parameters:
input - the input file/resource location
Returns:
the text read.
Throws:
IOException - in case of error.
See Also:
CookXml.getDefaultClassLoader()

getText

public static String getText(Element elm)
Get the text of an element.

Parameters:
elm - the element that contains the text.
Returns:
the text in the element.