|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dhmp.io.AbstractMapInput
Abstract class for reading HierarchicalMap from InputStream.
Constructor Summary | |
AbstractMapInput(java.io.InputStream in)
Creates a new instance of MapInputStream |
Method Summary | |
void |
close()
Closes associated input source and releases any system resources associated with it. |
HierarchicalMap |
getBaseMap()
Returns current base map. |
protected abstract java.lang.String |
getKey()
|
protected abstract int |
getReference()
|
protected abstract int |
getType()
|
protected abstract java.lang.Object |
getValue()
|
protected void |
init()
|
void |
init(HierarchicalMap paramMap)
Initializes this class using the configuration passed. |
void |
init(java.lang.String config)
Initializes this class using the configuration passed. |
HierarchicalMap |
readMap()
Reads-in a HierarchicalMap from input source. |
protected HierarchicalMap |
readMap(MapStream.Path.Position pos,
java.lang.Object start,
java.lang.Object stop,
boolean readUntil)
|
HierarchicalMap |
readMap(java.lang.Object start)
Reads-in a HierarchicalMap from input source starting at specified node. |
HierarchicalMap |
readMap(java.lang.Object start,
java.lang.Object stop)
Reads-in a HierarchicalMap from input source starting at specified node and finishing at stopping node. |
HierarchicalMap |
readMapUntil()
Reads-in a HierarchicalMap from input source until first node is found. |
HierarchicalMap |
readMapUntil(java.lang.Object stop)
Reads-in a HierarchicalMap from input source until finishing node is found. |
java.lang.Object |
replace(java.lang.Object obj)
Replace the value read from input. |
void |
setBaseMap(HierarchicalMap baseMap)
Set the current base map. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AbstractMapInput(java.io.InputStream in)
in
- InputStream from where the maps are read.Method Detail |
public void init(java.lang.String config)
Valid configurations are (bold for default value):
init
in interface MapInput
config
- configuration used by this class.public void init(HierarchicalMap paramMap)
MapInput
init(String)
.
init
in interface MapInput
paramMap
- HierarchicalMap containing the configuration.protected void init()
public HierarchicalMap readMap() throws MapIOException
MapInput
readMap
in interface MapInput
MapIOException
- if an I/O error occurs or input stream can not be parsed to HierarchicalMap.public HierarchicalMap readMap(java.lang.Object start) throws MapIOException
MapInput
readMap
in interface MapInput
start
- node from where the reading starts.
MapIOException
- if an I/O error occurs or input stream can not be parsed to HierarchicalMap.public HierarchicalMap readMap(java.lang.Object start, java.lang.Object stop) throws MapIOException
MapInput
readMap
in interface MapInput
start
- node from where the reading starts.stop
- finish reading when this node is found.
MapIOException
- if an I/O error occurs or input stream can not be parsed to HierarchicalMap.public HierarchicalMap readMapUntil() throws MapIOException
MapInput
readMapUntil
in interface MapInput
MapIOException
- if an I/O error occurs or input stream can not be parsed to HierarchicalMap.public HierarchicalMap readMapUntil(java.lang.Object stop) throws MapIOException
MapInput
readMapUntil
in interface MapInput
stop
- finish reading when this node is found.
MapIOException
- if an I/O error occurs or input stream can not be parsed to HierarchicalMap.protected HierarchicalMap readMap(MapStream.Path.Position pos, java.lang.Object start, java.lang.Object stop, boolean readUntil) throws MapIOException
MapIOException
public void close() throws MapIOException
MapInput
close
in interface MapInput
MapIOException
- if an I/O error occurs.public java.lang.Object replace(java.lang.Object obj)
obj
- original object.
public HierarchicalMap getBaseMap()
MapInput
getBaseMap
in interface MapInput
public void setBaseMap(HierarchicalMap baseMap)
MapInput
setBaseMap
in interface MapInput
baseMap
- HierarchicalMap used as base for creating actual structure.protected abstract int getType() throws java.io.IOException
java.io.IOException
protected abstract java.lang.String getKey() throws java.io.IOException
java.io.IOException
protected abstract int getReference() throws java.io.IOException
java.io.IOException
protected abstract java.lang.Object getValue() throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |