|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SchemaLibrary
A library of JSON Schema documents. Because JSON Schemas are in fact JSON documents, this library is also a DocumentLibrary.
Nested Class Summary | |
---|---|
static interface |
SchemaLibrary.MismatchedTypeProblem
A special type of problem where a field value was not of the expected type, but where the field value could be converted to the expected type |
static interface |
SchemaLibrary.Problem
|
static class |
SchemaLibrary.ProblemType
|
static interface |
SchemaLibrary.Results
The results from a validation . |
Method Summary | |
---|---|
Document |
convertValues(Document document,
SchemaLibrary.Results results)
Look for fields within the document (including nested documents) whose values are not of the expected type for the given schema, but whose values can be converted into the expected type. |
Document |
convertValues(Document document,
String schemaUri)
Look for fields within the document (including nested documents) whose values are not of the expected type for the given schema, but whose values can be converted into the expected type. |
SchemaLibrary.Results |
validate(Document document,
String schemaUri)
Validate the supplied document against the JSON Schema with the supplied URI. |
Methods inherited from interface org.infinispan.schematic.DocumentLibrary |
---|
get, getAsync, getName, put, putAsync, putIfAbsent, putIfAbsentAsync, remove, removeAsync, replace, replaceAsync |
Method Detail |
---|
SchemaLibrary.Results validate(Document document, String schemaUri)
document
- the document to be validated; may not be nullschemaUri
- the URI of the JSON Schema that should be used to validate the document; may not be null
Document convertValues(Document document, SchemaLibrary.Results results)
This is often useful when the results from validate(Document, String)
contain only
mismatched type errors
. In such a case, the document can be converted and the
resulting document will likely satisfy the schema.
document
- the document to be validated; may not be nullresults
- the results from the validate(Document, String)
call; may not be null
document
if theDocument convertValues(Document document, String schemaUri)
This method is similar to convertValues(Document, Results)
, except that this method automatically runs a JSON
Schema validation to obtain the results. If you've already validated
the document, then
instead of calling this method (which would validate a second time) try calling convertValues(Document, Results)
.
document
- the document to be validated; may not be nullschemaUri
- the URI of the JSON Schema that should be used to validate the document; may not be null
document
if the
|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |