org.kaiwitte.workbench.tools
Class Tools

java.lang.Object
  extended by org.kaiwitte.workbench.tools.Tools

public final class Tools
extends java.lang.Object

A class to provide general tools for the project.


Method Summary
static java.lang.String readFile(java.lang.String filename)
          Reads a file to a String.
static java.lang.String readResource(java.lang.String resource)
          Reads a resouce to a String.
static java.lang.String replaceVariables(MetaRecord metaRecord, java.lang.String content)
          Replaces all variables with the format {recordname.columnname} in contentwith the according value in metaRecord.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

replaceVariables

public static java.lang.String replaceVariables(MetaRecord metaRecord,
                                                java.lang.String content)
Replaces all variables with the format
 {recordname.columnname}
 
in contentwith the according value in metaRecord.

Parameters:
metaRecord - the record with the values
content - the template text
Returns:
the modified text

readResource

public static java.lang.String readResource(java.lang.String resource)
                                     throws java.io.IOException
Reads a resouce to a String.

Parameters:
resource - the source
Returns:
the content
Throws:
java.io.IOException - iff an I/O error occurs

readFile

public static java.lang.String readFile(java.lang.String filename)
                                 throws java.io.IOException
Reads a file to a String.

Parameters:
filename - the name of the source file
Returns:
the content
Throws:
java.io.IOException - iff an I/O error occurs