|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.parser.ParserImpl
com.ibm.di.parser.CSVParser
public class CSVParser
A class reading and writing Entries in a simple one-line-per-Entry format. CSV is short for comma-separated values, and this format is popular for storing tabular data in text form. The separator does not need to be a comma, it can be any single character.
Connector
Field Summary |
---|
Fields inherited from class com.ibm.di.parser.ParserImpl |
---|
_debug, myConfiguration |
Constructor Summary | |
---|---|
CSVParser()
Default constructor; |
|
CSVParser(Reader in,
Writer out)
Class constructor |
Method Summary | |
---|---|
String |
getLine()
Returns the last line that was read or written. |
String |
getVersion()
Version information. |
void |
initParser()
This method is called by the hosting component (e.g. |
ArrayList<String> |
nextEntry()
The method retrieves the values for the next Entry |
Object |
querySchema(Object schema)
Discover the schema for the Parser. |
String |
quote(String src)
Quotes the provided expression. |
Entry |
readEntry()
Return the next entry from the current input stream. |
void |
setHeadersWritten(boolean value)
Sets if header should be written |
void |
writeEntry(Entry entry)
Write an Entry to the current output stream. |
Methods inherited from class com.ibm.di.parser.ParserImpl |
---|
closeParser, debug, debugMode, flush, getClassInstance, getContext, getDebug, getInputStream, getOutputStream, getParam, getParser, getReader, getWriter, isDeltaSupported, logmsg, registerScriptBeans, setConfiguration, setContext, setDebug, setInputStream, setInputStream, setInputStream, setOutputStream, setOutputStream, setParam, setParser |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CSVParser()
public CSVParser(Reader in, Writer out)
in
- : Input stream to read from;out
- : Output stream to write to;Method Detail |
---|
public void initParser()
initParser
in interface ParserInterface
initParser
in class ParserImpl
public Entry readEntry() throws IOException
IOException
- if error during reading next Entry occurs.public ArrayList<String> nextEntry() throws IOException
Entry
IOException
public void writeEntry(Entry entry) throws Exception
entry
- The entry to write
Exception
public String quote(String src)
src
- source String
public void setHeadersWritten(boolean value)
value
- If false, the headers need to be written. If true, the headers are already written, and should not be written again.public String getVersion()
public Object querySchema(Object schema)
querySchema
in interface ParserInterface
querySchema
in class ParserImpl
schema
- The object on which to discover schema
public String getLine()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |