Class XMLBasicSerialization
java.lang.Object
weka.core.xml.XMLSerialization
weka.core.xml.XMLBasicSerialization
- All Implemented Interfaces:
RevisionHandler
- Direct Known Subclasses:
XMLBeans, XMLClassifier, XMLExperiment
This serializer contains some read/write methods for common classes that
are not beans-conform. Currently supported are:
- java.util.HashMap
- java.util.HashSet
- java.util.Hashtable
- java.util.LinkedList
- java.util.Properties
- java.util.Stack
- java.util.TreeMap
- java.util.TreeSet
- java.util.Vector
- javax.swing.DefaultListModel
- weka.core.Matrix
- weka.core.matrix.Matrix
- Version:
- $Revision: 1.6 $
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringthe matrix cellsstatic final Stringthe value for a mapping-key, e.g., Mapsstatic final Stringthe value for mapping, e.g., Mapsstatic final Stringthe value for mapping-value, e.g., MapsFields inherited from class XMLSerialization
ATT_ARRAY, ATT_ARRAY_DEFAULT, ATT_CLASS, ATT_NAME, ATT_NULL, ATT_NULL_DEFAULT, ATT_PRIMITIVE, ATT_PRIMITIVE_DEFAULT, ATT_VERSION, DOCTYPE, ROOT_NODE, TAG_OBJECT, VAL_NO, VAL_ROOT, VAL_YES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()generates internally a new XML document and clears also the IgnoreList and the mappings for the Read/Write-MethodsReturns the revision string.readCollection(Element node) builds the Collection from the given DOM node.readCostMatrixOld(Element node) builds the Matrix (old) from the given DOM node.readDefaultListModel(Element node) builds the DefaultListModel from the given DOM node.builds the Map from the given DOM node.readMatrix(Element node) builds the Matrix from the given DOM node.readMatrixOld(Element node) builds the Matrix (old) from the given DOM node.writeCollection(Element parent, Object o, String name) adds the given Collection to a DOM structure.writeCostMatrixOld(Element parent, Object o, String name) adds the given CostMatrix (old) to a DOM structure.writeDefaultListModel(Element parent, Object o, String name) adds the given DefaultListModel to a DOM structure.adds the given Map to a DOM structure.writeMatrix(Element parent, Object o, String name) adds the given Matrix to a DOM structure.writeMatrixOld(Element parent, Object o, String name) adds the given Matrix (old) to a DOM structure.Methods inherited from class XMLSerialization
fromXML, getVersion, main, read, read, read, read, readBooleanFromXML, readByteFromXML, readCharFromXML, readDoubleFromXML, readFloatFromXML, readFromXML, readFromXML, readIntFromXML, readLongFromXML, readShortFromXML, toXML, write, write, write, write, writeToXML
-
Field Details
-
VAL_MAPPING
-
VAL_KEY
-
VAL_VALUE
-
VAL_CELLS
-
-
Constructor Details
-
XMLBasicSerialization
-
-
Method Details
-
clear
generates internally a new XML document and clears also the IgnoreList and the mappings for the Read/Write-Methods- Overrides:
clearin classXMLSerialization- Throws:
Exception- if initializing fails
-
writeDefaultListModel
adds the given DefaultListModel to a DOM structure.- Parameters:
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 object- Returns:
- the node that was created
- Throws:
Exception- if the DOM creation fails- See Also:
-
readDefaultListModel
-
writeCollection
adds the given Collection to a DOM structure.- Parameters:
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 object- Returns:
- the node that was created
- Throws:
Exception- if the DOM creation fails- See Also:
-
readCollection
-
writeMap
adds the given Map to a DOM structure.- Parameters:
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 object- Returns:
- the node that was created
- Throws:
Exception- if the DOM creation fails- See Also:
-
readMap
-
writeMatrix
adds the given Matrix to a DOM structure.- Parameters:
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 object- Returns:
- the node that was created
- Throws:
Exception- if the DOM creation fails- See Also:
-
readMatrix
-
writeMatrixOld
adds the given Matrix (old) to a DOM structure.- Parameters:
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 object- Returns:
- the node that was created
- Throws:
Exception- if the DOM creation fails- See Also:
-
readMatrixOld
-
writeCostMatrixOld
adds the given CostMatrix (old) to a DOM structure.- Parameters:
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 object- Returns:
- the node that was created
- Throws:
Exception- if the DOM creation fails- See Also:
-
readCostMatrixOld
-
getRevision
Returns the revision string.- Specified by:
getRevisionin interfaceRevisionHandler- Overrides:
getRevisionin classXMLSerialization- Returns:
- the revision
-