Package com.networknt.schema
Class ValidationMessageHandler
java.lang.Object
com.networknt.schema.ValidationMessageHandler
- Direct Known Subclasses:
BaseJsonValidator
Validation message handler.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final String
protected final ErrorMessageType
protected final JsonSchema
protected final JsonNodePath
protected final Keyword
protected final MessageSource
protected final JsonSchema
protected final SchemaLocation
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ValidationMessageHandler
(ErrorMessageType errorMessageType, String errorMessageKeyword, MessageSource messageSource, Keyword keyword, JsonSchema parentSchema, SchemaLocation schemaLocation, JsonNodePath evaluationPath) protected
ValidationMessageHandler
(ErrorMessageType errorMessageType, String errorMessageKeyword, MessageSource messageSource, Keyword keyword, JsonSchema parentSchema, SchemaLocation schemaLocation, JsonNodePath evaluationPath, JsonSchema evaluationParentSchema, Map<String, String> errorMessage) Constructor to create a copy using fields. -
Method Summary
Modifier and TypeMethodDescriptiongetErrorMessage
(String errorMessageKeyword, com.fasterxml.jackson.databind.JsonNode schemaNode, String keyword) Gets the custom error message to use.protected ErrorMessageType
protected com.fasterxml.jackson.databind.JsonNode
getMessageNode
(String errorMessageKeyword, com.fasterxml.jackson.databind.JsonNode schemaNode, JsonSchema parentSchema, String pname) protected MessageSourceValidationMessage.Builder
message()
-
Field Details
-
errorMessageType
-
errorMessageKeyword
-
messageSource
-
keyword
-
parentSchema
-
schemaLocation
-
evaluationPath
-
evaluationParentSchema
-
errorMessage
-
-
Constructor Details
-
ValidationMessageHandler
protected ValidationMessageHandler(ErrorMessageType errorMessageType, String errorMessageKeyword, MessageSource messageSource, Keyword keyword, JsonSchema parentSchema, SchemaLocation schemaLocation, JsonNodePath evaluationPath) -
ValidationMessageHandler
protected ValidationMessageHandler(ErrorMessageType errorMessageType, String errorMessageKeyword, MessageSource messageSource, Keyword keyword, JsonSchema parentSchema, SchemaLocation schemaLocation, JsonNodePath evaluationPath, JsonSchema evaluationParentSchema, Map<String, String> errorMessage) Constructor to create a copy using fields.- Parameters:
errorMessageType
- the error message typeerrorMessageKeyword
- the error message keywordmessageSource
- the message sourcekeyword
- the keywordparentSchema
- the parent schemaschemaLocation
- the schema locationevaluationPath
- the evaluation pathevaluationParentSchema
- the evaluation parent schemaerrorMessage
- the error message
-
-
Method Details
-
message
-
getErrorMessageType
-
getErrorMessage
protected Map<String,String> getErrorMessage(String errorMessageKeyword, com.fasterxml.jackson.databind.JsonNode schemaNode, String keyword) Gets the custom error message to use.- Parameters:
errorMessageKeyword
- the error message keywordschemaNode
- the schema nodekeyword
- the keyword- Returns:
- the custom error message
-
getMessageNode
protected com.fasterxml.jackson.databind.JsonNode getMessageNode(String errorMessageKeyword, com.fasterxml.jackson.databind.JsonNode schemaNode, JsonSchema parentSchema, String pname)
-