org.jscience.util.logging
Class XMLWriter

java.lang.Object
  extended by org.jscience.util.logging.AbstractLogWriter
      extended by org.jscience.util.logging.XMLWriter
All Implemented Interfaces:
java.io.Closeable, Filter<LogEntry>, LogWriter

public class XMLWriter
extends AbstractLogWriter
implements java.io.Closeable

writes LogEntry objects formatted as XML to either a PrintStream or PrintWriter. As the XMLWriter uses a PrintStream/PrintWriter to write the log entries, no exception is thrown during logging. You'll have to check the PrintStream/PrintWriter object to check for errors.


Field Summary
 
Fields inherited from class org.jscience.util.logging.AbstractLogWriter
filter, formatter
 
Constructor Summary
XMLWriter(java.io.PrintStream ps)
          Creates a new XMLWriter object.
XMLWriter(java.io.PrintWriter pw)
          Creates a new XMLWriter object.
 
Method Summary
 void close()
          DOCUMENT ME!
 void flush()
          only needed if getAlwaysFlush() returns false
 boolean getAlwaysFlush()
          true by default
 java.io.PrintStream getPrintStream()
          DOCUMENT ME!
 java.io.PrintWriter getPrintWriter()
          DOCUMENT ME!
 void setAlwaysFlush(boolean flag)
          DOCUMENT ME!
 void writeLogEntry(java.lang.Object pattern)
          DOCUMENT ME!
 
Methods inherited from class org.jscience.util.logging.AbstractLogWriter
accept, getLogFilter, getLogFormatter, setLogFilter, setLogFormatter, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLWriter

public XMLWriter(java.io.PrintStream ps)
Creates a new XMLWriter object.

Parameters:
ps - DOCUMENT ME!

XMLWriter

public XMLWriter(java.io.PrintWriter pw)
Creates a new XMLWriter object.

Parameters:
pw - DOCUMENT ME!
Method Detail

getPrintStream

public java.io.PrintStream getPrintStream()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getPrintWriter

public java.io.PrintWriter getPrintWriter()
DOCUMENT ME!

Returns:
DOCUMENT ME!

flush

public void flush()
only needed if getAlwaysFlush() returns false


setAlwaysFlush

public void setAlwaysFlush(boolean flag)
DOCUMENT ME!

Parameters:
flag - DOCUMENT ME!

getAlwaysFlush

public boolean getAlwaysFlush()
true by default

Returns:
DOCUMENT ME!

writeLogEntry

public void writeLogEntry(java.lang.Object pattern)
DOCUMENT ME!

Specified by:
writeLogEntry in class AbstractLogWriter
Parameters:
pattern - DOCUMENT ME!

close

public void close()
DOCUMENT ME!

Specified by:
close in interface java.io.Closeable