Interface ValidationListener
-
public interface ValidationListenerInterface to capture which schemas are matching against a specific event in theValidatingVisitor.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.
-
-
Field Summary
Fields Modifier and Type Field Description static ValidationListenerNOOPDefault no-operation implementation
-
Method Summary
Modifier and Type Method Description default voidcombinedSchemaMatch(CombinedSchemaMatchEvent event)Called when aCombinedSchema's given subschema matches the instance.default voidcombinedSchemaMismatch(CombinedSchemaMismatchEvent event)Called when aCombinedSchema's given subschema does not match the instance.default voidelseSchemaMatch(ConditionalSchemaMatchEvent event)Called when the instance passes the validation against a"else"schema.default voidelseSchemaMismatch(ConditionalSchemaMismatchEvent event)Called when the instance does not pass the validation against a"else"schema.default voidifSchemaMatch(ConditionalSchemaMatchEvent event)Called when an"if"schema matches.default voidifSchemaMismatch(ConditionalSchemaMismatchEvent event)Called when the instance does not pass the validation against an"if"schema.default voidschemaReferenced(SchemaReferencedEvent event)Called when a"$ref"JSON reference is resolved.default voidthenSchemaMatch(ConditionalSchemaMatchEvent event)Called when the instance passes the validation against a"then"schema.default voidthenSchemaMismatch(ConditionalSchemaMismatchEvent event)Called when the instance does not pass the validation against a"then"schema.
-
-
-
Field Detail
-
NOOP
static final ValidationListener NOOP
Default no-operation implementation
-
-
Method Detail
-
combinedSchemaMatch
default void combinedSchemaMatch(CombinedSchemaMatchEvent event)
Called when aCombinedSchema's given subschema matches the instance.The
CombinedSchema(which means an"allOf"or"anyOf"or"oneOf"schema) can be referenced by callingValidationEvent.getSchema()and the matching subschema is returned byCombinedSchemaValidationEvent.getSubSchema().
-
combinedSchemaMismatch
default void combinedSchemaMismatch(CombinedSchemaMismatchEvent event)
Called when aCombinedSchema's given subschema does not match the instance.The
CombinedSchema(which means an"allOf"or"anyOf"or"oneOf"schema) can be referenced by callingValidationEvent.getSchema()and the matching subschema is returned byCombinedSchemaValidationEvent.getSubSchema(). The validation failure of the subschema is returned byCombinedSchemaMismatchEvent.getFailure().Note: the invocation of this method by the validator does not necessarily mean that the validation against the
CombinedSchemawill fail. In the case of the"anyOf"and"oneOf"schemas it can be an intermediate failure while the root-level schema validation still passes.
-
schemaReferenced
default void schemaReferenced(SchemaReferencedEvent event)
Called when a"$ref"JSON reference is resolved.The referred schema is returned by
SchemaReferencedEvent.getReferredSchema(), and the"$ref"itself is returned byValidationEvent.getSchema()
-
ifSchemaMatch
default void ifSchemaMatch(ConditionalSchemaMatchEvent event)
Called when an"if"schema matches.The
ConditionalSchema(holding both the"if","then"and"else"schemas) is returned byValidationEvent.getSchema(), andConditionalSchemaValidationEvent.getKeyword()always returnsConditionalSchemaValidationEvent.Keyword.IFin this method.Note: the invocation of this method does not necessarily mean that the validation of the
ConditionalSchemawill succeed. Instead it means that the evaluation continues with the"then"schema.
-
ifSchemaMismatch
default void ifSchemaMismatch(ConditionalSchemaMismatchEvent event)
Called when the instance does not pass the validation against an"if"schema.The
ConditionalSchema(holding both the"if","then"and"else"schemas) is returned byValidationEvent.getSchema(), andConditionalSchemaValidationEvent.getKeyword()always returnsConditionalSchemaValidationEvent.Keyword.IFin this method.Note: the invocation of this method does not necessarily mean that the validation of the
ConditionalSchemawill fail. Instead it means that the evaluation continues with the"else"schema.
-
thenSchemaMatch
default void thenSchemaMatch(ConditionalSchemaMatchEvent event)
Called when the instance passes the validation against a"then"schema.The
ConditionalSchema(holding both the"if","then"and"else"schemas) is returned byValidationEvent.getSchema(), andConditionalSchemaValidationEvent.getKeyword()always returnsConditionalSchemaValidationEvent.Keyword.THENin this method.
-
thenSchemaMismatch
default void thenSchemaMismatch(ConditionalSchemaMismatchEvent event)
Called when the instance does not pass the validation against a"then"schema.The
ConditionalSchema(holding both the"if","then"and"else"schemas) is returned byValidationEvent.getSchema(), andConditionalSchemaValidationEvent.getKeyword()always returnsConditionalSchemaValidationEvent.Keyword.THENin this method.
-
elseSchemaMatch
default void elseSchemaMatch(ConditionalSchemaMatchEvent event)
Called when the instance passes the validation against a"else"schema.The
ConditionalSchema(holding both the"if","then"and"else"schemas) is returned byValidationEvent.getSchema(), andConditionalSchemaValidationEvent.getKeyword()always returnsConditionalSchemaValidationEvent.Keyword.ELSEin this method.
-
elseSchemaMismatch
default void elseSchemaMismatch(ConditionalSchemaMismatchEvent event)
Called when the instance does not pass the validation against a"else"schema.The
ConditionalSchema(holding both the"if","then"and"else"schemas) is returned byValidationEvent.getSchema(), andConditionalSchemaValidationEvent.getKeyword()always returnsConditionalSchemaValidationEvent.Keyword.ELSEin this method.
-
-