Class ReferenceTypeValidator
- java.lang.Object
-
- org.forgerock.json.schema.validator.validators.Validator
-
- org.forgerock.json.schema.validator.validators.ReferenceTypeValidator
-
- All Implemented Interfaces:
SimpleValidator<Object>
public class ReferenceTypeValidator extends Validator
ReferenceTypeValidator holds a reference to another validator. The reference must be resolved by callingValidator.resolveSchemaReferences()after building all the validators.- See Also:
Constants.REF
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetReference()Returns the reference to the pointed schema.voidsetReferencedValidator(Validator validator)Sets the validator being referenced by this object.voidvalidate(Object node, JsonPointer at, ErrorHandler handler)Validates thenodevalue 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 Detail
-
ReferenceTypeValidator
public ReferenceTypeValidator(Map<String,Object> schema, String reference, List<String> jsonPointer)
Default ctor.- Parameters:
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.
-
-
Method Detail
-
validate
public void validate(Object node, JsonPointer at, ErrorHandler handler)
Validates thenodevalue against the embedded schema object.The selected error handler defines the behaviour of the validator. The
FailFastErrorHandlerthrows exception at firs violation. Other customisedErrorHandlercan collect all exceptions and after the validation the examination of thehandlercontains the final result.- Parameters:
node- value to validateat- JSONPath of the node. null means it's the root nodehandler- customised error handler likeFailFastErrorHandler
-
getReference
public String getReference()
Returns the reference to the pointed schema.- Returns:
- the reference to the pointed schema
-
setReferencedValidator
public void setReferencedValidator(Validator validator)
Sets the validator being referenced by this object.- Parameters:
validator- the validator being referenced by this object
-
-