gov.nasa.pds.objectAccess
Class ObjectAccess

java.lang.Object
  extended by gov.nasa.pds.objectAccess.ObjectAccess
All Implemented Interfaces:
ObjectProvider

public class ObjectAccess
extends Object
implements ObjectProvider

The ObjectAccess class is a point of entry into parsed PDS (including PDS 4/XML-schema-labeled) objects.

Author:
dcberrio

Constructor Summary
ObjectAccess()
          Creates a new instance with the current directory as the archive root path.
ObjectAccess(File archiveRoot)
          Constructs an ObjectAccess object and sets the archive root path.
ObjectAccess(String archiveRoot)
          Constructs an ObjectAccess object and sets the archive root path.
 
Method Summary
 String getArchiveRoot()
          Gets the root file path of the object archive(s) for this ObjectProvider.
 List<Array2DImage> getArray2DImages(FileAreaObservational observationalFileArea)
          Returns a list of Array2DImage objects given an observation file area object.
 List<FieldBinary> getFieldBinaries(TableBinary table)
          Returns a list of FieldBinary objects given a table binary object.
 List<Object> getFieldBinaryAndGroupFieldBinaries(TableBinary table)
          Returns a list of FieldBinary and GroupFieldBinary objects given a table binary object.
 List<Object> getFieldCharacterAndGroupFieldCharacters(TableCharacter table)
          Returns a list of FieldCharacter and GroupFieldCharacter objects given a table character object.
 List<FieldCharacter> getFieldCharacters(TableCharacter table)
          Returns a list of FieldCharacter objects given a table character object.
 List<Object> getFieldDelimitedAndGroupFieldDelimiteds(TableDelimited table)
          Returns a list of FieldDelimited and GroupFieldDelimited objects given a table delimited object.
 List<FieldDelimited> getFieldDelimiteds(TableDelimited table)
          Returns a list of FieldDelimited objects given a table delimited object.
 List<GroupFieldDelimited> getGroupFieldDelimiteds(TableDelimited table)
          Returns a list of GroupFieldDelimited objects given a table delimited object.
 ProductObservational getObservationalProduct(String relativeXmlFilePath)
          Gets an instance of ProductObservational.
<T> T
getProduct(File labelFile, Class<T> productClass)
          Reads a product label of a specified class, and returns an instance of that class as a result.
 File getRoot()
          Gets the root file path of the object archive(s) for this ObjectProvider.
 List<TableBinary> getTableBinaries(FileAreaObservational observationalFileArea)
          Returns a list of TableBinary objects given an observation file area object.
 List<TableCharacter> getTableCharacters(FileAreaObservational observationalFileArea)
          Returns a list of TableCharacter objects given an observation file area object.
 List<TableDelimited> getTableDelimiteds(FileAreaObservational observationalFileArea)
          Returns a list of TableDelimited objects given an observation file area object.
 List<Object> getTableObjects(FileAreaObservational observationalFileArea)
          Returns a list of table objects.
 List<Object> getTableObjects(FileAreaObservationalSupplemental observationalFileAreaSupplemental)
          Returns a list of table objects.
 void setObservationalProduct(String relativeXmlFilePath, ProductObservational product)
          Writes a label given the product XML file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectAccess

public ObjectAccess()
Creates a new instance with the current directory as the archive root path.


ObjectAccess

public ObjectAccess(String archiveRoot)
Constructs an ObjectAccess object and sets the archive root path.

Parameters:
archiveRoot - the archive root path
Throws:
Exception

ObjectAccess

public ObjectAccess(File archiveRoot)
Constructs an ObjectAccess object and sets the archive root path.

Parameters:
archiveRoot - the archive root path
Throws:
Exception
Method Detail

getProduct

public <T> T getProduct(File labelFile,
                        Class<T> productClass)
             throws ParseException
Description copied from interface: ObjectProvider
Reads a product label of a specified class, and returns an instance of that class as a result.

Specified by:
getProduct in interface ObjectProvider
Type Parameters:
T - the product object class
Parameters:
labelFile - the file containing the XML label
productClass - the product object class
Returns:
an instance of the product object
Throws:
ParseException - if there is an error parsing the label

getObservationalProduct

public ProductObservational getObservationalProduct(String relativeXmlFilePath)
Description copied from interface: ObjectProvider
Gets an instance of ProductObservational.

Specified by:
getObservationalProduct in interface ObjectProvider
Parameters:
relativeXmlFilePath - the XML file path and name of the product to obtain, relative to the ObjectAccess archive root
Returns:
an instance of ProductObservational

setObservationalProduct

public void setObservationalProduct(String relativeXmlFilePath,
                                    ProductObservational product)
Description copied from interface: ObjectProvider
Writes a label given the product XML file.

Specified by:
setObservationalProduct in interface ObjectProvider
Parameters:
relativeXmlFilePath - the XML file path and name of the product to set, relative to the ObjectAccess archive root

getArray2DImages

public List<Array2DImage> getArray2DImages(FileAreaObservational observationalFileArea)
Description copied from interface: ObjectProvider
Returns a list of Array2DImage objects given an observation file area object.

Specified by:
getArray2DImages in interface ObjectProvider
Returns:

getTableObjects

public List<Object> getTableObjects(FileAreaObservational observationalFileArea)
Description copied from interface: ObjectProvider
Returns a list of table objects.

Specified by:
getTableObjects in interface ObjectProvider
Returns:

getTableCharacters

public List<TableCharacter> getTableCharacters(FileAreaObservational observationalFileArea)
Description copied from interface: ObjectProvider
Returns a list of TableCharacter objects given an observation file area object.

Specified by:
getTableCharacters in interface ObjectProvider
Returns:
list of TableCharacter objects

getTableBinaries

public List<TableBinary> getTableBinaries(FileAreaObservational observationalFileArea)
Description copied from interface: ObjectProvider
Returns a list of TableBinary objects given an observation file area object.

Specified by:
getTableBinaries in interface ObjectProvider
Returns:
list of TableBinary objects

getTableDelimiteds

public List<TableDelimited> getTableDelimiteds(FileAreaObservational observationalFileArea)
Description copied from interface: ObjectProvider
Returns a list of TableDelimited objects given an observation file area object.

Specified by:
getTableDelimiteds in interface ObjectProvider
Returns:
list of TableDelimited objects

getFieldCharacters

public List<FieldCharacter> getFieldCharacters(TableCharacter table)
Description copied from interface: ObjectProvider
Returns a list of FieldCharacter objects given a table character object.

Specified by:
getFieldCharacters in interface ObjectProvider
Parameters:
table - TableCharacter object
Returns:
list of FieldCharacter objects

getFieldDelimiteds

public List<FieldDelimited> getFieldDelimiteds(TableDelimited table)
Description copied from interface: ObjectProvider
Returns a list of FieldDelimited objects given a table delimited object.

Specified by:
getFieldDelimiteds in interface ObjectProvider
Parameters:
table - TableDelimited object
Returns:
list of FieldDelimited objects

getGroupFieldDelimiteds

public List<GroupFieldDelimited> getGroupFieldDelimiteds(TableDelimited table)
Description copied from interface: ObjectProvider
Returns a list of GroupFieldDelimited objects given a table delimited object.

Specified by:
getGroupFieldDelimiteds in interface ObjectProvider
Parameters:
table - TableDelimited object
Returns:
list of GroupFieldDelimited objects

getFieldDelimitedAndGroupFieldDelimiteds

public List<Object> getFieldDelimitedAndGroupFieldDelimiteds(TableDelimited table)
Description copied from interface: ObjectProvider
Returns a list of FieldDelimited and GroupFieldDelimited objects given a table delimited object.

Specified by:
getFieldDelimitedAndGroupFieldDelimiteds in interface ObjectProvider
Parameters:
table - TableDelimited object
Returns:
list of FieldDelimited and GroupFieldDelimited objects

getFieldCharacterAndGroupFieldCharacters

public List<Object> getFieldCharacterAndGroupFieldCharacters(TableCharacter table)
Description copied from interface: ObjectProvider
Returns a list of FieldCharacter and GroupFieldCharacter objects given a table character object.

Specified by:
getFieldCharacterAndGroupFieldCharacters in interface ObjectProvider
Parameters:
table - TableCharacter object
Returns:
list of FieldCharacter and GroupFieldCharacter objects

getFieldBinaryAndGroupFieldBinaries

public List<Object> getFieldBinaryAndGroupFieldBinaries(TableBinary table)
Description copied from interface: ObjectProvider
Returns a list of FieldBinary and GroupFieldBinary objects given a table binary object.

Specified by:
getFieldBinaryAndGroupFieldBinaries in interface ObjectProvider
Parameters:
table - TableBinary object
Returns:
list of FieldBinary and GroupFieldBinary objects

getTableObjects

public List<Object> getTableObjects(FileAreaObservationalSupplemental observationalFileAreaSupplemental)
Description copied from interface: ObjectProvider
Returns a list of table objects.

Specified by:
getTableObjects in interface ObjectProvider
Returns:
list of observationalFileAreaSupplemental objects

getFieldBinaries

public List<FieldBinary> getFieldBinaries(TableBinary table)
Description copied from interface: ObjectProvider
Returns a list of FieldBinary objects given a table binary object.

Specified by:
getFieldBinaries in interface ObjectProvider
Parameters:
table - TableBinary object
Returns:
list of FieldBinary objects

getArchiveRoot

public String getArchiveRoot()
Description copied from interface: ObjectProvider
Gets the root file path of the object archive(s) for this ObjectProvider.

Specified by:
getArchiveRoot in interface ObjectProvider
Returns:
the root file path of the object archive(s) for this ObjectProvider

getRoot

public File getRoot()
Description copied from interface: ObjectProvider
Gets the root file path of the object archive(s) for this ObjectProvider.

Specified by:
getRoot in interface ObjectProvider
Returns:
the root file path of the object archive(s) for this ObjectProvider


Copyright © 2014. All Rights Reserved.