|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectthings.data.impl.ThingsPropertyTrunkIO
public class ThingsPropertyTrunkIO
An IO implementation for a property trunk.
The id is the file path, which is the usual contract for a ThingsPropertyTrunk. However, you can also init() it yourself and use your own id. It uses readers through the Accessor, so it can come from any source and it should handle any character encoding. (NOTE: When using UTF-8 from a file, sometimes you have to deal with the marker yourself. Just try it and see what happens.)
The value rules are inherited by ThingsPropertyReaderToolkit.decodeString.
Version History
EPG - Initial - 28 NOV 04
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface things.data.ThingsPropertyTrunk |
---|
ThingsPropertyTrunk.Mode |
Constructor Summary | |
---|---|
ThingsPropertyTrunkIO()
Constructor. |
Method Summary | |
---|---|
void |
endRead()
End a read transfer. |
void |
endWrite()
End a wrote transfer. |
ThingsPropertyTrunk.Mode |
getMode()
Get the current Mode. |
void |
init(java.lang.String id,
Accessor accessItem)
Sets the ID. |
NV |
readNext()
Read the next property. |
void |
startRead()
Start a read. |
void |
startWrite()
Start a write transfer. |
void |
writeNext(NVImmutable item)
Write the next property |
void |
writeNext(java.lang.String name,
java.lang.String value)
Write the next property |
void |
writeNextMultivalue(java.lang.String name,
java.lang.String... values)
Write the next property that is a multivalue. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ThingsPropertyTrunkIO()
Method Detail |
---|
public void init(java.lang.String id, Accessor accessItem) throws ThingsException
init
in interface ThingsPropertyTrunk
id
- An idaccessItem
- A way to read and write the data.
ThingsException
public ThingsPropertyTrunk.Mode getMode()
getMode
in interface ThingsPropertyTrunk
public void startRead() throws ThingsException
startRead
in interface ThingsPropertyTrunk
ThingsException
public void endRead() throws ThingsException
endRead
in interface ThingsPropertyTrunk
ThingsException
public void startWrite() throws ThingsException
startWrite
in interface ThingsPropertyTrunk
ThingsException
public void endWrite() throws ThingsException
endWrite
in interface ThingsPropertyTrunk
ThingsException
public void writeNext(java.lang.String name, java.lang.String value) throws ThingsException
writeNext
in interface ThingsPropertyTrunk
name
- The property name as a stringvalue
- The property value as a string
ThingsException
public void writeNext(NVImmutable item) throws ThingsException
writeNext
in interface ThingsPropertyTrunk
item
- the next property as an NVImmutable.
ThingsException
NVImmutable
public void writeNextMultivalue(java.lang.String name, java.lang.String... values) throws ThingsException
writeNextMultivalue
in interface ThingsPropertyTrunk
name
- The property name as a stringvalues
- The property values
ThingsException
public NV readNext() throws ThingsException
readNext
in interface ThingsPropertyTrunk
ThingsException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |