Interface XMLizable

All Known Subinterfaces:
All Known Implementing Classes:
CustomLexicon, JokeGraph, JokeGraphEdge, JokeGraphNode, JokeGraphNodeKeyword, JokeGraphNodeTemplate, JokeSet, JokeStructure, Keyword, Lexeme, LexemeSet, Options, OptionsCloudFrontend, OptionsJokeGeneration, OptionsLexicon, OptionsPackage, Profile, ProfileCloudFrontend, ProfileJokeGeneration, ProfileLexicon, StructElement, Topic, WordForm, WordSequence, WordString, WordStruct

public interface XMLizable

An object that implements this interface can be written to (and read from) an XML element. This interface only specifies the writing to XML -- it is the responsibility of the implementing class to take care of how the reading, and subsequent instantiation, is handled. Typically it may be a constructor which takes an Element, or it may be a static method, e.g. public static Object readXML(Element e).

Note that XMLizable elements need not necessarily be saved to an entire XML file -- that is what the XMLsaveable subinterface is for. For example, a Lexeme implements XMLizable but not XMLsaveable. It can be written as an element within an XLMsaveable object such as a CustomLexicon.

Ruli Manurung
See Also:

Method Summary
 void writeXML(Writer out, String indent)
          This method writes the necessary information contained within an instance to an XML file.

Method Detail


void writeXML(Writer out,
              String indent)
              throws IOException,
This method writes the necessary information contained within an instance to an XML file.

out - The output stream for the XML file, which is assumed to be already opened and writable.
indent - A string to be prepended before every line written by this method. If passed appropriate white space, e.g. XMLUtils.xmlIndent, it can be used to control indentation.