public interface ValidationListener
ValidatingVisitor.
All methods of this interface have a default empty implementation, so if an interface implementation is interested only about a few specific event types, there is no need to add empty overrides of the unhandles events.
| Modifier and Type | Field and Description |
|---|---|
static ValidationListener |
NOOP
Default no-operation implementation
|
| Modifier and Type | Method and Description |
|---|---|
default void |
combinedSchemaMatch(CombinedSchemaMatchEvent event)
Called when a
CombinedSchema's given subschema matches the instance. |
default void |
combinedSchemaMismatch(CombinedSchemaMismatchEvent event)
Called when a
CombinedSchema's given subschema does not match the instance. |
default void |
elseSchemaMatch(ConditionalSchemaMatchEvent event)
Called when the instance passes the validation against a
"else" schema. |
default void |
elseSchemaMismatch(ConditionalSchemaMismatchEvent event)
Called when the instance does not pass the validation against a
"else" schema. |
default void |
ifSchemaMatch(ConditionalSchemaMatchEvent event)
Called when an
"if" schema matches. |
default void |
ifSchemaMismatch(ConditionalSchemaMismatchEvent event)
Called when the instance does not pass the validation against an
"if" schema. |
default void |
schemaReferenced(SchemaReferencedEvent event)
Called when a
"$ref" JSON reference is resolved. |
default void |
thenSchemaMatch(ConditionalSchemaMatchEvent event)
Called when the instance passes the validation against a
"then" schema. |
default void |
thenSchemaMismatch(ConditionalSchemaMismatchEvent event)
Called when the instance does not pass the validation against a
"then" schema. |
static final ValidationListener NOOP
default void combinedSchemaMatch(CombinedSchemaMatchEvent event)
CombinedSchema's given subschema matches the instance.
The CombinedSchema (which means an "allOf" or "anyOf" or
"oneOf" schema) can be referenced by calling ValidationEvent.getSchema() and the
matching subschema is returned by CombinedSchemaValidationEvent.getSubSchema().
default void combinedSchemaMismatch(CombinedSchemaMismatchEvent event)
CombinedSchema's given subschema does not match the instance.
The CombinedSchema (which means an "allOf" or "anyOf" or
"oneOf" schema) can be referenced by calling ValidationEvent.getSchema() and the
matching subschema is returned by CombinedSchemaValidationEvent.getSubSchema(). The validation failure
of the subschema is returned by CombinedSchemaMismatchEvent.getFailure().
Note: the invocation of this method by the validator does not necessarily mean that the validation
against the CombinedSchema will fail. In the case of the "anyOf" and
"oneOf" schemas it can be an intermediate failure while the root-level schema validation still
passes.
default void schemaReferenced(SchemaReferencedEvent event)
"$ref" JSON reference is resolved.
The referred schema is returned by SchemaReferencedEvent.getReferredSchema(), and the
"$ref" itself is returned by
ValidationEvent.getSchema()
default void ifSchemaMatch(ConditionalSchemaMatchEvent event)
"if" schema matches.
The ConditionalSchema (holding both the "if", "then" and
"else" schemas) is returned by ValidationEvent.getSchema(), and
ConditionalSchemaValidationEvent.getKeyword() always returns
ConditionalSchemaValidationEvent.Keyword.IF in this method.
Note: the invocation of this method does not necessarily mean that the validation of the
ConditionalSchema will succeed. Instead it means that the evaluation continues
with the "then" schema.
default void ifSchemaMismatch(ConditionalSchemaMismatchEvent event)
"if" schema.
The ConditionalSchema (holding both the "if", "then" and
"else" schemas) is returned by ValidationEvent.getSchema(), and
ConditionalSchemaValidationEvent.getKeyword() always returns
ConditionalSchemaValidationEvent.Keyword.IF in this method.
Note: the invocation of this method does not necessarily mean that the validation of the
ConditionalSchema will fail. Instead it means that the evaluation continues
with the "else" schema.
default void thenSchemaMatch(ConditionalSchemaMatchEvent event)
"then" schema.
The ConditionalSchema (holding both the "if", "then" and
"else" schemas) is returned by ValidationEvent.getSchema(), and
ConditionalSchemaValidationEvent.getKeyword() always returns
ConditionalSchemaValidationEvent.Keyword.THEN in this method.
default void thenSchemaMismatch(ConditionalSchemaMismatchEvent event)
"then" schema.
The ConditionalSchema (holding both the "if", "then" and
"else" schemas) is returned by ValidationEvent.getSchema(), and
ConditionalSchemaValidationEvent.getKeyword() always returns
ConditionalSchemaValidationEvent.Keyword.THEN in this method.
default void elseSchemaMatch(ConditionalSchemaMatchEvent event)
"else" schema.
The ConditionalSchema (holding both the "if", "then" and
"else" schemas) is returned by ValidationEvent.getSchema(), and
ConditionalSchemaValidationEvent.getKeyword() always returns
ConditionalSchemaValidationEvent.Keyword.ELSE in this method.
default void elseSchemaMismatch(ConditionalSchemaMismatchEvent event)
"else" schema.
The ConditionalSchema (holding both the "if", "then" and
"else" schemas) is returned by ValidationEvent.getSchema(), and
ConditionalSchemaValidationEvent.getKeyword() always returns
ConditionalSchemaValidationEvent.Keyword.ELSE in this method.
Copyright © 2023 Everit Kft.. All rights reserved.