public abstract class Schema extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Schema.Builder<S extends Schema>
Abstract builder class for the builder classes of
Schema subclasses. |
| Modifier | Constructor and Description |
|---|---|
protected |
Schema(Schema.Builder<?> builder)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
definesProperty(String field)
Determines if this
Schema instance defines any restrictions for the object property
denoted by field. |
boolean |
equals(Object obj) |
String |
getDescription() |
String |
getId() |
String |
getTitle() |
int |
hashCode() |
abstract void |
validate(Object subject)
Performs the schema validation.
|
protected Schema(Schema.Builder<?> builder)
builder - the builder containing the optional title, description and id attributes of the schemapublic abstract void validate(Object subject)
subject - the object to be validatedValidationException - if the subject is invalid against this schema.public boolean definesProperty(String field)
Schema instance defines any restrictions for the object property
denoted by field. The field should be a JSON pointer, denoting the property to
be queried.
For example the field "#/rectangle/a" is defined by the following schema:
objectWithSchemaRectangleDep" : {
"type" : "object",
"dependencies" : {
"d" : {
"type" : "object",
"properties" : {
"rectangle" : {"$ref" : "#/definitions/Rectangle" }
}
}
},
"definitions" : {
"size" : {
"type" : "number",
"minimum" : 0
},
"Rectangle" : {
"type" : "object",
"properties" : {
"a" : {"$ref" : "#/definitions/size"},
"b" : {"$ref" : "#/definitions/size"}
}
}
}
}
The default implementation of this method always returns false.field - should be a JSON pointer in its string representation.true if the propertty denoted by field is defined by this schema
instance@Generated(value="eclipse") public boolean equals(Object obj)
public String getTitle()
public String getDescription()
public String getId()
Copyright © 2016 Everit Kft.. All rights reserved.