public abstract class BaseCsvListener extends BaseListener
Modifier and Type | Field and Description |
---|---|
protected boolean |
includeHeader
Include a header row at the start of the output file.
|
protected au.com.bytecode.opencsv.CSVWriter |
writer
CSVWriter that will format and write the output.
|
protected CSVWriterBuilder |
writerBuilder
CSVWriterBuilder used to create the CSVWriter.
|
annotationTypeFilter, docInfo, exitOnError, inputType, lastException, logErrors, mOutputDir, numReceived, numSent, previousReferenceId, referenceID
Constructor and Description |
---|
BaseCsvListener(File file)
Constructor with File parameter.
|
BaseCsvListener(OutputStream stream)
Constructor with an OutputStream parameter.
|
BaseCsvListener(Writer writer)
Constructor with a Writer parameter.
|
Modifier and Type | Method and Description |
---|---|
void |
collectionProcessComplete(org.apache.uima.collection.EntityProcessStatus aStatus) |
void |
entityProcessComplete(org.apache.uima.cas.CAS aCas,
org.apache.uima.collection.EntityProcessStatus aStatus)
Called with a completely processed CAS.
|
char |
getEscapechar()
Get the escape character.
|
protected abstract String[] |
getHeaders()
Returns the string list of the headers for a row.
|
String |
getLineEnd()
Get the line ending string.
|
char |
getQuotechar()
Get the quote character.
|
protected abstract List<String[]> |
getRows(org.apache.uima.cas.CAS cas)
Given a cas, return one or more rows of data.
|
char |
getSeparator()
Get the separator character.
|
void |
initializationComplete(org.apache.uima.collection.EntityProcessStatus aStatus)
Called once client initialization is complete.
|
boolean |
isIncludeHeader()
Return the flag value that if true will cause the listener to include a header row, defaults false.
|
<T extends BaseCsvListener> |
setEscapechar(char escapechar)
Set the escape character.
|
<T extends BaseCsvListener> |
setIncludeHeader(boolean includeHeader)
Set the boolean flag that if true will cause the listener to include a header row.
|
<T extends BaseCsvListener> |
setLineEnd(String lineEnd)
Set the line ending.
|
<T extends BaseCsvListener> |
setQuotechar(char quotechar)
Set the quote character.
|
<T extends BaseCsvListener> |
setSeparator(char separator)
Set the separator character.
|
void |
writeHeaders()
Write out headers to the writerBuilder for this gov.va.vinci.leo.listener.
|
checkForError, entityProcessError, getAnnotationTypeFilter, getInputType, getInputTypesList, getNumReceived, getNumSent, getOutputDir, getReferenceLocation, hasAnnotationsToProcess, hasFilteredAnnotation, isExitOnError, isLogErrors, onBeforeMessageSend, setAnnotationTypeFilter, setExitOnError, setInputType, setLogErrors, setOutputDir
protected CSVWriterBuilder writerBuilder
protected au.com.bytecode.opencsv.CSVWriter writer
protected boolean includeHeader
public BaseCsvListener(File file) throws FileNotFoundException
file
- The printwriter to write to.FileNotFoundException
- if the file is not found or can't be written to.public BaseCsvListener(OutputStream stream)
stream
- The stream to write to.public BaseCsvListener(Writer writer)
writer
- The writer to use for outputprotected abstract List<String[]> getRows(org.apache.uima.cas.CAS cas)
cas
- the document cas to get results fromprotected abstract String[] getHeaders()
public char getSeparator()
public <T extends BaseCsvListener> T setSeparator(char separator)
separator
- separator charactorpublic char getQuotechar()
public <T extends BaseCsvListener> T setQuotechar(char quotechar)
quotechar
- quote characterpublic char getEscapechar()
public <T extends BaseCsvListener> T setEscapechar(char escapechar)
escapechar
- escape characterpublic String getLineEnd()
public <T extends BaseCsvListener> T setLineEnd(String lineEnd)
lineEnd
- line endingpublic boolean isIncludeHeader()
public <T extends BaseCsvListener> T setIncludeHeader(boolean includeHeader)
includeHeader
- boolean flag for header rowpublic void writeHeaders() throws IOException
IOException
- if the headers cannot be written.public void initializationComplete(org.apache.uima.collection.EntityProcessStatus aStatus)
initializationComplete
in interface org.apache.uima.aae.client.UimaASStatusCallbackListener
initializationComplete
in class BaseListener
aStatus
- the status of the processing.UimaAsBaseCallbackListener.initializationComplete(EntityProcessStatus)
public void entityProcessComplete(org.apache.uima.cas.CAS aCas, org.apache.uima.collection.EntityProcessStatus aStatus)
entityProcessComplete
in interface org.apache.uima.aae.client.UimaASStatusCallbackListener
entityProcessComplete
in class BaseListener
aCas
- the returned cas.aStatus
- the status of the processing. This object contains a record of any Exception that occurred, as well as timing information.UimaAsBaseCallbackListener.entityProcessComplete(org.apache.uima.cas.CAS, org.apache.uima.collection.EntityProcessStatus)
public void collectionProcessComplete(org.apache.uima.collection.EntityProcessStatus aStatus)
collectionProcessComplete
in interface org.apache.uima.aae.client.UimaASStatusCallbackListener
collectionProcessComplete
in class BaseListener
aStatus
- the status of the processing. This object contains a record of any Exception that occurred, as well as timing information.UimaAsBaseCallbackListener.collectionProcessComplete(org.apache.uima.collection.EntityProcessStatus)
Copyright © 2018 Department of Veterans Affairs. All Rights Reserved.