Class ValidationMessageHandler

java.lang.Object
com.networknt.schema.ValidationMessageHandler
Direct Known Subclasses:
BaseJsonValidator

public abstract class ValidationMessageHandler extends Object
Validation message handler.
  • Field Details

    • errorMessageType

      protected final ErrorMessageType errorMessageType
    • errorMessageKeyword

      protected final String errorMessageKeyword
    • messageSource

      protected final MessageSource messageSource
    • keyword

      protected final Keyword keyword
    • parentSchema

      protected final JsonSchema parentSchema
    • schemaLocation

      protected final SchemaLocation schemaLocation
    • evaluationPath

      protected final JsonNodePath evaluationPath
    • evaluationParentSchema

      protected final JsonSchema evaluationParentSchema
    • errorMessage

      protected final Map<String,String> 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 type
      errorMessageKeyword - the error message keyword
      messageSource - the message source
      keyword - the keyword
      parentSchema - the parent schema
      schemaLocation - the schema location
      evaluationPath - the evaluation path
      evaluationParentSchema - the evaluation parent schema
      errorMessage - the error message
  • Method Details

    • message

    • getErrorMessageType

      protected ErrorMessageType 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 keyword
      schemaNode - the schema node
      keyword - 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)