|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.core.xml.XMLSerializationMethodHandler
public class XMLSerializationMethodHandler
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.
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 |
void |
register(java.lang.Object handler,
java.lang.Class cls,
java.lang.String name)
adds read and write methods for the given class, i.e., read&;lt;name> and write<name> ("name" is prefixed by read and write) |
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 |
---|
public XMLSerializationMethodHandler(java.lang.Object owner) throws java.lang.Exception
clear()
, which
adds initial methods automatically.
owner
- the owner to retrieve the methods from
java.lang.Exception
- if initialization failsclear()
Method Detail |
---|
public static java.lang.reflect.Method findReadMethod(java.lang.Object o, java.lang.String name)
readFromXML()
of the XMLSerialiation
class.
simplifies the adding of custom methods.
o
- the object to inspectname
- the name of the method to return
null
if no method was found or a referenceXMLSerialization.readFromXML(Element)
public static java.lang.reflect.Method findWriteMethod(java.lang.Object o, java.lang.String name)
writeToXML()
of the XMLSerialiation
class.
simplifies the adding of custom methods.
o
- the object to inspectname
- the name of the method to return
null
if no method was found or a referenceXMLSerialization.writeToXML(Element, Object, String)
public void clear()
public MethodHandler read()
public MethodHandler write()
public void register(java.lang.Object handler, java.lang.Class cls, java.lang.String name)
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 methodpublic java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |