- All Known Subinterfaces:
JsArraySpec
- All Known Implementing Classes:
JsObjSpec
public interface JsSpec
-
Method Summary
Modifier and TypeMethodDescriptionnullable()
Returns the same spec with the nullable flag enabledjsonvalues.spec.JsSpecParser
parser()
Returns the deserializer used during the parsing process to parse an array of bytes or stringdefault JsValue
readNextValue
(JsReader reader) Low level method to parse a JSON value by value from a reader.verify if the given value satisfy this spec.
-
Method Details
-
nullable
JsSpec nullable()Returns the same spec with the nullable flag enabled- Returns:
- the same spec with the nullable flag enabled
-
parser
jsonvalues.spec.JsSpecParser parser()Returns the deserializer used during the parsing process to parse an array of bytes or string- Returns:
- the deserializer used during the parsing process to parse an array of bytes or string into a json value
-
readNextValue
Low level method to parse a JSON value by value from a reader. Returns the next value according to the current state of the reader if it conforms this spec, otherwise a JsParserException is thrown- Parameters:
reader
- the reader- Returns:
- the next token as a JsValue
-
test
verify if the given value satisfy this spec.- Parameters:
parentPath
- the path where the tested value is located.value
- the tested value- Returns:
- a set of path/error pairs
-
test
-