public class XMLExperiment extends XMLBasicSerialization
options
from the Experiment, since these are handled
by the get/set-methods. For the Classifier
class with all its
derivative classes it stores only debug
and options
.
For SplitEvaluator
and ResultProducer
only the
options are retrieved. The PropertyNode
is done manually since
it has no get/set-methods for its public fields.m_ClassFirst
we always save it
as false
.Experiment.m_ClassFirst
Modifier and Type | Field and Description |
---|---|
static String |
NAME_CLASSFIRST
the name of the classFirst property
|
static String |
NAME_PROPERTYNODE_PARENTCLASS
PropertyNode member
|
static String |
NAME_PROPERTYNODE_PROPERTY
PropertyNode member
|
static String |
NAME_PROPERTYNODE_VALUE
PropertyNode member
|
VAL_CELLS, VAL_KEY, VAL_MAPPING, VAL_VALUE
ATT_ARRAY, ATT_ARRAY_DEFAULT, ATT_CLASS, ATT_NAME, ATT_NULL, ATT_NULL_DEFAULT, ATT_PRIMITIVE, ATT_PRIMITIVE_DEFAULT, ATT_VERSION, DEBUG, DOCTYPE, m_ClassnameOverride, m_CurrentNode, m_CustomMethods, m_Document, m_Properties, ROOT_NODE, TAG_OBJECT, VAL_NO, VAL_ROOT, VAL_YES
Constructor and Description |
---|
XMLExperiment()
initializes the serialization
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
generates internally a new XML document and clears also the IgnoreList and
the mappings for the Read/Write-Methods
|
String |
getRevision()
Returns the revision string.
|
static void |
main(String[] args)
for testing only.
|
protected Object |
readPostProcess(Object o)
additional post-processing can happen in derived classes after reading
from XML.
|
Object |
readPropertyNode(Element node)
builds the PropertyNode from the given DOM node.
|
protected void |
writePostProcess(Object o)
enables derived classes to add other properties to the DOM tree, e.g.
|
Element |
writePropertyNode(Element parent,
Object o,
String name)
adds the given PropertyNode to a DOM structure.
|
readCollection, readCostMatrixOld, readDefaultListModel, readMap, readMatrix, readMatrixOld, writeCollection, writeCostMatrixOld, writeDefaultListModel, writeMap, writeMatrix, writeMatrixOld
addElement, addElement, addElement, booleanToString, determineClass, determineDescriptor, fromXML, getArrayDimensions, getDescriptorByName, getDescriptors, getPath, getPrimitive, getVersion, invokeReadFromXML, invokeWriteToXML, isPrimitiveArray, overrideClassname, overrideClassname, read, read, read, read, readBooleanFromXML, readByteFromXML, readCharFromXML, readDoubleFromXML, readFloatFromXML, readFromXML, readFromXML, readIntFromXML, readLongFromXML, readPreProcess, readShortFromXML, stringToBoolean, toXML, trace, write, write, write, write, writeBooleanToXML, writeByteToXML, writeCharToXML, writeDoubleToXML, writeFloatToXML, writeIntToXML, writeLongToXML, writePreProcess, writeShortToXML, writeToXML
public static final String NAME_CLASSFIRST
public static final String NAME_PROPERTYNODE_VALUE
public static final String NAME_PROPERTYNODE_PARENTCLASS
public static final String NAME_PROPERTYNODE_PROPERTY
public void clear() throws Exception
clear
in class XMLBasicSerialization
Exception
- if initializing failsprotected void writePostProcess(Object o) throws Exception
writePostProcess
in class XMLSerialization
o
- the object that is serialized into XMLException
- if post-processing failsprotected Object readPostProcess(Object o) throws Exception
readPostProcess
in class XMLSerialization
o
- the object to perform some additional processing onException
- if post-processing failspublic Element writePropertyNode(Element parent, Object o, String name) throws Exception
parent
- the parent of this object, e.g. the class this object is a member ofo
- the Object to describe in XMLname
- the name of the objectException
- if the DOM creation failspublic Object readPropertyNode(Element node) throws Exception
node
- the associated XML nodeException
- if instantiation failsDefaultListModel
public String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class XMLBasicSerialization
public static void main(String[] args) throws Exception
toString()
of the generated object.
Otherwise it loads the binary file, saves the XML representation in a
file with the original filename appended by ".xml" and once again in a
binary file with the original filename appended by ".exp".args
- the commandline argumentsException
- if something goes wrong, e.g., file not foundCopyright © 2015 University of Waikato, Hamilton, NZ. All rights reserved.