Class TableExporter
java.lang.Object
gov.nasa.pds.objectAccess.ObjectExporter
gov.nasa.pds.objectAccess.TableExporter
Defines methods for converting a table object to a desired export type.
-
Method Summary
Modifier and TypeMethodDescriptionvoidconvert(OutputStream outputStream, int objectIndex) Converts the table object at the givenobjectIndexinto the desired export type.voidconvert(Object object, OutputStream outputStream) Converts the table object into the desired export type.Returns theCharsetto use for decoding the bytes.Returns theCharsetto use for encoding the bytes.Gets the desired export type.getTableFields(Object object) Gets the fields of a given table object.voidsetDecoder(String charsetName) Sets a character set to use for decoding the bytes.voidsetEncoder(String charsetName) Sets a character set to use for encoding the bytes.voidsetExportType(String exportType) Sets the desired export (output) type.Methods inherited from class ObjectExporter
getObjectProvider, getObservationalFileArea, parseLabel, parseLabel, setObjectProvider, setObservationalFileAreaMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Exporter
setObjectProvider, setObservationalFileArea
-
Method Details
-
getTableFields
Gets the fields of a given table object.- Parameters:
object- the table object- Returns:
- an array of field descriptions for the table
- Throws:
InvalidTableException
-
convert
public void convert(Object object, OutputStream outputStream) throws IOException, InvalidTableException, com.opencsv.exceptions.CsvValidationException Converts the table object into the desired export type. The valid table objects areTableCharacter,TableBinaryandTableDelimited. -
convert
public void convert(OutputStream outputStream, int objectIndex) throws IOException, InvalidTableException, com.opencsv.exceptions.CsvValidationException Converts the table object at the givenobjectIndexinto the desired export type. -
getExportType
-
setExportType
Sets the desired export (output) type. Currently, "CSV" is the only supported type.- Specified by:
setExportTypein interfaceExporter<Object>- Parameters:
exportType- the export type
-
setDecoder
Sets a character set to use for decoding the bytes.- Parameters:
charsetName- the name of a character set- Throws:
UnsupportedCharsetException- If name is not valid
-
getDecoder
Returns theCharsetto use for decoding the bytes.- Returns:
- a character set
-
setEncoder
Sets a character set to use for encoding the bytes.- Parameters:
charsetName- the name of a character set- Throws:
UnsupportedCharsetException- If name is not valid
-
getEncoder
Returns theCharsetto use for encoding the bytes.- Returns:
- a character set
-