org.objectweb.jonas_lib.xml
Class XMLSerializer

java.lang.Object
  extended by org.objectweb.jonas_lib.xml.XMLSerializer

public class XMLSerializer
extends java.lang.Object

Serialize a given DOM Document. Handle namespaces nicely.

Author:
Guillaume Sauthier

Constructor Summary
XMLSerializer(org.w3c.dom.Document doc)
          Creates a new XMLSerializer object.
 
Method Summary
 void serialize(java.io.OutputStream os)
          Serialize the encapsulated Document into the OutputStream
 void serialize(java.io.Writer writer)
          Serialize the encapsulated Document into the Writer
 void setIndent(int indent)
          Set the format line indent value.
 void setLineSeparator(java.lang.String sep)
          Set the format line separator character.
 void setLineWidth(int width)
          Set the format line width value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLSerializer

public XMLSerializer(org.w3c.dom.Document doc)
Creates a new XMLSerializer object.

Parameters:
doc - Document to be serialized
Method Detail

setLineSeparator

public void setLineSeparator(java.lang.String sep)
Set the format line separator character.

Parameters:
sep - line separator character

setLineWidth

public void setLineWidth(int width)
Set the format line width value.

Parameters:
width - line width value

setIndent

public void setIndent(int indent)
Set the format line indent value.

Parameters:
indent - line indent value

serialize

public void serialize(java.io.OutputStream os)
               throws java.io.IOException
Serialize the encapsulated Document into the OutputStream

Parameters:
os - output stream
Throws:
java.io.IOException - When serialization fails

serialize

public void serialize(java.io.Writer writer)
               throws java.io.IOException
Serialize the encapsulated Document into the Writer

Parameters:
writer - writer
Throws:
java.io.IOException - When serialization fails