org.xins.common.xml
Class ElementSerializer

java.lang.Object
  extended byorg.xins.common.xml.ElementSerializer

public final class ElementSerializer
extends Object

Serializer that takes an Element and converts it to an XML string.

This class is not thread-safe. It should only be used on one thread at a time.

Since:
XINS 1.1.0
Version:
$Revision: 1.19 $ $Date: 2006/11/03 14:35:53 $
Author:
Anthony Goubard, Ernst de Haan

Constructor Summary
ElementSerializer()
          Constructs a new ElementSerializer.
 
Method Summary
 void output(XMLOutputter out, Element element)
          Generates XML for the specified Element.
 String serialize(Element element)
          Serializes the element to XML.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElementSerializer

public ElementSerializer()
Constructs a new ElementSerializer.

Method Detail

serialize

public String serialize(Element element)
                 throws IllegalArgumentException
Serializes the element to XML. This method is not reentrant. Hence, it should only be used from a single thread.

Parameters:
element - the element to serialize, cannot be null.
Returns:
an XML document that represents element, never null.
Throws:
IllegalArgumentException - if element == null.

output

public void output(XMLOutputter out,
                   Element element)
            throws NullPointerException,
                   IOException
Generates XML for the specified Element.

Parameters:
out - the XMLOutputter to use, cannot be null.
element - the Element object to convert to XML, cannot be null.
Throws:
NullPointerException - if out == null || element == null.
IOException - if there is an I/O error.


See http://www.xins.org/.