|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.turbine.util.parser.DataStreamParser
org.apache.turbine.util.parser.TSVParser
TSVParser is used to parse a stream with tab-separated values and generate ParameterParser objects which can be used to extract the values in the desired type.
The class extends the abstract class DataStreamParser and implements initTokenizer with suitable values for TSV files to provide this functionality.
The class (indirectly through DataStreamParser) implements the java.util.Iterator interface for convenience. This allows simple use in a Velocity template for example:
#foreach ($row in $tsvfile) Name: $row.Name Description: $row.Description #end
Field Summary |
Fields inherited from class org.apache.turbine.util.parser.DataStreamParser |
EMPTYFIELDNAME |
Constructor Summary | |
TSVParser(java.io.Reader in)
Create a new TSVParser instance. |
|
TSVParser(java.io.Reader in,
java.util.List columnNames)
Create a new TSVParser instance. |
|
TSVParser(java.io.Reader in,
java.util.List columnNames,
java.lang.String characterEncoding)
Create a new TSVParser instance. |
Method Summary | |
protected void |
initTokenizer(java.io.StreamTokenizer tokenizer)
Initialize the StreamTokenizer instance used to read the lines from the input reader. |
Methods inherited from class org.apache.turbine.util.parser.DataStreamParser |
getColumnNames, hasNext, hasNextRow, next, nextRow, readColumnNames, remove, setColumnNames, setFieldSeparator |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TSVParser(java.io.Reader in)
in
- the input reader.public TSVParser(java.io.Reader in, java.util.List columnNames)
in
- the input reader.columnNames
- a list of column names.public TSVParser(java.io.Reader in, java.util.List columnNames, java.lang.String characterEncoding)
in
- the input reader.columnNames
- a list of column names.characterEncoding
- the character encoding of the input.Method Detail |
protected void initTokenizer(java.io.StreamTokenizer tokenizer)
initTokenizer
in class DataStreamParser
tokenizer
- the tokenizer to adjust
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |