wox.serial
Class SimpleWriter

java.lang.Object
  extended by wox.serial.TypeMapping
      extended by wox.serial.SimpleWriter
All Implemented Interfaces:
ObjectWriter, Serial

public class SimpleWriter
extends TypeMapping
implements ObjectWriter

This is a simple object to XML serializer. The SimpleWriter class implements ObjectWriter. It writes (converts) an object to a JDOM element. The JDOM element represents the object in standard XML defined by WOX. The resulting XML (JDOM element) can be used to be stored in an XML file, or other storage media. For more information about the XML representation please visit: http://woxserializer.sourceforge.net/

Version:
SimpleWriter.java - 1.0
Author:
Simon M. Lucas
Carlos R. Jaimez Gonzalez

Field Summary
 
Fields inherited from class wox.serial.TypeMapping
mapArrayJavaToWOX, mapArrayWOXToJava, mapJavaToWOX, mapWOXToJava
 
Fields inherited from interface wox.serial.Serial
ARRAY, ARRAYLIST, DECLARED, ELEMENT_TYPE, ENTRY, FIELD, ID, IDREF, KEY, KEY_TYPE, LENGTH, MAP, NAME, OBJECT, primitiveArrays, primitiveArraysWOX, primitives, primitiveWrappers, TYPE, VALUE, VALUE_TYPE
 
Constructor Summary
SimpleWriter()
          Default constructor.
 
Method Summary
 org.jdom.Element write(java.lang.Object ob)
          This is the only public method of SimpleWriter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleWriter

public SimpleWriter()
Default constructor. Initializes the map for object references.

Method Detail

write

public org.jdom.Element write(java.lang.Object ob)
This is the only public method of SimpleWriter. This method is the etry point to write an object to XML. It actually returns a JDOM Element representing the object passed as parameter. The JDOM element is a standard XML representation defined by WOX. It can be used to be stored in an XML file, or any other storage media.

Specified by:
write in interface ObjectWriter
Parameters:
ob - The java object to be serialized.
Returns:
The serialized object as a JDOM element.