Chapter 4. Package org.kaiwitte.workbench.tools

Table of Contents

Class Tools
Synopsis
readFile(String)
readResource(String)
replaceVariables(MetaRecord, String, UIConfig)
Class UnmodifiableIterator
Synopsis

Class Tools

A class to provide general tools for the project.

Synopsis

 public final class Tools {
  public static String replaceVariables(MetaRecord metaRecord,
                                        String content,
                                        UIConfig config)
    throws IOException;

  public static String readResource(String resource)
    throws IOException;

  public static String readFile(String filename)
    throws IOException;

  public static IconCreator iconCreator(UIConfig config);
  public static Object sequenceToArray(net.tmorris.adt.sequence.Sequence s,
                                       java.lang.Class c);

}

Methods inherited from java.lang.Object: clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait

Inheritance Path. java.lang.Object-> org.kaiwitte.workbench.tools.Tools

readFile(String)

Synopsis: public static String readFile(java.lang.String filename) 
              throws java.io.IOException;

Parameters

filename

the name of the source file

return

the content

Exceptions

IOException

iff an I/O error occurs

Reads a file to a String.

readResource(String)

Synopsis: public static String readResource(java.lang.String resource) 
              throws java.io.IOException;

Parameters

resource

the source

return

the content

Exceptions

IOException

iff an I/O error occurs

Reads a resouce to a String.

replaceVariables(MetaRecord, String, UIConfig)

Synopsis: public static String replaceVariables(org.kaiwitte.workbench.data\
.MetaRecord metaRecord,

                                                java.lang.String content, 
                                                org.kaiwitte.workbench.ui.U\
IConfig config) 
              throws java.io.IOException;

Parameters

metaRecord

the record with the values

content

the template text

return

the modified text

Replaces all variables with the format

 {recordname.columnname}
 
in contentwith the according value in metaRecord.