Package org.apache.fulcrum.parser
Klasse TSVParser
java.lang.Object
org.apache.fulcrum.parser.DataStreamParser
org.apache.fulcrum.parser.TSVParser
- Alle implementierten Schnittstellen:
Iterator<ValueParser>
,org.apache.avalon.framework.logger.LogEnabled
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
- Version:
- $Id$
- Autor:
- Sean Legassick
-
Feldübersicht
Von Klasse geerbte Felder org.apache.fulcrum.parser.DataStreamParser
log
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected void
initTokenizer
(StreamTokenizer tokenizer) Initialize the StreamTokenizer instance used to read the lines from the input reader.Von Klasse geerbte Methoden org.apache.fulcrum.parser.DataStreamParser
enableLogging, hasNext, hasNextRow, next, nextRow, readColumnNames, remove, setColumnNames
Von Klasse geerbte Methoden java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Von Schnittstelle geerbte Methoden java.util.Iterator
forEachRemaining
-
Konstruktordetails
-
TSVParser
Create a new TSVParser instance. Requires a Reader to read the tab-separated values from. The column headers must be set independently either explicitly, or by reading the first line of the TSV values.- Parameter:
in
- the input reader.
-
TSVParser
Create a new TSVParser instance. Requires a Reader to read the tab-separated values from, and a list of column names.- Parameter:
in
- the input reader.columnNames
- a list of column names.
-
TSVParser
Create a new TSVParser instance. Requires a Reader to read the tab-separated values from, a list of column names and a character encoding.- Parameter:
in
- the input reader.columnNames
- a list of column names.characterEncoding
- the character encoding of the input.
-
-
Methodendetails
-
initTokenizer
Initialize the StreamTokenizer instance used to read the lines from the input reader.- Angegeben von:
initTokenizer
in KlasseDataStreamParser
- Parameter:
tokenizer
- the stream tokenizer to be used
-