Class WebExchangeBindException

All Implemented Interfaces:
Serializable, org.springframework.validation.BindingResult, org.springframework.validation.Errors, ErrorResponse

public class WebExchangeBindException extends ServerWebInputException implements org.springframework.validation.BindingResult
ServerWebInputException subclass that indicates a data binding or validation failure.
Since:
5.0
Author:
Rossen Stoyanchev
See Also:
  • Constructor Details

    • WebExchangeBindException

      public WebExchangeBindException(org.springframework.core.MethodParameter parameter, org.springframework.validation.BindingResult bindingResult)
  • Method Details

    • getBindingResult

      public final org.springframework.validation.BindingResult getBindingResult()
      Return the BindingResult that this BindException wraps.

      Will typically be a BeanPropertyBindingResult.

      See Also:
      • BeanPropertyBindingResult
    • getDetailMessageArguments

      public Object[] getDetailMessageArguments()
      Description copied from interface: ErrorResponse
      Return arguments to use along with a message code to resolve the problem "detail" for this exception through a MessageSource. The arguments are expanded into placeholders of the message value, e.g. "Invalid content type {0}".
      Specified by:
      getDetailMessageArguments in interface ErrorResponse
      Overrides:
      getDetailMessageArguments in class ErrorResponseException
    • getDetailMessageArguments

      public Object[] getDetailMessageArguments(org.springframework.context.MessageSource source, Locale locale)
      Description copied from interface: ErrorResponse
      Variant of ErrorResponse.getDetailMessageArguments() that uses the given MessageSource for resolving the message argument values.

      This is useful for example to expand message codes from validation errors.

      The default implementation delegates to ErrorResponse.getDetailMessageArguments(), ignoring the supplied MessageSource and Locale.

      Specified by:
      getDetailMessageArguments in interface ErrorResponse
      Parameters:
      source - the MessageSource to use for the lookup
      locale - the Locale to use for the lookup
    • resolveErrorMessages

      @Deprecated(since="6.1", forRemoval=true) public Map<org.springframework.validation.ObjectError,String> resolveErrorMessages(org.springframework.context.MessageSource messageSource, Locale locale)
      Deprecated, for removal: This API element is subject to removal in a future version.
      in favor of using BindErrorUtils and getAllErrors(), to be removed in 6.2
      Resolve global and field errors to messages with the given MessageSource and Locale.
      Returns:
      a Map with errors as key and resolves messages as value
      Since:
      6.0.3
    • getObjectName

      public String getObjectName()
      Specified by:
      getObjectName in interface org.springframework.validation.Errors
    • setNestedPath

      public void setNestedPath(String nestedPath)
      Specified by:
      setNestedPath in interface org.springframework.validation.Errors
    • getNestedPath

      public String getNestedPath()
      Specified by:
      getNestedPath in interface org.springframework.validation.Errors
    • pushNestedPath

      public void pushNestedPath(String subPath)
      Specified by:
      pushNestedPath in interface org.springframework.validation.Errors
    • popNestedPath

      public void popNestedPath() throws IllegalStateException
      Specified by:
      popNestedPath in interface org.springframework.validation.Errors
      Throws:
      IllegalStateException
    • reject

      public void reject(String errorCode)
      Specified by:
      reject in interface org.springframework.validation.Errors
    • reject

      public void reject(String errorCode, String defaultMessage)
      Specified by:
      reject in interface org.springframework.validation.Errors
    • reject

      public void reject(String errorCode, @Nullable Object[] errorArgs, @Nullable String defaultMessage)
      Specified by:
      reject in interface org.springframework.validation.Errors
    • rejectValue

      public void rejectValue(@Nullable String field, String errorCode)
      Specified by:
      rejectValue in interface org.springframework.validation.Errors
    • rejectValue

      public void rejectValue(@Nullable String field, String errorCode, String defaultMessage)
      Specified by:
      rejectValue in interface org.springframework.validation.Errors
    • rejectValue

      public void rejectValue(@Nullable String field, String errorCode, @Nullable Object[] errorArgs, @Nullable String defaultMessage)
      Specified by:
      rejectValue in interface org.springframework.validation.Errors
    • addAllErrors

      public void addAllErrors(org.springframework.validation.Errors errors)
      Specified by:
      addAllErrors in interface org.springframework.validation.Errors
    • hasErrors

      public boolean hasErrors()
      Specified by:
      hasErrors in interface org.springframework.validation.Errors
    • getErrorCount

      public int getErrorCount()
      Specified by:
      getErrorCount in interface org.springframework.validation.Errors
    • getAllErrors

      public List<org.springframework.validation.ObjectError> getAllErrors()
      Specified by:
      getAllErrors in interface org.springframework.validation.Errors
    • hasGlobalErrors

      public boolean hasGlobalErrors()
      Specified by:
      hasGlobalErrors in interface org.springframework.validation.Errors
    • getGlobalErrorCount

      public int getGlobalErrorCount()
      Specified by:
      getGlobalErrorCount in interface org.springframework.validation.Errors
    • getGlobalErrors

      public List<org.springframework.validation.ObjectError> getGlobalErrors()
      Specified by:
      getGlobalErrors in interface org.springframework.validation.Errors
    • getGlobalError

      @Nullable public org.springframework.validation.ObjectError getGlobalError()
      Specified by:
      getGlobalError in interface org.springframework.validation.Errors
    • hasFieldErrors

      public boolean hasFieldErrors()
      Specified by:
      hasFieldErrors in interface org.springframework.validation.Errors
    • getFieldErrorCount

      public int getFieldErrorCount()
      Specified by:
      getFieldErrorCount in interface org.springframework.validation.Errors
    • getFieldErrors

      public List<org.springframework.validation.FieldError> getFieldErrors()
      Specified by:
      getFieldErrors in interface org.springframework.validation.Errors
    • getFieldError

      @Nullable public org.springframework.validation.FieldError getFieldError()
      Specified by:
      getFieldError in interface org.springframework.validation.Errors
    • hasFieldErrors

      public boolean hasFieldErrors(String field)
      Specified by:
      hasFieldErrors in interface org.springframework.validation.Errors
    • getFieldErrorCount

      public int getFieldErrorCount(String field)
      Specified by:
      getFieldErrorCount in interface org.springframework.validation.Errors
    • getFieldErrors

      public List<org.springframework.validation.FieldError> getFieldErrors(String field)
      Specified by:
      getFieldErrors in interface org.springframework.validation.Errors
    • getFieldError

      @Nullable public org.springframework.validation.FieldError getFieldError(String field)
      Specified by:
      getFieldError in interface org.springframework.validation.Errors
    • getFieldValue

      @Nullable public Object getFieldValue(String field)
      Specified by:
      getFieldValue in interface org.springframework.validation.Errors
    • getFieldType

      @Nullable public Class<?> getFieldType(String field)
      Specified by:
      getFieldType in interface org.springframework.validation.Errors
    • getTarget

      @Nullable public Object getTarget()
      Specified by:
      getTarget in interface org.springframework.validation.BindingResult
    • getModel

      public Map<String,Object> getModel()
      Specified by:
      getModel in interface org.springframework.validation.BindingResult
    • getRawFieldValue

      @Nullable public Object getRawFieldValue(String field)
      Specified by:
      getRawFieldValue in interface org.springframework.validation.BindingResult
    • findEditor

      @Nullable public PropertyEditor findEditor(@Nullable String field, @Nullable Class valueType)
      Specified by:
      findEditor in interface org.springframework.validation.BindingResult
    • getPropertyEditorRegistry

      @Nullable public org.springframework.beans.PropertyEditorRegistry getPropertyEditorRegistry()
      Specified by:
      getPropertyEditorRegistry in interface org.springframework.validation.BindingResult
    • resolveMessageCodes

      public String[] resolveMessageCodes(String errorCode)
      Specified by:
      resolveMessageCodes in interface org.springframework.validation.BindingResult
    • resolveMessageCodes

      public String[] resolveMessageCodes(String errorCode, String field)
      Specified by:
      resolveMessageCodes in interface org.springframework.validation.BindingResult
    • addError

      public void addError(org.springframework.validation.ObjectError error)
      Specified by:
      addError in interface org.springframework.validation.BindingResult
    • recordFieldValue

      public void recordFieldValue(String field, Class<?> type, @Nullable Object value)
      Specified by:
      recordFieldValue in interface org.springframework.validation.BindingResult
    • recordSuppressedField

      public void recordSuppressedField(String field)
      Specified by:
      recordSuppressedField in interface org.springframework.validation.BindingResult
    • getSuppressedFields

      public String[] getSuppressedFields()
      Specified by:
      getSuppressedFields in interface org.springframework.validation.BindingResult
    • getMessage

      public String getMessage()
      Returns diagnostic information about the errors held in this object.
      Overrides:
      getMessage in class ResponseStatusException
    • equals

      public boolean equals(@Nullable Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object