weka.core.xml
Class XMLBasicSerialization

java.lang.Object
  extended byweka.core.xml.XMLSerialization
      extended byweka.core.xml.XMLBasicSerialization
Direct Known Subclasses:
XMLClassifier, XMLExperiment

public class XMLBasicSerialization
extends XMLSerialization

This serializer contains some read/write methods for common classes that are not beans-conform.

Version:
$Revision: 1.1.2.2 $
Author:
FracPete (fracpete at waikato dot ac dot nz)

Field Summary
 
Fields inherited from class weka.core.xml.XMLSerialization
ATT_ARRAY, ATT_CLASS, ATT_NAME, ATT_PRIMITIVE, ATT_VERSION, DOCTYPE, ROOT_NODE, TAG_OBJECT, VAL_NO, VAL_ROOT, VAL_YES
 
Constructor Summary
XMLBasicSerialization()
          initializes the serialization
 
Method Summary
 void clear()
          generates internally a new XML document and clears also the IgnoreList and the mappings for the Read/Write-Methods
static void main(java.lang.String[] args)
          for testing only
 java.lang.Object readDefaultListModel(org.w3c.dom.Element node)
          builds the DefaultListModel from the given DOM node.
 void writeDefaultListModel(org.w3c.dom.Element parent, java.lang.Object o, java.lang.String name)
          adds the given DefaultListModel to a DOM structure.
 
Methods inherited from class weka.core.xml.XMLSerialization
fromXML, getVersion, read, read, read, read, readFromXML, toXML, write, write, write, write, writeToXML
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLBasicSerialization

public XMLBasicSerialization()
                      throws java.lang.Exception
initializes the serialization

Throws:
java.lang.Exception - if initialization fails
Method Detail

clear

public void clear()
           throws java.lang.Exception
generates internally a new XML document and clears also the IgnoreList and the mappings for the Read/Write-Methods

Overrides:
clear in class XMLSerialization
Throws:
java.lang.Exception

writeDefaultListModel

public void writeDefaultListModel(org.w3c.dom.Element parent,
                                  java.lang.Object o,
                                  java.lang.String name)
                           throws java.lang.Exception
adds the given DefaultListModel to a DOM structure.

Parameters:
parent - the parent of this object, e.g. the class this object is a member of
o - the Object to describe in XML
name - the name of the object
Throws:
java.lang.Exception - if the DOM creation fails
See Also:
DefaultListModel

readDefaultListModel

public java.lang.Object readDefaultListModel(org.w3c.dom.Element node)
                                      throws java.lang.Exception
builds the DefaultListModel from the given DOM node.

Parameters:
node - the associated XML node
Returns:
the instance created from the XML description
Throws:
java.lang.Exception - if instantiation fails
See Also:
DefaultListModel

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
for testing only

Throws:
java.lang.Exception