flattree.tree
Class ValueLeaf

java.lang.Object
  extended by flattree.tree.AbstractLeaf
      extended by flattree.tree.ValueLeaf
All Implemented Interfaces:
Leaf
Direct Known Subclasses:
DelimitedLeaf, FixedLengthLeaf, SyntheticLeaf

public abstract class ValueLeaf
extends AbstractLeaf

Base class for leaves with a value.

See Also:
setName(String), State.putValue(String, String), State.getValue(String)

Field Summary
 
Fields inherited from interface flattree.tree.Leaf
REQUIRED
 
Constructor Summary
protected ValueLeaf()
           
protected ValueLeaf(String name)
           
 
Method Summary
 String getName()
           
protected  boolean readImpl(ReadLine line, State state)
          Do the actual reading.
protected abstract  String readValue(ReadLine line)
          Read this leaf's value from the given line.
 void setName(String name)
           
protected  void writeImpl(WriteLine line, State state)
          Do the actual writing.
protected abstract  void writeValue(WriteLine line, String value)
           
 
Methods inherited from class flattree.tree.AbstractLeaf
getThrowOnRead, read, setThrowOnRead, throwOnRead, throwOnRead, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueLeaf

protected ValueLeaf()

ValueLeaf

protected ValueLeaf(String name)
Method Detail

getName

public String getName()

setName

public void setName(String name)

writeImpl

protected void writeImpl(WriteLine line,
                         State state)
Description copied from class: AbstractLeaf
Do the actual writing.

Specified by:
writeImpl in class AbstractLeaf

writeValue

protected abstract void writeValue(WriteLine line,
                                   String value)

readImpl

protected boolean readImpl(ReadLine line,
                           State state)
Description copied from class: AbstractLeaf
Do the actual reading.

Specified by:
readImpl in class AbstractLeaf

readValue

protected abstract String readValue(ReadLine line)
Read this leaf's value from the given line.

Parameters:
line - line to read from
Returns:
value or null if this leaf cannot be read from the given line
See Also:
AbstractLeaf.setThrowOnRead(boolean)


Copyright © 2011. All Rights Reserved.