public class Label
extends java.lang.Object
For PDS4 labels, the user should load a label file and access the objects as follows:
Label label = Label.open(new File("labelfile.xml");
// Get the tables in the data file.
List<TableObject> tables = label.getObjects(TableObject.class);
// Read the table record-by-record.
TableObject table = tables.get(0);
TableRecord record = table.readNext();
while (record != null) {
... process this record ...
}
label.close();
See the package gov.nasa.pds.object to see all the object types that can be
represented in a PDS label.
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the label.
|
LabelStandard |
getLabelStandard()
Gets the label standard that the label conforms to.
|
java.util.List<DataObject> |
getObjects()
Gets the data objects represented by the label.
|
<T extends DataObject> |
getObjects(java.lang.Class<T> clazz)
Gets the data objects that are of a given class.
|
java.lang.Class<? extends Product> |
getProductClass()
Gets the object class of the product.
|
ProductType |
getProductType()
Gets the type of the product, as an enumerated type.
|
java.lang.String |
getStandardVersion()
Returns the version number of the label standard used by the product.
|
static Label |
open(java.io.File labelFile)
Opens a label from a file.
|
static Label |
open(java.net.URL label)
Opens a label from a url.
|
public void close()
public static Label open(java.io.File labelFile) throws ParseException
labelFile - the label fileParseException - if there is an error reading the label from the filepublic static Label open(java.net.URL label) throws ParseException
label - the label urlParseException - if there is an error reading the label from the urlpublic LabelStandard getLabelStandard()
public java.lang.String getStandardVersion()
public java.lang.Class<? extends Product> getProductClass()
public ProductType getProductType()
public java.util.List<DataObject> getObjects() throws java.lang.Exception
java.lang.Exception - if there is an error accessing the objects in the productpublic <T extends DataObject> java.util.List<T> getObjects(java.lang.Class<T> clazz) throws java.lang.Exception
T - the class of the objects desiredclazz - the class object of the object classjava.lang.Exception - if there is an error accessing the objects in the productCopyright © 2022 Planetary Data System. All rights reserved.