public class ReferenceTypeValidator extends Validator
Validator.resolveSchemaReferences()
after
building all the validators.Constants.REF
Constructor and Description |
---|
ReferenceTypeValidator(Map<String,Object> schema,
String reference,
List<String> jsonPointer)
Default ctor.
|
Modifier and Type | Method and Description |
---|---|
String |
getReference()
Returns the reference to the pointed schema.
|
void |
setReferencedValidator(Validator validator)
Sets the validator being referenced by this object.
|
void |
validate(Object node,
JsonPointer at,
ErrorHandler handler)
Validates the
node value against the embedded schema object. |
collectAllValidators, collectAllValidators, collectAllValidators, getJsonPointer, getPath, isRequired, newList, resolveSchemaReferences, toString
public ReferenceTypeValidator(Map<String,Object> schema, String reference, List<String> jsonPointer)
schema
- the schema holding the reference to this validatorreference
- the reference to the pointed schemajsonPointer
- the JSON pointer locating where this validator was defined in the schema.public void validate(Object node, JsonPointer at, ErrorHandler handler)
node
value against the embedded schema object.
The selected error handler defines the behaviour of the validator. The
FailFastErrorHandler
throws exception at firs violation.
Other customised ErrorHandler
can collect all exceptions and after the validation the
examination of the handler
contains the final result.
node
- value to validateat
- JSONPath of the node. null means it's the root nodehandler
- customised error handler like FailFastErrorHandler
public String getReference()
public void setReferencedValidator(Validator validator)
validator
- the validator being referenced by this objectCopyright 2010-2020 ForgeRock AS.