Class NullTypeValidator
java.lang.Object
org.forgerock.json.schema.validator.validators.Validator
org.forgerock.json.schema.validator.validators.NullTypeValidator
- All Implemented Interfaces:
SimpleValidator<Object>
null Value MUST be null. Note this is mainly for purpose of
being able use union types to define nullability. If this validators
is not included in a union, null values are not allowed (the
primitives do not allow nulls on their own.
- See Also:
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
validate
(Object node, JsonPointer at, ErrorHandler handler) Validates thenode
value against the embedded schema object.Methods inherited from class org.forgerock.json.schema.validator.validators.Validator
collectAllValidators, collectAllValidators, collectAllValidators, getJsonPointer, getPath, isRequired, newList, resolveSchemaReferences, toString
-
Constructor Details
-
NullTypeValidator
Construct a null type validator.- Parameters:
schema
- The schema.jsonPointer
- The pointer.
-
-
Method Details
-
validate
Description copied from interface:SimpleValidator
Validates thenode
value against the embedded schema object.The selected error handler defines the behaviour of the validator. The
FailFastErrorHandler
throws exception at firs violation. Other customisedErrorHandler
can collect all exceptions and after the validation the examination of thehandler
contains the final result.- Parameters:
node
- value to validateat
- JSONPath of the node. null means it's the root nodehandler
- customised error handler likeFailFastErrorHandler
- Throws:
SchemaException
- when thenode
violates with the schema
-