Package com.relogiclabs.jschema
Class JsonSchema
Object
JsonSchema
JsonSchema provides JSchema validation functionalities for JSON document.-
Constructor Summary
ConstructorsConstructorDescriptionJsonSchema(String schema) Initializes a new instance of theJsonSchemaclass for the specified JSchema string. -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether the input JSON string conforms to the JSchema specified in theJsonSchemaconstructor.static booleanIndicates whether the input JSON string conforms to the given JSchema string.intWrites error messages that occur during JSchema validation process, to the standard error output stream.
-
Constructor Details
-
JsonSchema
Initializes a new instance of theJsonSchemaclass 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 theJsonSchemaconstructor.- Parameters:
json- The JSON to validate with JSchema- Returns:
- Returns
trueif the JSON string conforms to the JSchema andfalseotherwise.
-
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
trueif the JSON string conforms to the JSchema andfalseotherwise.
-
getRuntime
-
getSchemaTree
-
getExceptions
-