Package org.everit.json.schema
Class ArraySchema
java.lang.Object
org.everit.json.schema.Schema
org.everit.json.schema.ArraySchema
Array schema validator.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class org.everit.json.schema.Schema
schemaLocation -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ArraySchema.Builderbuilder()protected booleanSince we add state in subclasses, but want those subclasses to be non final, this allows us to have equals methods that satisfy the equals contract.booleandefinesProperty(String field) Determines if thisSchemainstance defines any restrictions for the object property denoted byfield.booleaninthashCode()booleanbooleanbooleanMethods inherited from class org.everit.json.schema.Schema
describeTo, failure, failure, getDefaultValue, getDescription, getId, getLocation, getSchemaLocation, getTitle, getUnprocessedProperties, hasDefaultValue, isNullable, isReadOnly, isWriteOnly, toString, validate
-
Constructor Details
-
ArraySchema
Constructor.- Parameters:
builder- contains validation criteria.
-
-
Method Details
-
builder
-
getAllItemSchema
-
getItemSchemas
-
getMaxItems
-
getMinItems
-
getSchemaOfAdditionalItems
-
getContainedItemSchema
-
needsUniqueItems
public boolean needsUniqueItems() -
permitsAdditionalItems
public boolean permitsAdditionalItems() -
requiresArray
public boolean requiresArray() -
equals
-
definesProperty
Description copied from class:SchemaDetermines if thisSchemainstance defines any restrictions for the object property denoted byfield. Thefieldshould be a JSON pointer, denoting the property to be queried.For example the field
"#/rectangle/a"is defined by the following schema:
You can also check if a subschema of an array defines a property. In that case, to traverse the array, you can either use an integer array index, or theobjectWithSchemaRectangleDep" : { "type" : "object", "dependencies" : { "d" : { "type" : "object", "properties" : { "rectangle" : { "$ref" : "#/definitions/Rectangle" }, "list": { "type": "array", "items": { "properties": { "prop": {} } }, "minItems": 2, "maxItems: 3 } } } }, "definitions" : { "size" : { "type" : "number", "minimum" : 0 }, "Rectangle" : { "type" : "object", "properties" : { "a" : {"$ref" : "#/definitions/size"}, "b" : {"$ref" : "#/definitions/size"} } } } }"all"or"any"meta-indexes. For example, in the above schemadefinesProperty("#/list/any/prop")returnstruedefinesProperty("#/list/all/prop")returnstruedefinesProperty("#/list/1/prop")returnstruedefinesProperty("#/list/1/nonexistent")returnsfalse(the property is not present in the subschema)definesProperty("#/list/8/prop")returnsfalse(the"list"does not define property8, since"maxItems"is3)
- Overrides:
definesPropertyin classSchema- Parameters:
field- should be a JSON pointer in its string representation.- Returns:
trueif the propertty denoted byfieldis defined by this schema instance
-
canEqual
Description copied from class:SchemaSince we add state in subclasses, but want those subclasses to be non final, this allows us to have equals methods that satisfy the equals contract.http://www.artima.com/lejava/articles/equality.html
-
hashCode
public int hashCode()
-