com.ricebridge.csvman
Class LineListenerSupportImpl

java.lang.Object
  extended bycom.ricebridge.csvman.LineListenerSupportImpl
All Implemented Interfaces:
LineListener
Direct Known Subclasses:
CustomLineListener, LineListenerFixer

public abstract class LineListenerSupportImpl
extends Object
implements LineListener

Helper class for implementing the LineListener interface.

Please do not extend this class directly. CustomLineListener extends this class, and CustomLineListener is the class you should should extend when implementing your own LineListeners. This class only provides internal error checking.

Compatibility note: This class will replace LineListenerSupport in CSV Manager 2.x. The current LineListenerSupport class in CSV Manager 1.x is a compatibility class for existing customers with custom LineListeners, and should not be used for new code. If this means nothing to you, just remember that the golden rule is "use CustomLineListener, and things will just work."

The Source Code of this Java class is available under a BSD-style license.

See Also:
LineListener, LineListenerSupport, CustomLineListener

Constructor Summary
LineListenerSupportImpl()
           
 
Method Summary
 void endProcess()
          Helper implementation of LineListener.endProcess
protected abstract  void endProcessImpl()
          The default implementation of this method is provided by CustomLineListener
 void handleBadLine(BadLine pBadLine)
          Helper implementation of LineListener.handleBadLine
protected abstract  void handleBadLineImpl(BadLine pBadLine)
          The default implementation of this method is provided by CustomLineListener
 BadLine handleLine(String[] pLine, int pNumFields, long pLineNumber, String pOriginalLine)
          Helper implementation of LineListener.handleLine
protected abstract  BadLine handleLineImpl(String[] pLine, int pNumFields, long pLineNumber, String pOriginalLine)
          The default implementation of this method is provided by CustomLineListener
 void setCsvSpec(CsvSpec pCsvSpec)
          Helper implementation of LineListener#setCsvSpec.
protected abstract  void setCsvSpecImpl(CsvSpec pCsvSpec)
          The default implementation of this method is provided by CustomLineListener
 void setLineSpec(LineSpec pLineSpec)
          Helper implementation of LineListener#setLineSpec.
protected abstract  void setLineSpecImpl(LineSpec pLineSpec)
          The default implementation of this method is provided by CustomLineListener
 void startProcess()
          Helper implementation of LineListener.startProcess
protected abstract  void startProcessImpl()
          The default implementation of this method is provided by CustomLineListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LineListenerSupportImpl

public LineListenerSupportImpl()
Method Detail

setCsvSpec

public void setCsvSpec(CsvSpec pCsvSpec)
Helper implementation of LineListener#setCsvSpec.

Specified by:
setCsvSpec in interface LineListener
Parameters:
pCsvSpec - CsvSpec object

setLineSpec

public void setLineSpec(LineSpec pLineSpec)
Helper implementation of LineListener#setLineSpec.

Specified by:
setLineSpec in interface LineListener
Parameters:
pLineSpec - LineSpec object

startProcess

public void startProcess()
Helper implementation of LineListener.startProcess

Specified by:
startProcess in interface LineListener
See Also:
LineListener.endProcess()

endProcess

public void endProcess()
Helper implementation of LineListener.endProcess

Specified by:
endProcess in interface LineListener
See Also:
LineListener.startProcess()

handleLine

public BadLine handleLine(String[] pLine,
                          int pNumFields,
                          long pLineNumber,
                          String pOriginalLine)
Helper implementation of LineListener.handleLine

Specified by:
handleLine in interface LineListener
Parameters:
pLine - line data as text
pNumFields - number of data fields found
pLineNumber - line number index, counting from 1
pOriginalLine - original line of data
Returns:
null if line is OK, BadLine object if line was bad in some way

handleBadLine

public void handleBadLine(BadLine pBadLine)
Helper implementation of LineListener.handleBadLine

Specified by:
handleBadLine in interface LineListener
Parameters:
pBadLine - BadLine object describing problem

setCsvSpecImpl

protected abstract void setCsvSpecImpl(CsvSpec pCsvSpec)
                                throws Exception
The default implementation of this method is provided by CustomLineListener

Throws:
Exception

setLineSpecImpl

protected abstract void setLineSpecImpl(LineSpec pLineSpec)
                                 throws Exception
The default implementation of this method is provided by CustomLineListener

Throws:
Exception

startProcessImpl

protected abstract void startProcessImpl()
                                  throws Exception
The default implementation of this method is provided by CustomLineListener

Throws:
Exception

endProcessImpl

protected abstract void endProcessImpl()
                                throws Exception
The default implementation of this method is provided by CustomLineListener

Throws:
Exception

handleBadLineImpl

protected abstract void handleBadLineImpl(BadLine pBadLine)
                                   throws Exception
The default implementation of this method is provided by CustomLineListener

Throws:
Exception

handleLineImpl

protected abstract BadLine handleLineImpl(String[] pLine,
                                          int pNumFields,
                                          long pLineNumber,
                                          String pOriginalLine)
                                   throws Exception
The default implementation of this method is provided by CustomLineListener

Throws:
Exception


Copyright © 2003-2006 Ricebridge