public class PropertiesValidator extends BaseJsonValidator implements JsonValidator
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PROPERTY |
AT_ROOT
Constructor and Description |
---|
PropertiesValidator(java.lang.String schemaPath,
com.google.gson.JsonElement schemaNode,
JsonSchema parentSchema) |
Modifier and Type | Method and Description |
---|---|
com.google.gson.JsonObject |
deriveDefaultObject() |
com.google.gson.JsonObject |
deriveDefaultObject(boolean injectExampleIfPresent)
Returns a derived JsonObject which may include values declared under the 'example' key.
|
protected java.util.Optional<JsonSchema> |
findSchemaForProperty(java.lang.String propertyKey) |
java.util.List<java.lang.String> |
getPropertyNames() |
java.util.Set<ValidationMessage> |
validate(com.google.gson.JsonElement node,
com.google.gson.JsonElement rootNode,
java.lang.String at)
Validate the given JsonElement, the given node is the child node of the root node at given
data path.
|
asInt, buildValidationMessage, debug, equals, getParentSchema, getSchemaNode, getSchemaPath, getSubSchema, getValidatorType, greaterThan, hasSubSchema, lessThan, obtainSubSchemaNode, parseErrorCode, useRefCache, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
validate
public static final java.lang.String PROPERTY
public PropertiesValidator(java.lang.String schemaPath, com.google.gson.JsonElement schemaNode, JsonSchema parentSchema)
protected java.util.Optional<JsonSchema> findSchemaForProperty(java.lang.String propertyKey)
public java.util.Set<ValidationMessage> validate(com.google.gson.JsonElement node, com.google.gson.JsonElement rootNode, java.lang.String at)
JsonValidator
validate
in interface JsonValidator
node
- JsonElementrootNode
- JsonElementat
- Stringpublic java.util.List<java.lang.String> getPropertyNames()
public com.google.gson.JsonObject deriveDefaultObject(boolean injectExampleIfPresent)
injectExampleIfPresent
- if true, checks for example values and adds them as the default.public com.google.gson.JsonObject deriveDefaultObject()