org.alicebot.server.core.util
Class XMLWriter

java.lang.Object
  extended by org.alicebot.server.core.util.XMLWriter

public class XMLWriter
extends java.lang.Object

Provides a simplistic XML file writing facility.

The facility is simplistic because it does not use any XML libraries; instead, it just has a hard-coded root element for each document type, and each time it gets some text, it looks at the end of a file for the closing tag, deletes it, appends the text, and then re-adds the closing tag. Yuck! :-)

Version:
4.1.3
Author:
Noel Bush

Constructor Summary
XMLWriter()
           
 
Method Summary
static void rollover(XMLResourceSpec spec)
          Rolls over a spec (renames current file designated by a spec, and creates a new one with starttime and backlink set to the previous one).
static void write(java.lang.String message, XMLResourceSpec spec)
          Writes a message to an XML file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLWriter

public XMLWriter()
Method Detail

write

public static void write(java.lang.String message,
                         XMLResourceSpec spec)
Writes a message to an XML file.

Parameters:
message - the text of the log event
spec - provides information about the XML resource to which to write

rollover

public static void rollover(XMLResourceSpec spec)
Rolls over a spec (renames current file designated by a spec, and creates a new one with starttime and backlink set to the previous one).

Parameters:
spec - describes the resource