Module json_values

Interface JsSpec

All Known Subinterfaces:
JsArraySpec
All Known Implementing Classes:
JsObjSpec

public interface JsSpec
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the same spec with the nullable flag enabled
    jsonvalues.spec.JsSpecParser
    Returns the deserializer used during the parsing process to parse an array of bytes or string
    default JsValue
    Low level method to parse a JSON value by value from a reader.
    test(JsPath parentPath, JsValue value)
    verify if the given value satisfy this spec.
    default Set<SpecError>
    test(JsValue value)
     
  • 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

      default JsValue readNextValue(JsReader reader)
      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

      Set<SpecError> test(JsPath parentPath, JsValue value)
      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

      default Set<SpecError> test(JsValue value)