Package weka.core.xml
Class XMLSerializationMethodHandler
java.lang.Object
weka.core.xml.XMLSerializationMethodHandler
- All Implemented Interfaces:
RevisionHandler
This class handles relationships between display names of properties (or
classes) and Methods that are associated with them. It differentiates between
read and write methods. It automatically stores public methods that have the
same signature as the
readFromXML() and
writeToXML() methods in the XMLSerialization class.- Version:
- $Revision: 10203 $
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptioninitializes the method handling, executes alsoclear(), which adds initial methods automatically. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()removes all current methods and adds the methods according to thestatic MethodfindReadMethod(Object o, String name) returns the method with the given name that has the same signature asreadFromXML()of theXMLSerialiationclass.static MethodfindWriteMethod(Object o, String name) returns the method with the given name that has the same signature aswriteToXML()of theXMLSerialiationclass.Returns the revision string.read()returns the handler for read methodsvoidadds read and write methods for the given class, i.e., read&;lt;name> and write<name> ("name" is prefixed by read and write)toString()returns the read and write method handlers as stringwrite()returns the handler for write methods
-
Constructor Details
-
Method Details
-
findReadMethod
returns the method with the given name that has the same signature asreadFromXML()of theXMLSerialiationclass. simplifies the adding of custom methods.- Parameters:
o- the object to inspectname- the name of the method to return- Returns:
- either
nullif no method was found or a reference - See Also:
-
findWriteMethod
returns the method with the given name that has the same signature aswriteToXML()of theXMLSerialiationclass. simplifies the adding of custom methods.- Parameters:
o- the object to inspectname- the name of the method to return- Returns:
- either
nullif no method was found or a reference - See Also:
-
clear
public void clear()removes all current methods and adds the methods according to the -
read
returns the handler for read methods- Returns:
- the methodhandler for read methods
-
write
returns the handler for write methods- Returns:
- the methodhandler for read methods
-
register
adds read and write methods for the given class, i.e., read&;lt;name> and write<name> ("name" is prefixed by read and write)- Parameters:
handler- the handler class that contains the read and write methodcls- the class to register the read and write method forname- the suffix of the read and write method
-
toString
returns the read and write method handlers as string -
getRevision
Returns the revision string.- Specified by:
getRevisionin interfaceRevisionHandler- Returns:
- the revision
-