autoweka

## Class XmlSerializable

- java.lang.Object
- - autoweka.XmlSerializable

- Direct Known Subclasses:
    Configuration, ConfigurationCollection, 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

    Constructors
    Constructor and Description
    `XmlSerializable()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `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
      Parameters:
        `filename` - The name of the file to write.

    - #### toXML

          public void toXML(java.io.OutputStream stream)

      Spits out the class to the given XML file
      Parameters:
        `stream` - The stream to write to.

    - #### 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
      Type Parameters:
        `T` - The type of the class.
      Parameters:
        `filename` - The name of the file to read.
        `c` - The class.
      Returns:
        The read object.

    - #### 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
      Type Parameters:
        `T` - The type of the class.
      Parameters:
        `xml` - The input stream to read.
        `c` - The class.
      Returns:
        The read object.

    - #### 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
      Parameters:
        `obj` - The object to populate.
        `args` - The arguments.
      Returns:
        The number of arguments.

    - #### 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
      Parameters:
        `obj` - The object to populate.
        `args` - The arguments.