Package weka.core.xml
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.LinkedHashMap
- 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
- java.awt.Color
- weka.core.Matrix
- weka.core.matrix.Matrix
- Version:
- $Revision: 11865 $
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
the matrix cellsstatic final String
the value for a mapping-key, e.g., Mapsstatic final String
the value for mapping, e.g., Mapsstatic final String
the value for mapping-value, e.g., MapsFields inherited from class weka.core.xml.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, SUPPRESS_PROPERTY_WARNINGS, TAG_OBJECT, VAL_NO, VAL_ROOT, VAL_YES
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
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.builds the Color object from the given DOM node.readCostMatrix
(Element node) builds the Matrix 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.writeColor
(Element parent, Object o, String name) adds the given Color to a DOM structure.writeCostMatrix
(Element parent, Object o, String name) adds the given CostMatrix 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 weka.core.xml.XMLSerialization
fromXML, getVersion, main, read, read, read, read, readBooleanFromXML, readByteFromXML, readCharFromXML, readDoubleFromXML, readFloatFromXML, readFromXML, readFromXML, readIntFromXML, readLongFromXML, readShortFromXML, setSuppressWarnings, toXML, write, write, write, write, writeToXML
-
Field Details
-
VAL_MAPPING
the value for mapping, e.g., Maps- See Also:
-
VAL_KEY
the value for a mapping-key, e.g., Maps- See Also:
-
VAL_VALUE
the value for mapping-value, e.g., Maps- See Also:
-
VAL_CELLS
the matrix cells- See Also:
-
-
Constructor Details
-
XMLBasicSerialization
initializes the serialization- Throws:
Exception
- if initialization fails
-
-
Method Details
-
clear
generates internally a new XML document and clears also the IgnoreList and the mappings for the Read/Write-Methods- Overrides:
clear
in classXMLSerialization
- Throws:
Exception
- if initializing fails
-
writeColor
adds the given Color to a DOM structure. -
readColor
builds the Color object from the given DOM node. -
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
builds the DefaultListModel from the given DOM node.- Parameters:
node
- the associated XML node- Returns:
- the instance created from the XML description
- Throws:
Exception
- if instantiation fails- See Also:
-
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
builds the Collection from the given DOM node.- Parameters:
node
- the associated XML node- Returns:
- the instance created from the XML description
- Throws:
Exception
- if instantiation fails- See Also:
-
writeMap
adds the given Map to a DOM structure. -
readMap
builds the Map from the given DOM node. -
writeCostMatrix
adds the given CostMatrix 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:
-
readCostMatrix
builds the Matrix from the given DOM node.- Parameters:
node
- the associated XML node- Returns:
- the instance created from the XML description
- Throws:
Exception
- if instantiation fails- See Also:
-
writeMatrix
adds the given Matrix to a DOM structure. -
readMatrix
builds the Matrix from the given DOM node. -
writeMatrixOld
adds the given Matrix (old) to a DOM structure. -
readMatrixOld
builds the Matrix (old) from the given DOM node. -
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
builds the Matrix (old) from the given DOM node.- Parameters:
node
- the associated XML node- Returns:
- the instance created from the XML description
- Throws:
Exception
- if instantiation fails- See Also:
-
getRevision
Returns the revision string.- Specified by:
getRevision
in interfaceRevisionHandler
- Overrides:
getRevision
in classXMLSerialization
- Returns:
- the revision
-