autoweka
Class XmlSerializable

java.lang.Object
  extended by autoweka.XmlSerializable
Direct Known Subclasses:
Experiment, ExperimentBatch, TrajectoryGroup

public class XmlSerializable
extends java.lang.Object

Helper class to make objects easily be read to/from XML, as well as specifying them on the command line


Constructor Summary
XmlSerializable()
           
 
Method Summary
static
<T extends XmlSerializable>
T
fromXML(java.io.InputStream xml, java.lang.Class<T> c)
          Spits out an object from the given XML file with the given class
protected static
<T extends XmlSerializable>
T
fromXML(java.lang.String filename, java.lang.Class<T> c)
          Spits out an object from the given XML file with the given class
static void populateObjectFromCMDParams(java.lang.Object obj, java.util.Deque<java.lang.String> args)
          Given a list of command line arguments which have the same name as the XML nodes, populate me an object with the values filled in
static int populateObjectFromCMDParams(java.lang.Object obj, java.lang.String[] args)
          Given a list of command line arguments which have the same name as the XML nodes, populate me an object with the values filled in
 void toXML(java.io.OutputStream stream)
          Spits out the class to the given XML file
 void toXML(java.lang.String filename)
          Spits out the class to the given XML file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlSerializable

public XmlSerializable()
Method Detail

toXML

public void toXML(java.lang.String filename)
Spits out the class to the given XML file


toXML

public void toXML(java.io.OutputStream stream)
Spits out the class to the given XML file


fromXML

protected static <T extends XmlSerializable> T fromXML(java.lang.String filename,
                                                       java.lang.Class<T> c)
Spits out an object from the given XML file with the given class


fromXML

public static <T extends XmlSerializable> T fromXML(java.io.InputStream xml,
                                                    java.lang.Class<T> c)
Spits out an object from the given XML file with the given class


populateObjectFromCMDParams

public static int populateObjectFromCMDParams(java.lang.Object obj,
                                              java.lang.String[] args)
Given a list of command line arguments which have the same name as the XML nodes, populate me an object with the values filled in


populateObjectFromCMDParams

public static void populateObjectFromCMDParams(java.lang.Object obj,
                                               java.util.Deque<java.lang.String> args)
Given a list of command line arguments which have the same name as the XML nodes, populate me an object with the values filled in