Class StringTypeValidator
- java.lang.Object
-
- org.forgerock.json.schema.validator.validators.Validator
-
- org.forgerock.json.schema.validator.validators.StringTypeValidator
-
- All Implemented Interfaces:
SimpleValidator<Object>
public class StringTypeValidator extends Validator
StringTypeValidator applies all the constraints of astringtype.Sample JSON Schema:
{ "type" : "string", "required" : true, "minLength" : 1, "maxLength" : 8, "enum" : [ " ", "number1", "number2", "123456789" ], "pattern-fix" : ".*", "format-fix" : "date" }- See Also:
- type
-
-
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.-
Methods inherited from class org.forgerock.json.schema.validator.validators.Validator
collectAllValidators, collectAllValidators, collectAllValidators, getJsonPointer, getPath, isRequired, newList, resolveSchemaReferences, toString
-
-
-
-
Method Detail
-
validate
public void validate(Object node, JsonPointer at, ErrorHandler handler) throws SchemaException
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- Throws:
SchemaException- when thenodeviolates with the schema
-
-