Serialize an xml representation of a graph of objects into a writer.
Created: Feb 24, 2003
Copyright: Copyright (c) 2003
Assumptions: none
Requires: nothing
Required by: nothing
Revision History:
Example:
Config config = new Config(); config.setNumber(123); config.setString("acb"); XmlWriter writer = new XmlWriter("filename.xml"); writer.setRootObject(config); Would produce an xml file that might look like: <Config> <number>123</number> <string>abc</string> </Config>
Conventions:
- Xml elements representing a class will be in mixed case with the beginning of each word being upper case.
- Xml elements representing an attribute will be in mixed case with the exception of the very first letter which will be in lower case.
- Objects can contain other, non-primative objects which in turn will be reflected and have their attributes serialized in a hierachical, recursive fashion.
- Objects can have a List or Set of objects returned from a getter and that List or Set will be iterated through, serializing each of the List/Set elements. Note, however, that those elements MUST NOT be primative objects, ie you cannot have a getter called getString which returns a collection of String objects.
- An error in serialzing any object will abort writing the whole xml.
@author Donald Kittle
@version 1.0
@stereotype boundary