Package com.relogiclabs.jschema
Class JsonSchema
Object
JsonSchema
JsonSchema
provides JSchema validation functionalities for JSON document.-
Constructor Summary
ConstructorDescriptionJsonSchema
(String schema) Initializes a new instance of theJsonSchema
class for the specified JSchema string. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Indicates whether the input JSON string conforms to the JSchema specified in theJsonSchema
constructor.static boolean
Indicates whether the input JSON string conforms to the given JSchema string.int
Writes error messages that occur during JSchema validation process, to the standard error output stream.
-
Constructor Details
-
JsonSchema
Initializes a new instance of theJsonSchema
class for the specified JSchema string.- Parameters:
schema
- A JSchema string for validation
-
-
Method Details
-
isValid
Indicates whether the input JSON string conforms to the JSchema specified in theJsonSchema
constructor.- Parameters:
json
- The JSON to validate with JSchema- Returns:
- Returns
true
if the JSON string conforms to the JSchema andfalse
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
Indicates whether the input JSON string conforms to the given JSchema string.- Parameters:
schema
- The JSchema string to conform or validatejson
- The JSON string to conform or validate- Returns:
- Returns
true
if the JSON string conforms to the JSchema andfalse
otherwise.
-
getRuntime
-
getSchemaTree
-
getExceptions
-