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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ValidationListenerDefault no-operation implementation -
Method Summary
Modifier and TypeMethodDescriptiondefault voidCalled when aCombinedSchema's given subschema matches the instance.default voidCalled when aCombinedSchema's given subschema does not match the instance.default voidCalled when the instance passes the validation against a"else"schema.default voidCalled when the instance does not pass the validation against a"else"schema.default voidCalled when an"if"schema matches.default voidCalled when the instance does not pass the validation against an"if"schema.default voidCalled when a"$ref"JSON reference is resolved.default voidCalled when the instance passes the validation against a"then"schema.default voidCalled when the instance does not pass the validation against a"then"schema.
-
Field Details
-
NOOP
Default no-operation implementation
-
-
Method Details
-
combinedSchemaMatch
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
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
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
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
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
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
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
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
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.
-