org.dhmp.io
Class XMLMapOutputStream

java.lang.Object
  extended byorg.dhmp.io.AbstractMapOutput
      extended byorg.dhmp.io.XMLMapOutputStream
All Implemented Interfaces:
MapOutput

public class XMLMapOutputStream
extends AbstractMapOutput

This class writes XML output generated from HierarchicalMap.

Author:
hideyuki

Field Summary
 
Fields inherited from class org.dhmp.io.AbstractMapOutput
AUTOCOMMIT_OFF, AUTOCOMMIT_ON
 
Constructor Summary
XMLMapOutputStream(java.io.OutputStream out)
          Creates a new instance of XMLMapOutputStream.
XMLMapOutputStream(java.io.OutputStream out, java.nio.charset.Charset cs)
          Creates a new instance of XMLMapOutputStream.
XMLMapOutputStream(java.io.OutputStream out, java.lang.String charsetName)
          Creates a new instance of XMLMapOutputStream.
 
Method Summary
 void close()
          Closes this output stream and releases any system resources associated with the stream.
protected  void elementReference(java.lang.String key, java.lang.Object value, java.lang.String reference, int index, boolean last)
           
protected  void elementValue(java.lang.Object key, java.lang.Object value, boolean last)
           
protected  void endDocument()
           
protected  void endElement(java.lang.String key, boolean last)
           
 void flush()
          Flushes this output stream and forces any buffered output bytes to be written out.
 void flushAll()
          Flushes this output stream and also ends any HierarchicalMap written so far.
protected  void init()
           
 void init(HierarchicalMap paramMap)
          Initializes this class using the configuration passed.
protected  void startDocument()
           
protected  void startElement(java.lang.String key)
           
 
Methods inherited from class org.dhmp.io.AbstractMapOutput
closeElements, closeExclude, flush, init, replace, writeMap, writeMap, writeMap, writeMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLMapOutputStream

public XMLMapOutputStream(java.io.OutputStream out)
                   throws MapIOException
Creates a new instance of XMLMapOutputStream.

Parameters:
out - OutputStream to where the maps are written.
Throws:
MapIOException

XMLMapOutputStream

public XMLMapOutputStream(java.io.OutputStream out,
                          java.lang.String charsetName)
                   throws MapIOException
Creates a new instance of XMLMapOutputStream.

Parameters:
out - OutputStream to where the maps are written.
charsetName - name of charset to be used.
Throws:
MapIOException

XMLMapOutputStream

public XMLMapOutputStream(java.io.OutputStream out,
                          java.nio.charset.Charset cs)
                   throws MapIOException
Creates a new instance of XMLMapOutputStream.

Parameters:
out - OutputStream to where the maps are written.
cs - charset to be used.
Throws:
MapIOException
Method Detail

init

protected void init()

init

public void init(HierarchicalMap paramMap)
Description copied from interface: MapOutput
Initializes this class using the configuration passed. The configuration must be created using HierarchicalMap. The valid parameters are the same as from init(String). Configuration change is accepted until the first writing method is called.

Specified by:
init in interface MapOutput
Overrides:
init in class AbstractMapOutput

flush

public void flush()
Description copied from interface: MapOutput
Flushes this output stream and forces any buffered output bytes to be written out.

Specified by:
flush in interface MapOutput
Overrides:
flush in class AbstractMapOutput

flushAll

public void flushAll()
Description copied from interface: MapOutput
Flushes this output stream and also ends any HierarchicalMap written so far.

Specified by:
flushAll in interface MapOutput
Overrides:
flushAll in class AbstractMapOutput

close

public void close()
Description copied from interface: MapOutput
Closes this output stream and releases any system resources associated with the stream.

Specified by:
close in interface MapOutput
Overrides:
close in class AbstractMapOutput

startElement

protected void startElement(java.lang.String key)
                     throws java.io.IOException
Specified by:
startElement in class AbstractMapOutput
Throws:
java.io.IOException

endElement

protected void endElement(java.lang.String key,
                          boolean last)
                   throws java.io.IOException
Specified by:
endElement in class AbstractMapOutput
Throws:
java.io.IOException

elementValue

protected void elementValue(java.lang.Object key,
                            java.lang.Object value,
                            boolean last)
                     throws java.io.IOException
Specified by:
elementValue in class AbstractMapOutput
Throws:
java.io.IOException

elementReference

protected void elementReference(java.lang.String key,
                                java.lang.Object value,
                                java.lang.String reference,
                                int index,
                                boolean last)
                         throws java.io.IOException
Specified by:
elementReference in class AbstractMapOutput
Throws:
java.io.IOException

startDocument

protected void startDocument()
                      throws java.io.IOException
Specified by:
startDocument in class AbstractMapOutput
Throws:
java.io.IOException

endDocument

protected void endDocument()
                    throws java.io.IOException
Specified by:
endDocument in class AbstractMapOutput
Throws:
java.io.IOException