uk.ac.starlink.pds4

## Class LabelParser

- java.lang.Object
- - uk.ac.starlink.pds4.LabelParser

-     public class LabelParser
      extends java.lang.Object

  Parses a PDS4 Label (an XML file) to extract information that can be used to read table data.

  This code was written with reference to the PDS4 data standards v1.16.0.

  Since:
    24 Nov 2021
  See Also:
    PDS4 Common Data Dictionary

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LabelParser()` Default parser.
    `LabelParser(boolean observationalOnly, java.lang.String[] blankSpecials)` Custom constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Label` | `parseLabel(java.io.File file)` Parses the label file in a given File to create a Label object.
    `Label` | `parseLabel(java.io.InputStream in, java.net.URI contextUri)` Parses the label file from a given InputStream to create a Label object.
    `Label` | `parseLabel(java.net.URL url)` Parses the label file at a given URL to create a Label object.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### LabelParser

          public LabelParser()

      Default parser.

    - #### LabelParser

          public LabelParser(boolean observationalOnly,
                             java.lang.String[] blankSpecials)

      Custom constructor.
      Parameters:
        `observationalOnly` - if true, only File_Observational tables are included; if false all are included
        `blankSpecials` - list of special constant elements to map to null values in output table data

  - ### Method Detail

    - #### parseLabel

          public Label parseLabel(java.net.URL url)
                           throws java.io.IOException

      Parses the label file at a given URL to create a Label object.
      Parameters:
        `url` - location of PDS4 label XML file
      Returns:
        parsed label object
      Throws:
        `java.io.IOException`

    - #### parseLabel

          public Label parseLabel(java.io.File file)
                           throws java.io.IOException

      Parses the label file in a given File to create a Label object.
      Parameters:
        `file` - location of PDS4 label XML file
      Returns:
        parsed label object
      Throws:
        `java.io.IOException`

    - #### parseLabel

          public Label parseLabel(java.io.InputStream in,
                                  java.net.URI contextUri)
                           throws java.io.IOException

      Parses the label file from a given InputStream to create a Label object.
      Parameters:
        `in` - input stream, closed unconditionally on exit
        `contextUri` - context URI
      Returns:
        parsed label object
      Throws:
        `java.io.IOException`