com.waveset.util
Class DelimitedFileParser
java.lang.Object
com.waveset.util.DelimitedFileParser
- All Implemented Interfaces:
- FlatFileIterator
- Direct Known Subclasses:
- CSVParser, PipeDelimitedParser
- public abstract class DelimitedFileParser
- extends java.lang.Object
- implements FlatFileIterator
Constructor Summary |
DelimitedFileParser(java.lang.String filePath,
char fieldSeparator)
|
DelimitedFileParser(java.lang.String filePath,
char fieldSeparator,
char textQualifier)
|
DelimitedFileParser(java.lang.String filePath,
char fieldSeparator,
char textQualifier,
java.lang.String encoding)
|
Method Summary |
void |
close()
Intended for clean up of any open streams or readers. |
boolean |
hasNext()
Indicates whether more records exist to read from the flat file. |
protected boolean |
isWhitespace(char ch)
|
java.util.Map |
nextRecord()
Converts a record in the flat file to a map of attribute name/value
pairs. |
protected java.util.List |
parseLine(java.lang.String line)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
code_id
public static final java.lang.String code_id
- See Also:
- Constant Field Values
_trace
protected static final Trace _trace
DEFAULT_TEXT_QUALIFIER
public static final char DEFAULT_TEXT_QUALIFIER
- See Also:
- Constant Field Values
DelimitedFileParser
public DelimitedFileParser(java.lang.String filePath,
char fieldSeparator)
throws java.io.IOException
DelimitedFileParser
public DelimitedFileParser(java.lang.String filePath,
char fieldSeparator,
char textQualifier)
throws java.io.IOException
DelimitedFileParser
public DelimitedFileParser(java.lang.String filePath,
char fieldSeparator,
char textQualifier,
java.lang.String encoding)
throws java.io.IOException
close
public void close()
throws java.io.IOException
- Description copied from interface:
FlatFileIterator
- Intended for clean up of any open streams or readers.
- Specified by:
close
in interface FlatFileIterator
- Throws:
java.io.IOException
hasNext
public boolean hasNext()
- Description copied from interface:
FlatFileIterator
- Indicates whether more records exist to read from the flat file.
- Specified by:
hasNext
in interface FlatFileIterator
- Returns:
- true if another record is available for processing from the
flat file, false if not.
nextRecord
public java.util.Map nextRecord()
throws java.io.IOException
- Description copied from interface:
FlatFileIterator
- Converts a record in the flat file to a map of attribute name/value
pairs.
- Specified by:
nextRecord
in interface FlatFileIterator
- Returns:
- map of attribute name/value pairs for a record in the flat
file.
- Throws:
java.io.IOException
parseLine
protected java.util.List parseLine(java.lang.String line)
throws java.io.IOException
- Throws:
java.io.IOException
isWhitespace
protected boolean isWhitespace(char ch)