Class SimpleInventoryParser


  • public class SimpleInventoryParser
    extends Object
    Parses a JSON inventory into a minimally valid SimpleInventory object.
    • Constructor Detail

      • SimpleInventoryParser

        public SimpleInventoryParser()
    • Method Detail

      • parse

        public SimpleInventoryParser.ParseSimpleInventoryResult parse​(InputStream inventoryStream,
                                                                      String inventoryPath)
        Parses the input stream JSON into a minimally valid SimpleInventory object. The only reason an inventory object would not be returned is if the JSON is syntactically invalid. Otherwise, a SimpleInventory is returned with any validation issues noted. The validation issues reported here are strictly related to JSON structural issues such as invalid types or keys.
        Parameters:
        inventoryStream - JSON inventory stream
        inventoryPath - path to the source JSON file, this is used for constructing validation messages
        Returns:
        the results of the parse