|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dhmp.io.AbstractMapOutput
Abstract class for writing HierarchicalMap to OutputStream.
Field Summary | |
static boolean |
AUTOCOMMIT_OFF
|
static boolean |
AUTOCOMMIT_ON
|
Constructor Summary | |
AbstractMapOutput(java.io.OutputStream out)
Creates a new instance of MapOutputStream |
Method Summary | |
void |
close()
Closes this output stream and releases any system resources associated with the stream. |
protected void |
closeElements(MapStream.Path.Position lastPos)
|
protected void |
closeExclude(MapStream.Path.Position lastPos)
|
protected abstract void |
elementReference(java.lang.String key,
java.lang.Object value,
java.lang.String reference,
int index,
boolean last)
|
protected abstract void |
elementValue(java.lang.Object key,
java.lang.Object value,
boolean last)
|
protected abstract void |
endDocument()
|
protected abstract void |
endElement(java.lang.String key,
boolean last)
|
void |
flush()
Flushes this output stream and forces any buffered output bytes to be written out. |
protected void |
flush(MapStream.Path.Position pos)
|
void |
flushAll()
Flushes this output stream and also ends any HierarchicalMap written so far. |
void |
init(HierarchicalMap paramMap)
Initializes this class using the configuration passed. |
void |
init(java.lang.String config)
Initializes this class using the configuration passed. |
java.lang.Object |
replace(java.lang.Object obj)
Replace the value actually written to the output. |
protected abstract void |
startDocument()
|
protected abstract void |
startElement(java.lang.String key)
|
MapOutput |
writeMap(HierarchicalMap map)
Writes out a HierarchicalMap to output drain. |
protected MapStream.Path.Position |
writeMap(MapStream.Path.Position pos,
java.lang.Object key,
HierarchicalMap map)
|
MapOutput |
writeMap(java.lang.Object start,
HierarchicalMap map)
Writes out a HierarchicalMap to output drain relative to the start. |
MapOutput |
writeMap(java.lang.String path)
Writes a HierarchicalMap where each of the elements that composes the path are represented as nested nodes. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final boolean AUTOCOMMIT_ON
public static final boolean AUTOCOMMIT_OFF
Constructor Detail |
public AbstractMapOutput(java.io.OutputStream out)
out
- OutputStream to where the maps are written.Method Detail |
public void init(java.lang.String config)
Valid configurations are (bold for default value):
init
in interface MapOutput
config
- configuration used by this class.public void init(HierarchicalMap paramMap)
MapOutput
init(String)
.
Configuration change is accepted until the first writing method is called.
init
in interface MapOutput
paramMap
- HierarchicalMap containing the configuration.public MapOutput writeMap(java.lang.String path) throws MapIOException
MapOutput
writeMap("a/b/c")
is similar to the following code:
map.add("a/b/c")
writeMap(map)
writeMap
in interface MapOutput
path
- each element of the key is written as node.
MapIOException
- if an I/O error occurs.public MapOutput writeMap(HierarchicalMap map) throws MapIOException
MapOutput
writeMap
in interface MapOutput
map
- HierarchicalMap to be written to the output.
MapIOException
- if an I/O error occurs.public MapOutput writeMap(java.lang.Object start, HierarchicalMap map) throws MapIOException
MapOutput
writeMap
in interface MapOutput
map
- HierarchicalMap to be written to the output.start
- node from where the writing starts.
MapIOException
- if an I/O error occurs.protected MapStream.Path.Position writeMap(MapStream.Path.Position pos, java.lang.Object key, HierarchicalMap map) throws MapIOException
MapIOException
protected void closeElements(MapStream.Path.Position lastPos) throws java.io.IOException
java.io.IOException
protected void closeExclude(MapStream.Path.Position lastPos) throws java.io.IOException
java.io.IOException
public void close()
MapOutput
close
in interface MapOutput
public void flush()
MapOutput
flush
in interface MapOutput
public void flushAll()
MapOutput
flushAll
in interface MapOutput
protected void flush(MapStream.Path.Position pos)
public java.lang.Object replace(java.lang.Object obj)
obj
- original object.
protected abstract void startElement(java.lang.String key) throws java.io.IOException
java.io.IOException
protected abstract void endElement(java.lang.String key, boolean last) throws java.io.IOException
java.io.IOException
protected abstract void elementValue(java.lang.Object key, java.lang.Object value, boolean last) throws java.io.IOException
java.io.IOException
protected abstract void elementReference(java.lang.String key, java.lang.Object value, java.lang.String reference, int index, boolean last) throws java.io.IOException
java.io.IOException
protected abstract void startDocument() throws java.io.IOException
java.io.IOException
protected abstract void endDocument() throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |