Class InputValidationException

All Implemented Interfaces:
Serializable

public class InputValidationException extends BadRequestException
Exception class for input validation errors.
Author:
Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
See Also:
  • Field Details

    • ERROR_CODE

      protected static final ErrorCode.Code ERROR_CODE
      The error code for this type of errors.
  • Constructor Details

    • InputValidationException

      public InputValidationException(String objectName)
      Constructor taking the name of the object being validated.
      Parameters:
      objectName - the field name of the object being validated
    • InputValidationException

      public InputValidationException(String objectName, String msg)
      Constructor taking the name of the object being validated and an error message.
      Parameters:
      objectName - the field name of the object being validated
      msg - the error message
    • InputValidationException

      public InputValidationException(String objectName, Map<String,String> details)
      Constructor taking the name of the object being validated and underlying errors details (field names and error messages).
      Parameters:
      objectName - the field name of the object being validated
      details - underlying error information (field names and error messages)
    • InputValidationException

      public InputValidationException(String objectName, String msg, Map<String,String> details)
      Constructor taking the name of the object being validated, an error message and underlying errors details (field names and error messages).
      Parameters:
      objectName - the field name of the object being validated
      msg - the error message
      details - underlying error information (field names and error messages)
    • InputValidationException

      public InputValidationException(String objectName, Throwable cause)
      Constructor taking the name of the object being validated.
      Parameters:
      objectName - the field name of the object being validated
      cause - the cause of the error
    • InputValidationException

      public InputValidationException(String objectName, String msg, Throwable cause)
      Constructor taking the name of the object being validated and an error message.
      Parameters:
      objectName - the field name of the object being validated
      msg - the error message
      cause - the cause of the error
    • InputValidationException

      public InputValidationException(String objectName, Map<String,String> details, Throwable cause)
      Constructor taking the name of the object being validated and underlying errors details (field names and error messages).
      Parameters:
      objectName - the field name of the object being validated
      details - underlying error information (field names and error messages)
      cause - the cause of the error
    • InputValidationException

      public InputValidationException(String objectName, String msg, Map<String,String> details, Throwable cause)
      Constructor taking the name of the object being validated, an error message and underlying errors details (field names and error messages).
      Parameters:
      objectName - the field name of the object being validated
      msg - the error message
      details - underlying error information (field names and error messages)
      cause - the cause of the error
  • Method Details

    • getObjectName

      public String getObjectName()
      Gets the name of the object that was validated.
      Returns:
      the name of the validated object
    • getDetails

      public Map<String,String> getDetails()
      Gets the details for the validation error. The map consists of field names for the underlying object that were validated and associated error messages.
      Returns:
      a map of field names and error messages, or null if no details are set