Package gov.nasa.pds.objectAccess
Class TableExporter
- java.lang.Object
- 
- gov.nasa.pds.objectAccess.ObjectExporter
- 
- gov.nasa.pds.objectAccess.TableExporter
 
 
- 
- All Implemented Interfaces:
- Exporter<java.lang.Object>
 
 public class TableExporter extends ObjectExporter implements Exporter<java.lang.Object> Defines methods for converting a table object to a desired export type.
- 
- 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconvert(java.io.OutputStream outputStream, int objectIndex)Converts the table object at the givenobjectIndexinto the desired export type.voidconvert(java.lang.Object object, java.io.OutputStream outputStream)Converts the table object into the desired export type.java.nio.charset.CharsetgetDecoder()Returns theCharsetto use for decoding the bytes.java.nio.charset.CharsetgetEncoder()Returns theCharsetto use for encoding the bytes.java.lang.StringgetExportType()Gets the desired export type.FieldDescription[]getTableFields(java.lang.Object object)Gets the fields of a given table object.voidsetDecoder(java.lang.String charsetName)Sets a character set to use for decoding the bytes.voidsetEncoder(java.lang.String charsetName)Sets a character set to use for encoding the bytes.voidsetExportType(java.lang.String exportType)Sets the desired export (output) type.- 
Methods inherited from class gov.nasa.pds.objectAccess.ObjectExportergetObjectProvider, getObservationalFileArea, parseLabel, parseLabel, setObjectProvider, setObservationalFileArea
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface gov.nasa.pds.objectAccess.ExportersetObjectProvider, setObservationalFileArea
 
- 
 
- 
- 
- 
Method Detail- 
getTableFieldspublic FieldDescription[] getTableFields(java.lang.Object object) throws InvalidTableException Gets the fields of a given table object.- Parameters:
- object- the table object
- Returns:
- an array of field descriptions for the table
- Throws:
- InvalidTableException
 
 - 
convertpublic void convert(java.lang.Object object, java.io.OutputStream outputStream) throws java.io.IOException, InvalidTableException, com.opencsv.exceptions.CsvValidationExceptionConverts the table object into the desired export type. The valid table objects areTableCharacter,TableBinaryandTableDelimited.- Specified by:
- convertin interface- Exporter<java.lang.Object>
- Parameters:
- object- the table object to convert
- outputStream- the output stream for the output file
- Throws:
- java.io.IOException- If an I/O error occurs
- com.opencsv.exceptions.CsvValidationException
- MissingDataException
- InvalidTableException
 
 - 
convertpublic void convert(java.io.OutputStream outputStream, int objectIndex) throws java.io.IOException, InvalidTableException, com.opencsv.exceptions.CsvValidationExceptionConverts the table object at the givenobjectIndexinto the desired export type.- Specified by:
- convertin interface- Exporter<java.lang.Object>
- Parameters:
- outputStream- the output stream for the output file
- objectIndex- the index of the input table object
- Throws:
- java.io.IOException- If an I/O error occurs
- com.opencsv.exceptions.CsvValidationException
- MissingDataException
- InvalidTableException
 
 - 
getExportTypepublic java.lang.String getExportType() Gets the desired export type.- Returns:
- the export type
 
 - 
setExportTypepublic void setExportType(java.lang.String exportType) Sets the desired export (output) type. Currently, "CSV" is the only supported type.- Specified by:
- setExportTypein interface- Exporter<java.lang.Object>
- Parameters:
- exportType- the export type
 
 - 
setDecoderpublic void setDecoder(java.lang.String charsetName) Sets a character set to use for decoding the bytes.- Parameters:
- charsetName- the name of a character set
- Throws:
- java.nio.charset.UnsupportedCharsetException- If name is not valid
 
 - 
getDecoderpublic java.nio.charset.Charset getDecoder() Returns theCharsetto use for decoding the bytes.- Returns:
- a character set
 
 - 
setEncoderpublic void setEncoder(java.lang.String charsetName) Sets a character set to use for encoding the bytes.- Parameters:
- charsetName- the name of a character set
- Throws:
- java.nio.charset.UnsupportedCharsetException- If name is not valid
 
 - 
getEncoderpublic java.nio.charset.Charset getEncoder() Returns theCharsetto use for encoding the bytes.- Returns:
- a character set
 
 
- 
 
-