flattree.tree
Class EscapedDelimitedLeaf

java.lang.Object
  extended by flattree.tree.AbstractLeaf
      extended by flattree.tree.ValueLeaf
          extended by flattree.tree.DelimitedLeaf
              extended by flattree.tree.EscapedDelimitedLeaf
All Implemented Interfaces:
Leaf

public class EscapedDelimitedLeaf
extends DelimitedLeaf

A DelimitedLeaf which escapes delimiters contained in its value.

See Also:
setEscape(char)

Field Summary
static char DEFAULT_ESCAPE
           
 
Fields inherited from class flattree.tree.DelimitedLeaf
DEFAULT_DELIMITER
 
Fields inherited from interface flattree.tree.Leaf
REQUIRED
 
Constructor Summary
EscapedDelimitedLeaf()
           
EscapedDelimitedLeaf(String name, char delimiter)
           
EscapedDelimitedLeaf(String name, char delimiter, char escape)
           
 
Method Summary
 char getEscape()
           
 String readValue(ReadLine line)
          Read this leaf's value from the given line.
 void setEscape(char escape)
          Set the characters to escape delimiters with.
 void writeValue(WriteLine line, String value)
           
 
Methods inherited from class flattree.tree.DelimitedLeaf
getDelimiter, getDelimiterRequired, isDelimiter, setDelimiter, setDelimiterRequired, writeDelimiter
 
Methods inherited from class flattree.tree.ValueLeaf
getName, readImpl, setName, writeImpl
 
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
 

Field Detail

DEFAULT_ESCAPE

public static final char DEFAULT_ESCAPE
See Also:
Constant Field Values
Constructor Detail

EscapedDelimitedLeaf

public EscapedDelimitedLeaf()

EscapedDelimitedLeaf

public EscapedDelimitedLeaf(String name,
                            char delimiter)

EscapedDelimitedLeaf

public EscapedDelimitedLeaf(String name,
                            char delimiter,
                            char escape)
Method Detail

getEscape

public char getEscape()

setEscape

public void setEscape(char escape)
Set the characters to escape delimiters with.

Parameters:
escape - escape character
Throws:
IllegalArgumentException - if escape is 0

writeValue

public void writeValue(WriteLine line,
                       String value)
Overrides:
writeValue in class DelimitedLeaf

readValue

public String readValue(ReadLine line)
Description copied from class: ValueLeaf
Read this leaf's value from the given line.

Overrides:
readValue in class DelimitedLeaf
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.