Class BaseLddParser

java.lang.Object
gov.nasa.pds.registry.common.dd.parser.BaseLddParser
Direct Known Subclasses:
AttributeDictionaryParser, ClassAttrAssociationParser

public class BaseLddParser extends Object
Base parser of PDS LDD JSON files (Data dictionary files). This implementation is using Google "GSON" streaming parser to reduce memory footprint. (We only need a subset of values from a JSON file).
Author:
karpenko
  • Field Details

    • ddFile

      protected File ddFile
    • jsonReader

      protected com.google.gson.stream.JsonReader jsonReader
    • imVersion

      protected String imVersion
    • lddVersion

      protected String lddVersion
    • ddDate

      protected String ddDate
  • Constructor Details

    • BaseLddParser

      public BaseLddParser(File file) throws Exception
      Constructor
      Parameters:
      file - PDS LDD JSON file to parse
      Throws:
      Exception - an exception
  • Method Details

    • getLddVersion

      public String getLddVersion()
      Returns LDD version
      Returns:
      LDD version
    • getImVersion

      public String getImVersion()
      Returns Information Model version
      Returns:
      Information Model version
    • getLddDate

      public String getLddDate()
      Returns LDD (creation) date
      Returns:
      LDD date
    • parse

      public void parse() throws Exception
      Parse PDS LDD JSON file
      Throws:
      Exception - an exception
    • parseClassDictionary

      protected void parseClassDictionary() throws Exception
      Parse "dataDictionary" -> "classDictionary" subtree
      Throws:
      Exception - an exception
    • parseAttributeDictionary

      protected void parseAttributeDictionary() throws Exception
      Parse "dataDictionary" -> "attributeDictionary" subtree
      Throws:
      Exception - an exception