The generic approach of writing data as XML can be overriden by adding custom methods for reading/writing in a derived class (cf. m_Properties
, m_CustomMethods
).
Custom read and write methods must have the same signature (and also be public
!) as the readFromXML
and writeToXML
methods. Methods that apply to the naming rule read + property name
are added automatically to the list of methods by the method XMLSerializationMethodHandler.addMethods(...)
.
Other properties that are not conform the bean set/get-methods have to be processed manually in a derived class (cf. readPostProcess(Object)
, writePostProcess(Object)
).
For a complete XML serialization/deserialization have a look at the KOML
class.
If a stored class has a constructor that takes a String to initialize (e.g. String or Double) then the content of the tag will used for the constructor, e.g. from
<object name="name" class="String" primitive="no">Smith</object>"Smith" will be used to instantiate a String object as constructor argument.
@see KOML @see #fromXML(Document) @see #toXML(Object) @see #m_Properties @see #m_CustomMethods @see #readPostProcess(Object) @see #writePostProcess(Object) @see #readFromXML(Element) @see #writeToXML(Element,Object,String) @author FracPete (fracpete at waikato dot ac dot nz) @version $Revision: 1.16 $
|
|
|
|
|
|
|
|
|
|