com.ricebridge.csvman.test
Class Snippets.MyLineProvider

java.lang.Object
  extended bycom.ricebridge.csvman.LineProviderSupportImpl
      extended bycom.ricebridge.csvman.CustomLineProvider
          extended bycom.ricebridge.csvman.test.Snippets.MyLineProvider
All Implemented Interfaces:
LineProvider
Enclosing class:
Snippets

public class Snippets.MyLineProvider
extends CustomLineProvider


Constructor Summary
Snippets.MyLineProvider(List pBusinessObjects)
           
 
Method Summary
 void endSaveImpl()
           
 boolean hasNextLineImpl()
          Implement this method to let CSV Manager know that there is another line of data to save.
 String[] nextLineImpl()
          Implement this method to supply each data line as it is saved.
 void startSaveImpl()
           
 
Methods inherited from class com.ricebridge.csvman.CustomLineProvider
endProcessImpl, setCsvSpecImpl, setLineSpecImpl, startProcessImpl
 
Methods inherited from class com.ricebridge.csvman.LineProviderSupportImpl
endProcess, hasNextLine, nextLine, setCsvSpec, setLineSpec, startProcess
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Snippets.MyLineProvider

public Snippets.MyLineProvider(List pBusinessObjects)
Method Detail

startSaveImpl

public void startSaveImpl()

endSaveImpl

public void endSaveImpl()

hasNextLineImpl

public boolean hasNextLineImpl()
Description copied from class: CustomLineProvider
Implement this method to let CSV Manager know that there is another line of data to save.

This method must be implemented when you extend CustomLineProvider.

Return true from this method so long as you have more data lines to save.

Specified by:
hasNextLineImpl in class CustomLineProvider
See Also:
LineProvider.hasNextLine, nextLineImpl

nextLineImpl

public String[] nextLineImpl()
Description copied from class: CustomLineProvider
Implement this method to supply each data line as it is saved.

This method must be implemented when you extend CustomLineProvider.

This method is where you will do the main work of providing the CSV data. Each time this method is called you will need to provide a new line of CSV data as a String[] array.

Error Handling: What happens when you cannot provide the line data for some reason? For example your database connection may fail. In this case, all you have to do is throw an Exception to let CSV Manager know about the problem. But note that if the CsvSpec.setIgnoreBadLines setting is true, then CSV Manager will not stop asking you for more data lines until you also return false from CustomLineProvider.hasNextLineImpl().

Specified by:
nextLineImpl in class CustomLineProvider
See Also:
LineProvider.nextLine, hasNextLineImpl


Copyright © 2003-2006 Ricebridge