org.jSyncManager.API.Conduit.Tools

Class ExpenseDBCSV


public class ExpenseDBCSV
extends DLPRecordCSV

This is a synchronization JConduit for a CSV document from the ExpenseDB database.

Each "cell" in the record will be a double-quoted String, escaped if necessary.

The output CSV document will be headed by a row containing the data type indicators, and possibly a title name row.

See Also:
JSCSVCell, JSCSVDocument, DLPRecordCSV

Field Summary

static String
CSVNAME
org.w3c.dom.Document document
ExpenseRecord
record

Fields inherited from class org.jSyncManager.API.Conduit.Tools.JSCSVDocument

DATATYPE_ROW, DLPRECORD_COLS, TITLE_ROW

Constructor Summary

ExpenseDBCSV()
Create new default, empty ExpenseDBCSV
ExpenseDBCSV(File document)
Create new ExpenseDBCSV from File.
ExpenseDBCSV(InputStreamReader inputfile)
Create new ExpenseDBCSV with InputStreamReader stream input.
ExpenseDBCSV(ExpenseRecord rec)
Create new ExpenseDBCSV with given ExpenseRecord.

Method Summary

void
insertRecord(ExpenseRecord rec)
Insert record into CSV row
int
insertTitles(ExpenseRecord rec)
Insert title row into document
int
insertTypes(ExpenseRecord rec)
Insert column types from input ExpenseRecord for CSV conversion and output.
void
readDocument(InputStreamReader inputfile)
Read the InputStreadReader input and parse the contents into a JSCSVDocument document.

Methods inherited from class org.jSyncManager.API.Conduit.Tools.DLPRecordCSV

insertRecord, insertTitles, insertTypes, readDocument, readDocument

Methods inherited from class org.jSyncManager.API.Conduit.Tools.JSCSVDocument

elementAt, escape, escape, escape, escape, escape, escape, escape, escape, escape, escape, escape, escape, escape, getCell, getDocument, getHeaderrows, getReader, getRowNo, getSeparator, getValue, isShowtitles, parse, parse, parse, parse, parseRow, parseTitleRow, parseTypeRow, readBooleanCell, readByteArrayCell, readByteCell, readCalendarCell, readCharArrayCell, readCharCell, readDocument, readDoubleArrayCell, readDoubleCell, readFloatArrayCell, readFloatCell, readIntArrayCell, readIntCell, readLongArrayCell, readLongCell, readStringArrayCell, readStringCell, setDocument, setElementAt, setElementAt, setHeaderrows, setReader, setReader, setReader, setSeparator, setShowtitles, writeDataRow, writeDocument, writeDocument

Field Details

CSVNAME

public static String CSVNAME
org.w3c.dom.Document document

record

public ExpenseRecord record

Constructor Details

ExpenseDBCSV

public ExpenseDBCSV()
Create new default, empty ExpenseDBCSV

ExpenseDBCSV

public ExpenseDBCSV(File document)
            throws java.io.IOException
Create new ExpenseDBCSV from File.
Parameters:
document - CSV Document file

ExpenseDBCSV

public ExpenseDBCSV(InputStreamReader inputfile)
            throws java.io.IOException
Create new ExpenseDBCSV with InputStreamReader stream input.
Parameters:
inputfile - InputStreamReader input

ExpenseDBCSV

public ExpenseDBCSV(ExpenseRecord rec)
Create new ExpenseDBCSV with given ExpenseRecord.
Parameters:
rec - ExpenseRecord to be parsed into ExpenseDBCSV instance.

Method Details

insertRecord

public void insertRecord(ExpenseRecord rec)
Insert record into CSV row
Parameters:
rec - ExpenseRecord

insertTitles

public int insertTitles(ExpenseRecord rec)
Insert title row into document
Parameters:
rec - ExpenseRecord
Returns:
Number of columns in titles

insertTypes

public int insertTypes(ExpenseRecord rec)
Insert column types from input ExpenseRecord for CSV conversion and output.
Parameters:
rec - ExpenseRecord input
Returns:
Number of columns in record

readDocument

public void readDocument(InputStreamReader inputfile)
            throws java.io.IOException
Read the InputStreadReader input and parse the contents into a JSCSVDocument document.
Overrides:
readDocument in interface DLPRecordCSV
Parameters:
inputfile - InputStreamReader