org.springframework.validation

Class FieldError

    • Constructor Summary

      Constructors 
      Constructor and Description
      FieldError(java.lang.String objectName, java.lang.String field, java.lang.Object rejectedValue, boolean bindingFailure, java.lang.String[] codes, java.lang.Object[] arguments, java.lang.String defaultMessage)
      Create a new FieldError instance.
      FieldError(java.lang.String objectName, java.lang.String field, java.lang.String defaultMessage)
      Create a new FieldError instance.
    • Constructor Detail

      • FieldError

        public FieldError(java.lang.String objectName,
                          java.lang.String field,
                          java.lang.String defaultMessage)
        Create a new FieldError instance.
        Parameters:
        objectName - the name of the affected object
        field - the affected field of the object
        defaultMessage - the default message to be used to resolve this message
      • FieldError

        public FieldError(java.lang.String objectName,
                          java.lang.String field,
                          @Nullable
                          java.lang.Object rejectedValue,
                          boolean bindingFailure,
                          @Nullable
                          java.lang.String[] codes,
                          @Nullable
                          java.lang.Object[] arguments,
                          @Nullable
                          java.lang.String defaultMessage)
        Create a new FieldError instance.
        Parameters:
        objectName - the name of the affected object
        field - the affected field of the object
        rejectedValue - the rejected field value
        bindingFailure - whether this error represents a binding failure (like a type mismatch); else, it is a validation failure
        codes - the codes to be used to resolve this message
        arguments - the array of arguments to be used to resolve this message
        defaultMessage - the default message to be used to resolve this message
    • Method Detail

      • getField

        public java.lang.String getField()
        Return the affected field of the object.
      • getRejectedValue

        @Nullable
        public java.lang.Object getRejectedValue()
        Return the rejected field value.
      • isBindingFailure

        public boolean isBindingFailure()
        Return whether this error represents a binding failure (like a type mismatch); otherwise it is a validation failure.