edu.unika.aifb.owltools.utils
Class Printer

java.lang.Object
  extended by edu.unika.aifb.owltools.utils.Printer

public class Printer
extends java.lang.Object

Printer offers static sinks for different kind of messages. Using this in a central place we can easily send the different kinds of output to different places.


Field Summary
 java.lang.String error
          Place to save error output (for example in HTML'ed output)
 boolean html
          Is the output to be HTML-escaped?
 boolean verbose
          Should verbose output be shown or not?
 boolean warning
          Should warnings be shown or not?
 java.io.PrintWriter writer
          Saves the writer for the printer
 
Constructor Summary
Printer()
           
 
Method Summary
 void close()
          closes the writer.
 void debug(int m)
          Used for detailed messages.
 void debug(java.lang.String m)
          Used for development messages
 void error(java.lang.String m)
          Used for error messages.
 java.lang.String getOutput()
          get the internally saved output
 void print(java.lang.Object m)
          Used for usual messages, that actually are not part of the output.
 void put(java.lang.Object m)
          Used for the output of the program.
 void putline(java.lang.Object m)
          Used for the output of the program (ending the output with a new line).
 void setFile(java.lang.String filename)
          The output will be saved to a file
 void setString()
          the output needs to be saved internally
 void verbose(int m)
          Used for detailed messages.
 void verbose(java.lang.String m)
          Used for detailed messages.
 void warning(int m)
          Used for warnings.
 void warning(java.lang.String m)
          Used for warnings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

verbose

public boolean verbose
Should verbose output be shown or not?


warning

public boolean warning
Should warnings be shown or not?


writer

public java.io.PrintWriter writer
Saves the writer for the printer


html

public boolean html
Is the output to be HTML-escaped?


error

public java.lang.String error
Place to save error output (for example in HTML'ed output)

Constructor Detail

Printer

public Printer()
Method Detail

setFile

public void setFile(java.lang.String filename)
The output will be saved to a file

Parameters:
filename - The name of the file where the output is to be saved

setString

public void setString()
the output needs to be saved internally


getOutput

public java.lang.String getOutput()
get the internally saved output

Returns:
The saved output

close

public void close()
closes the writer. If the output was sent to a file, the files is saved now. Otherwise, the output is lost


print

public void print(java.lang.Object m)
Used for usual messages, that actually are not part of the output. Is always sent to the System.out

Parameters:
m - the message

verbose

public void verbose(java.lang.String m)
Used for detailed messages. Sent to System.out, if verbose is switched on

Parameters:
m - the message

verbose

public void verbose(int m)
Used for detailed messages. Sent to System.out, if verbose is switched on

Parameters:
m - the message

warning

public void warning(java.lang.String m)
Used for warnings. Sent to System.out, if warning is switched on

Parameters:
m - the message

warning

public void warning(int m)
Used for warnings. Sent to System.out, if warning is switched on

Parameters:
m - the message

debug

public void debug(java.lang.String m)
Used for development messages

Parameters:
m - the message

debug

public void debug(int m)
Used for detailed messages. Sent to System.out, if verbose is switched on

Parameters:
m - the message

putline

public void putline(java.lang.Object m)
Used for the output of the program (ending the output with a new line).

Parameters:
m - the message

put

public void put(java.lang.Object m)
Used for the output of the program.

Parameters:
m - the message

error

public void error(java.lang.String m)
Used for error messages.

Parameters:
m - the message