Package com.networknt.schema
Class ValidationMessageHandler
- java.lang.Object
-
- com.networknt.schema.ValidationMessageHandler
-
- Direct Known Subclasses:
BaseJsonValidator
public abstract class ValidationMessageHandler extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
customErrorMessagesEnabled
protected Map<String,String>
errorMessage
protected ErrorMessageType
errorMessageType
protected JsonSchema
evaluationParentSchema
protected JsonNodePath
evaluationPath
protected Keyword
keyword
protected MessageSource
messageSource
protected JsonSchema
parentSchema
protected SchemaLocation
schemaLocation
-
Constructor Summary
Constructors Modifier Constructor Description protected
ValidationMessageHandler(ErrorMessageType errorMessageType, boolean customErrorMessagesEnabled, MessageSource messageSource, Keyword keyword, JsonSchema parentSchema, SchemaLocation schemaLocation, JsonNodePath evaluationPath)
protected
ValidationMessageHandler(ValidationMessageHandler copy)
Copy constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
getErrorCodeKey(String keyword)
protected Map<String,String>
getErrorMessage(com.fasterxml.jackson.databind.JsonNode schemaNode, String keyword)
Gets the custom error message to use.protected ErrorMessageType
getErrorMessageType()
protected com.fasterxml.jackson.databind.JsonNode
getMessageNode(com.fasterxml.jackson.databind.JsonNode schemaNode, JsonSchema parentSchema, String pname)
protected MessageSourceValidationMessage.Builder
message()
protected void
parseErrorCode(String errorCodeKey)
protected void
updateErrorMessageType(ErrorMessageType errorMessageType)
protected void
updateKeyword(Keyword keyword)
protected void
updateValidatorType(ValidatorTypeCode validatorTypeCode)
-
-
-
Field Detail
-
messageSource
protected final MessageSource messageSource
-
errorMessageType
protected ErrorMessageType errorMessageType
-
schemaLocation
protected SchemaLocation schemaLocation
-
evaluationPath
protected JsonNodePath evaluationPath
-
evaluationParentSchema
protected JsonSchema evaluationParentSchema
-
parentSchema
protected JsonSchema parentSchema
-
customErrorMessagesEnabled
protected boolean customErrorMessagesEnabled
-
keyword
protected Keyword keyword
-
-
Constructor Detail
-
ValidationMessageHandler
protected ValidationMessageHandler(ErrorMessageType errorMessageType, boolean customErrorMessagesEnabled, MessageSource messageSource, Keyword keyword, JsonSchema parentSchema, SchemaLocation schemaLocation, JsonNodePath evaluationPath)
-
ValidationMessageHandler
protected ValidationMessageHandler(ValidationMessageHandler copy)
Copy constructor.- Parameters:
copy
- to copy from
-
-
Method Detail
-
message
protected MessageSourceValidationMessage.Builder message()
-
getErrorMessageType
protected ErrorMessageType getErrorMessageType()
-
parseErrorCode
protected void parseErrorCode(String errorCodeKey)
-
updateValidatorType
protected void updateValidatorType(ValidatorTypeCode validatorTypeCode)
-
updateErrorMessageType
protected void updateErrorMessageType(ErrorMessageType errorMessageType)
-
updateKeyword
protected void updateKeyword(Keyword keyword)
-
getErrorMessage
protected Map<String,String> getErrorMessage(com.fasterxml.jackson.databind.JsonNode schemaNode, String keyword)
Gets the custom error message to use.- Parameters:
schemaNode
- the schema nodekeyword
- the keyword- Returns:
- the custom error message
-
getMessageNode
protected com.fasterxml.jackson.databind.JsonNode getMessageNode(com.fasterxml.jackson.databind.JsonNode schemaNode, JsonSchema parentSchema, String pname)
-
-