|
|||||||||||
| 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.MultiLineListener
Multiple LineListeners can receive data lines as they are loaded using this class.
If you need to send the data stream to multiple locations, use this class to register
multiple LineListeners with the registerLineListener(com.ricebridge.csvman.LineListener) method. Then provide this
class as the LineListener to CsvManager using the
CsvManager.load(Object,LineListener) method.
The Source Code of this Java class is available under a BSD-style license.
LineListener,
CustomLineListener| Constructor Summary | |
MultiLineListener()
|
|
| Method Summary | |
protected void |
endProcessImpl()
Calls LineListener.endProcess() on each registered LineListener in turn. |
protected void |
handleBadLineImpl(BadLine pBadLine)
Calls LineListener.handleBadLine(com.ricebridge.csvman.BadLine) on each registered LineListener in turn. |
protected BadLine |
handleLineImpl(String[] pLine,
int pNumFields,
long pLineNumber,
String pOriginalLine)
Add data line to each registered LineListener. |
void |
registerLineListener(LineListener pLineListener)
Register a LineListener. |
protected void |
setCsvSpecImpl(CsvSpec pCsvSpec)
Pass CsvSpec to all registered LineListeners. |
protected void |
setLineSpecImpl(LineSpec pLineSpec)
Pass LineSpec to all registered LineListeners. |
protected void |
startProcessImpl()
Calls LineListener.startProcess() on each registered LineListener in turn. |
| 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 |
| Constructor Detail |
public MultiLineListener()
| Method Detail |
protected void setCsvSpecImpl(CsvSpec pCsvSpec)
CsvSpec to all registered LineListeners.
setCsvSpecImpl in class CustomLineListenerpCsvSpec - CsvSpec for registered LineListeners.CsvSpec,
setLineSpecImplprotected void setLineSpecImpl(LineSpec pLineSpec)
LineSpec to all registered LineListeners.
setLineSpecImpl in class CustomLineListenerpLineSpec - LineSpec for registered LineListeners.LineSpec,
setCsvSpecImpl,
BeanLineListenerprotected void startProcessImpl()
LineListener.startProcess() on each registered LineListener in turn.
Note: If an error occurs, no further calls are made and thus some registered LineListeners may not
receive this method call. Future versions of CsvManager will resolve this issue.
startProcessImpl in class CustomLineListenerLineListener.startProcess()protected void endProcessImpl()
LineListener.endProcess() on each registered LineListener in turn.
Note: If an error occurs, no further calls are made and thus some registered LineListeners may not
receive this method call. Future versions of CsvManager will resolve this issue.
endProcessImpl in class CustomLineListenerLineListener.endProcess()
protected BadLine handleLineImpl(String[] pLine,
int pNumFields,
long pLineNumber,
String pOriginalLine)
Add data line to each registered LineListener.
If any LineListener returns a non-null BadLine, processing continues until all
registered LineListeners have received the data line, and then the last non-null BadLine
is returned. NOTE: if there is more than one BadLine then all except the last are lost.
Future versions of CsvManager will add functionality to recover these BadLine objects.
handleLineImpl in class CustomLineListenerpLine - data linepNumFields - number of data fields foundpLineNumber - line number index, counting from 1pOriginalLine - original line of data
null if line is OK, BadLine object if line was bad in some wayLineListener.handleLine(java.lang.String[], int, long, java.lang.String)protected void handleBadLineImpl(BadLine pBadLine)
LineListener.handleBadLine(com.ricebridge.csvman.BadLine) on each registered LineListener in turn.
Note: If an error occurs, no further calls are made and thus some registered LineListeners may not
receive this method call. Future versions of CsvManager will resolve this issue.
handleBadLineImpl in class CustomLineListenerpBadLine - BadLine object describing problemLineListener.handleBadLine(com.ricebridge.csvman.BadLine)public void registerLineListener(LineListener pLineListener)
LineListener. This class calls the LineListenerSupportImpl.handleLine(java.lang.String[], int, long, java.lang.String) method
of each registered LineListener in turn.
pLineListener - LineListener to register
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||