Class FormatHelper
- java.lang.Object
-
- org.forgerock.json.schema.validator.helpers.FormatHelper
-
- All Implemented Interfaces:
SimpleValidator<Object>
public class FormatHelper extends Object implements SimpleValidator<Object>
This class implements "format" validation on primitive types of objects as defined in the paragraph 5.23 of the JSON Schema specification.Additional custom formats MAY be created. These custom formats MAY be expressed as an URI, and this URI MAY reference a schema of that format.
- See Also:
- format
-
-
Constructor Summary
Constructors Constructor Description FormatHelper(String format)Construct a new format helper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidvalidate(Object node, JsonPointer at, ErrorHandler handler)Validates thenodevalue against the embedded schema object.
-
-
-
Constructor Detail
-
FormatHelper
public FormatHelper(String format)
Construct a new format helper.- Parameters:
format- The format.
-
-
Method Detail
-
validate
public void validate(Object node, JsonPointer at, ErrorHandler handler) throws SchemaException
Description copied from interface:SimpleValidatorValidates 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.- Specified by:
validatein interfaceSimpleValidator<Object>- Parameters:
node- value to validateat- JSONPath of the node. null means it's the root nodehandler- customised error handler likeFailFastErrorHandler- Throws:
SchemaException- when thenodeviolates with the schema
-
-