Class ValidationErrorData

  • Direct Known Subclasses:
    ValidationError

    public class ValidationErrorData
    extends Object
    Validation error entity to be included in Response if JAX-B API is not available
    • Field Detail

      • message

        protected String message
      • messageTemplate

        protected String messageTemplate
      • invalidValue

        protected String invalidValue
    • Method Detail

      • getMessage

        public String getMessage()
        Return the interpolated error message for this validation error.
        Returns:
        the interpolated error message for this validation error.
      • setMessage

        public void setMessage​(String message)
        Return the interpolated error message for this validation error.
        Parameters:
        message - the interpolated error message for this validation error.
      • getPath

        public String getPath()
        Return the string representation of the property path to the value.
        Returns:
        the string representation of the property path to the value.
      • setPath

        public void setPath​(String path)
        Set the string representation of the property path to the value.
        Parameters:
        path - the string representation of the property path to the value.
      • getInvalidValue

        public String getInvalidValue()
        Returns the string representation of the value failing to pass the constraint.
        Returns:
        the value failing to pass the constraint.
      • setInvalidValue

        public void setInvalidValue​(String invalidValue)
        Set the value failing to pass the constraint.
        Parameters:
        invalidValue - the value failing to pass the constraint.
      • getMessageTemplate

        public String getMessageTemplate()
        Return the non-interpolated error message for this validation error.
        Returns:
        the non-interpolated error message for this validation error.
      • setMessageTemplate

        public void setMessageTemplate​(String messageTemplate)
        Set the non-interpolated error message for this validation error.
        Parameters:
        messageTemplate - the non-interpolated error message for this validation error.
      • createValidationError

        public static ValidationErrorData createValidationError​(String message,
                                                                String messageTemplate,
                                                                String path,
                                                                String invalidValue)
        A factory method that creates either JAX-B annotated data if JAX-B is available or POJO data otherwise.
        Parameters:
        message - interpolated error message.
        messageTemplate - non-interpolated error message.
        path - property path.
        invalidValue - value that failed to pass constraints.
        Returns:
        ValidationErrorData subclass or itself