public class StringTypeValidator extends Validator
string
type.
Sample JSON Schema:
{
"type" : "string",
"required" : true,
"minLength" : 1,
"maxLength" : 8,
"enum" : [
" ",
"number1",
"number2",
"123456789"
],
"pattern-fix" : ".*",
"format-fix" : "date"
}
Constructor and Description |
---|
StringTypeValidator(Map<String,Object> schema,
List<String> jsonPointer)
Create a string type validator.
|
Modifier and Type | Method and Description |
---|---|
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 void validate(Object node, JsonPointer at, ErrorHandler handler) throws SchemaException
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
SchemaException
- when the node
violates with the schemaCopyright © 2025 Open Identity Platform Community. All rights reserved.