|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.ricebridge.csvman.LineListenerSupportImpl
com.ricebridge.csvman.CustomLineListener
com.ricebridge.csvman.BasicLineListener
Simple implementation of LineListener that stores loaded data lines
as a List of String[] arrays.
The easiest way to get your CSV data in this format is to use the
CsvManager.load method.
This LineListener is a good one to use as a template for
your own custom LineListeners.
BasicLineListener is designed to be subclassed. You can change
the default implementation by calling the
CsvManagerStore.setBasicLineListenerClass
method, and providing a subclass of BasicLineListener. CsvManagerStore can be accessed
using CsvManager.getCsvManagerStore().
The Source Code of this Java class is available under a BSD-style license.
LineListener,
CustomLineListener,
ResultSetLineListener,
AsListsLineListener,
TableModelLineListener,
BeanLineListener| Field Summary | |
protected ArrayList |
iData
List of String[] arrays holding data lines. |
| Constructor Summary | |
BasicLineListener()
|
|
| Method Summary | |
protected void |
endProcessImpl()
Handle end of loading process. |
List |
getData()
Get the list of loaded data lines as a List of String[] arrays. |
protected BadLine |
handleLineImpl(String[] pLine,
int pNumFields,
long pLineNumber,
String pOriginalLine)
Handle each data line by storing it in a list. |
protected void |
startProcessImpl()
Handle start of loading process by creating empty list for data lines. |
| Methods inherited from class com.ricebridge.csvman.CustomLineListener |
handleBadLineImpl, setCsvSpecImpl, setLineSpecImpl |
| Methods inherited from class com.ricebridge.csvman.LineListenerSupportImpl |
endProcess, handleBadLine, handleLine, setCsvSpec, setLineSpec, startProcess |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected ArrayList iData
List of String[] arrays holding data lines.
| Constructor Detail |
public BasicLineListener()
| Method Detail |
protected void startProcessImpl()
throws Exception
startProcessImpl in class CustomLineListenerExceptionendProcessImpl
protected void endProcessImpl()
throws Exception
endProcessImpl in class CustomLineListenerExceptionstartProcessImpl
protected BadLine handleLineImpl(String[] pLine,
int pNumFields,
long pLineNumber,
String pOriginalLine)
throws Exception
handleLineImpl in class CustomLineListenerpLine - String values of data fields in linepNumFields - Number of data fields actually found on the current linepLineNumber - Count of lines processed so far.pOriginalLine - Text of original data line from data source
null if line is OK, BadLine object if line was bad in some way
ExceptionLineListener.handleLine,
BadLine,
handleBadLineImplpublic List getData()
List of String[] arrays.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||