Package io.ocfl.core.validation
Class SimpleInventoryParser
java.lang.Object
io.ocfl.core.validation.SimpleInventoryParser
Parses a JSON inventory into a minimally valid SimpleInventory object.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionparse
(InputStream inventoryStream, String inventoryPath) Parses the input stream JSON into a minimally valid SimpleInventory object.
-
Constructor Details
-
SimpleInventoryParser
public SimpleInventoryParser()
-
-
Method Details
-
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 streaminventoryPath
- path to the source JSON file, this is used for constructing validation messages- Returns:
- the results of the parse
-