weka.core.xml
Class XMLSerializationMethodHandler

java.lang.Object
  extended byweka.core.xml.XMLSerializationMethodHandler

public class XMLSerializationMethodHandler
extends java.lang.Object

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: 1.1.2.2 $
Author:
FracPete (fracpete at waikato dot ac dot nz)
See Also:
MethodHandler, XMLSerialization

Constructor Summary
XMLSerializationMethodHandler(java.lang.Object owner)
          initializes the method handling, executes also clear(), which adds initial methods automatically.
 
Method Summary
 void clear()
          removes all current methods and adds the methods according to the
static java.lang.reflect.Method findReadMethod(java.lang.Object o, java.lang.String name)
          returns the method with the given name that has the same signature as readFromXML() of the XMLSerialiation class.
static java.lang.reflect.Method findWriteMethod(java.lang.Object o, java.lang.String name)
          returns the method with the given name that has the same signature as writeToXML() of the XMLSerialiation class.
 MethodHandler read()
          returns the handler for read methods
 java.lang.String toString()
          returns the read and write method handlers as string
 MethodHandler write()
          returns the handler for write methods
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XMLSerializationMethodHandler

public XMLSerializationMethodHandler(java.lang.Object owner)
                              throws java.lang.Exception
initializes the method handling, executes also clear(), which adds initial methods automatically.

See Also:
clear()
Method Detail

findReadMethod

public static java.lang.reflect.Method findReadMethod(java.lang.Object o,
                                                      java.lang.String name)
returns the method with the given name that has the same signature as readFromXML() of the XMLSerialiation class. simplifies the adding of custom methods.

Returns:
either null if no method was found or a reference
See Also:
XMLSerialization.readFromXML(Element)

findWriteMethod

public static java.lang.reflect.Method findWriteMethod(java.lang.Object o,
                                                       java.lang.String name)
returns the method with the given name that has the same signature as writeToXML() of the XMLSerialiation class. simplifies the adding of custom methods.

Returns:
either null if no method was found or a reference
See Also:
XMLSerialization.writeToXML(Element, Object, String)

clear

public void clear()
removes all current methods and adds the methods according to the


read

public MethodHandler read()
returns the handler for read methods

Returns:
the methodhandler for read methods

write

public MethodHandler write()
returns the handler for write methods

Returns:
the methodhandler for read methods

toString

public java.lang.String toString()
returns the read and write method handlers as string

Returns:
the read/write method handlers as string