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 Stringprotected final ErrorMessageTypeprotected final JsonSchemaprotected final JsonNodePathprotected final Keywordprotected final MessageSourceprotected final JsonSchemaprotected final SchemaLocation -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedValidationMessageHandler(ErrorMessageType errorMessageType, String errorMessageKeyword, MessageSource messageSource, Keyword keyword, JsonSchema parentSchema, SchemaLocation schemaLocation, JsonNodePath evaluationPath) protectedValidationMessageHandler(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 ErrorMessageTypeprotected com.fasterxml.jackson.databind.JsonNodegetMessageNode(String errorMessageKeyword, com.fasterxml.jackson.databind.JsonNode schemaNode, JsonSchema parentSchema, String pname) protected MessageSourceValidationMessage.Buildermessage()
-
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)
-