|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.ricebridge.csvman.LineProviderSupportImpl
com.ricebridge.csvman.CustomLineProvider
com.ricebridge.csvman.test.PerformanceTestFileMaker.RandomValueLineProvider
Provides random values as data for saving.
| Field Summary | |
static char[] |
sChars
|
| Constructor Summary | |
PerformanceTestFileMaker.RandomValueLineProvider(int pNumLines)
|
|
| Method Summary | |
protected void |
endProcessImpl()
Implement this method to receive notification that the saving of CSV data has ended. |
protected String |
handleQuote(String pValue)
|
protected boolean |
hasNextLineImpl()
Implement this method to let CSV Manager know that there is another line of data to save. |
protected String |
makeField(int pFieldIndex)
|
protected char |
makeRandomChar()
|
protected String |
makeRandomString()
|
protected String[] |
nextLineImpl()
Implement this method to supply each data line as it is saved. |
protected void |
startProcessImpl()
Implement this method to receive notification that the saving of CSV data is about to start. |
| Methods inherited from class com.ricebridge.csvman.CustomLineProvider |
setCsvSpecImpl, setLineSpecImpl |
| 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 |
| Field Detail |
public static final char[] sChars
| Constructor Detail |
public PerformanceTestFileMaker.RandomValueLineProvider(int pNumLines)
| Method Detail |
protected void startProcessImpl()
CustomLineProviderYou can implement this method when you extend CustomLineProvider,
but it is not required.
You can use this method to initialise any resource you need to process the CSV data. For example you can open a database connection to retrieve the data as it is saved.
This method is called after setCsvSpecImpl and
setLineSpecImpl.
startProcessImpl in class CustomLineProviderendProcessImplprotected void endProcessImpl()
CustomLineProviderYou can implement this method when you extend CustomLineProvider,
but it is not required.
You can use this method to close any open resources that were used to handle the CSV data. For example you can close any open database connections.
This method is called last, after all hasNextLineImpl
and nextLineImpl calls have been made.
endProcessImpl in class CustomLineProviderstartProcessImplprotected boolean hasNextLineImpl()
CustomLineProviderThis method must be implemented when you extend CustomLineProvider.
Return true from this method so long as you have more data lines to save.
hasNextLineImpl in class CustomLineProviderLineProvider.hasNextLine,
nextLineImplprotected String[] nextLineImpl()
CustomLineProviderThis 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().
nextLineImpl in class CustomLineProviderLineProvider.nextLine,
hasNextLineImplprotected char makeRandomChar()
protected String makeRandomString()
protected String handleQuote(String pValue)
protected String makeField(int pFieldIndex)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||