gov.nasa.pds.transform.product
Class Pds4TableTransformer

java.lang.Object
  extended by gov.nasa.pds.transform.product.DefaultTransformer
      extended by gov.nasa.pds.transform.product.Pds4TableTransformer
All Implemented Interfaces:
ProductTransformer

public class Pds4TableTransformer
extends DefaultTransformer

Class that transforms PDS4 tables into CSV formatted-files.

Author:
mcayanan

Field Summary
 
Fields inherited from class gov.nasa.pds.transform.product.DefaultTransformer
appendIndexToOutputFile, log, overwriteOutput
 
Constructor Summary
Pds4TableTransformer(boolean overwrite)
          Constructor to set the flag to overwrite outputs.
 
Method Summary
 File transform(File target, File outputDir, String format, String dataFileName, int index)
          Transform the given label.
 List<File> transformAll(File target, File outputDir, String format)
          Transform all images/tables found in the given target.
 
Methods inherited from class gov.nasa.pds.transform.product.DefaultTransformer
transform, transform, transformAll
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Pds4TableTransformer

public Pds4TableTransformer(boolean overwrite)
Constructor to set the flag to overwrite outputs.

Parameters:
overwrite - Set to true to overwrite outputs, false otherwise.
Method Detail

transform

public File transform(File target,
                      File outputDir,
                      String format,
                      String dataFileName,
                      int index)
               throws TransformException
Transform the given label.

Specified by:
transform in interface ProductTransformer
Specified by:
transform in class DefaultTransformer
Parameters:
target - The PDS4 xml label file.
outputDir - The output directory.
format - the format type.
dataFileName - Tells the tool which data file to transform. If this argument is an empty string, the default is to transform the first data file found in the label.
index - The index of the data. This tells the tool which image or table to transform if there are multiple images/tables within a single data file.
Returns:
The resulting output file.
Throws:
TransformException - If an error occurred during transformation.
gov.nasa.pds.objectAccess.ParseException - If there were errors parsing the given label.

transformAll

public List<File> transformAll(File target,
                               File outputDir,
                               String format)
                        throws TransformException
Description copied from interface: ProductTransformer
Transform all images/tables found in the given target.

Specified by:
transformAll in interface ProductTransformer
Specified by:
transformAll in class DefaultTransformer
Parameters:
target - file specification to the PDS label.
outputDir - directory where the output file will be written.
format - Valid format file type.
Returns:
The resulting output files.
Throws:
TransformException - If an error occurred during the transformation process.


Copyright © 2010–2015 Planetary Data System. All rights reserved.