public class JSONSchema
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
int |
errorLimit
during validation, errors will be collected up to this limit,
and the validation will return when the limit is reached.
|
boolean |
recordSuccess
if this is set false, then success (correct) validation is silent
if set to true, then every comparison is announced
|
| Constructor and Description |
|---|
JSONSchema() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkSchema(JSONObject data,
JSONObject schema) |
static JSONObject |
generateSchema(JSONObject data)
Generates a schema object from the given instance.
|
static JSONObject |
genSchemaSimpleStd(java.lang.Object o) |
java.util.List<java.lang.String> |
getErrorList()
if the schema validation returns false, then you can ask for a
detailed list of what went wrong with this method.
|
void |
setSchemaLibrary(SchemaLibrary sLib)
If the schema has a #ref token, you will need to supply a
SchemaLibrary that will retrieve the reference for the schema
that is named.
|
public int errorLimit
public boolean recordSuccess
public void setSchemaLibrary(SchemaLibrary sLib)
public static JSONObject generateSchema(JSONObject data) throws java.lang.Exception
java.lang.Exceptionpublic static JSONObject genSchemaSimpleStd(java.lang.Object o) throws java.lang.Exception
java.lang.Exceptionpublic boolean checkSchema(JSONObject data, JSONObject schema) throws java.lang.Exception
java.lang.Exceptionpublic java.util.List<java.lang.String> getErrorList()