flattree.tree
Class QuotedDelimitedLeaf

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

public class QuotedDelimitedLeaf
extends DelimitedLeaf

A DelimitedLeaf which quotes its value. The quotes can be configured to be optional or required.

See Also:
setQuoteStart(char), setQuoteEnd(char), setQuoteRequired(boolean)

Field Summary
static char DEFAULT_QUOTE
           
 
Fields inherited from class flattree.tree.DelimitedLeaf
DEFAULT_DELIMITER
 
Fields inherited from interface flattree.tree.Leaf
REQUIRED
 
Constructor Summary
QuotedDelimitedLeaf()
           
QuotedDelimitedLeaf(String name, char delimiter, boolean delimiterRequired, char quote, boolean quoteRequired)
           
QuotedDelimitedLeaf(String name, char delimiter, boolean delimiterRequired, char quoteStart, char quoteEnd, boolean quoteRequired)
           
QuotedDelimitedLeaf(String name, char delimiter, char quote)
           
QuotedDelimitedLeaf(String name, char delimiter, char quote, boolean quoteRequired)
           
QuotedDelimitedLeaf(String name, char delimiter, char quoteStart, char quoteEnd, boolean quoteRequired)
           
 
Method Summary
 char getQuoteEnd()
           
 boolean getQuoteRequired()
           
 char getQuoteStart()
           
 String readValue(ReadLine line)
          Read this leaf's value from the given line.
 void setQuoteEnd(char quoteEnd)
           
 void setQuoteRequired(boolean quoteRequired)
           
 void setQuoteStart(char quoteStart)
           
 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_QUOTE

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

QuotedDelimitedLeaf

public QuotedDelimitedLeaf()

QuotedDelimitedLeaf

public QuotedDelimitedLeaf(String name,
                           char delimiter,
                           char quote)

QuotedDelimitedLeaf

public QuotedDelimitedLeaf(String name,
                           char delimiter,
                           char quote,
                           boolean quoteRequired)

QuotedDelimitedLeaf

public QuotedDelimitedLeaf(String name,
                           char delimiter,
                           boolean delimiterRequired,
                           char quote,
                           boolean quoteRequired)

QuotedDelimitedLeaf

public QuotedDelimitedLeaf(String name,
                           char delimiter,
                           char quoteStart,
                           char quoteEnd,
                           boolean quoteRequired)

QuotedDelimitedLeaf

public QuotedDelimitedLeaf(String name,
                           char delimiter,
                           boolean delimiterRequired,
                           char quoteStart,
                           char quoteEnd,
                           boolean quoteRequired)
Method Detail

setQuoteStart

public void setQuoteStart(char quoteStart)

setQuoteEnd

public void setQuoteEnd(char quoteEnd)

setQuoteRequired

public void setQuoteRequired(boolean quoteRequired)

getQuoteStart

public char getQuoteStart()

getQuoteEnd

public char getQuoteEnd()

getQuoteRequired

public boolean getQuoteRequired()

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.