Class MessageContextErrors

java.lang.Object
org.springframework.validation.AbstractErrors
org.springframework.binding.message.MessageContextErrors
All Implemented Interfaces:
Serializable, org.springframework.validation.Errors

public class MessageContextErrors extends org.springframework.validation.AbstractErrors
Adapts a MessageContext object to the Spring Errors interface. Allows Spring Validators to record errors that are managed by a backing MessageContext.
Author:
Keith Donald
See Also:
  • Field Summary

    Fields inherited from interface org.springframework.validation.Errors

    NESTED_PATH_SEPARATOR
  • Constructor Summary

    Constructors
    Constructor
    Description
    MessageContextErrors(MessageContext messageContext, String objectName, Object boundObject, ExpressionParser expressionParser, org.springframework.validation.MessageCodesResolver bindingErrorMessageCodesResolver, MappingResults mappingResults)
    Creates a new message context errors adapter.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addAllErrors(org.springframework.validation.Errors errors)
     
    List<org.springframework.validation.FieldError>
     
     
    List<org.springframework.validation.ObjectError>
     
     
    void
    reject(String errorCode, Object[] errorArgs, String defaultMessage)
     
    void
    rejectValue(String field, String errorCode, Object[] errorArgs, String defaultMessage)
     

    Methods inherited from class org.springframework.validation.AbstractErrors

    canonicalFieldName, doSetNestedPath, fixedField, getAllErrors, getErrorCount, getFieldError, getFieldError, getFieldErrorCount, getFieldErrorCount, getFieldErrors, getFieldType, getGlobalError, getGlobalErrorCount, getNestedPath, hasErrors, hasFieldErrors, hasFieldErrors, hasGlobalErrors, isMatchingFieldError, popNestedPath, pushNestedPath, reject, reject, rejectValue, rejectValue, setNestedPath, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MessageContextErrors

      public MessageContextErrors(MessageContext messageContext, String objectName, Object boundObject, ExpressionParser expressionParser, org.springframework.validation.MessageCodesResolver bindingErrorMessageCodesResolver, MappingResults mappingResults)
      Creates a new message context errors adapter.
      Parameters:
      messageContext - the backing message context
      objectName - the object name
      boundObject - the model object
      expressionParser - the expression parser
      bindingErrorMessageCodesResolver - the message codes resolver
      mappingResults - object mapping results
  • Method Details

    • reject

      public void reject(String errorCode, Object[] errorArgs, String defaultMessage)
    • rejectValue

      public void rejectValue(String field, String errorCode, Object[] errorArgs, String defaultMessage)
    • addAllErrors

      public void addAllErrors(org.springframework.validation.Errors errors)
    • getObjectName

      public String getObjectName()
    • getGlobalErrors

      public List<org.springframework.validation.ObjectError> getGlobalErrors()
    • getFieldErrors

      public List<org.springframework.validation.FieldError> getFieldErrors()
    • getFieldValue

      public Object getFieldValue(String field)