Class JsonSchema

Object
JsonSchema

public class JsonSchema extends Object
JsonSchema provides JSchema validation functionalities for JSON document.
  • Constructor Details

    • JsonSchema

      public JsonSchema(String schema)
      Initializes a new instance of the JsonSchema class for the specified JSchema string.
      Parameters:
      schema - A JSchema string for validation
  • Method Details

    • isValid

      public boolean isValid(String json)
      Indicates whether the input JSON string conforms to the JSchema specified in the JsonSchema constructor.
      Parameters:
      json - The JSON to validate with JSchema
      Returns:
      Returns true if the JSON string conforms to the JSchema and false otherwise.
    • writeError

      public int writeError()
      Writes error messages that occur during JSchema validation process, to the standard error output stream.
      Returns:
      Returns the number of errors written in the standard error stream.
    • isValid

      public static boolean isValid(String schema, String json)
      Indicates whether the input JSON string conforms to the given JSchema string.
      Parameters:
      schema - The JSchema string to conform or validate
      json - The JSON string to conform or validate
      Returns:
      Returns true if the JSON string conforms to the JSchema and false otherwise.
    • getRuntime

      public RuntimeContext getRuntime()
    • getSchemaTree

      public SchemaTree getSchemaTree()
    • getExceptions

      public ExceptionRegistry getExceptions()