Package org.springframework.web.util
Class BindErrorUtils
java.lang.Object
org.springframework.web.util.BindErrorUtils
Utility methods to resolve a list of 
MessageSourceResolvables, and
 optionally join them.- Since:
- 6.1
- Author:
- Rossen Stoyanchev
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic <E extends MessageSourceResolvable>
 Map<E,String> Shortcut forresolve(List, MessageSource, Locale)with an emptyMessageSourcethat simply formats the default message, or first error code, also prepending the field name for field errors.static <E extends MessageSourceResolvable>
 Map<E,String> resolve(List<E> errors, MessageSource messageSource, Locale locale) Resolve all errors through the givenMessageSource.static StringresolveAndJoin(CharSequence delimiter, CharSequence prefix, CharSequence suffix, List<? extends MessageSourceResolvable> errors, MessageSource messageSource, Locale locale) Resolve all errors through the givenMessageSourceand join them.static StringresolveAndJoin(List<? extends MessageSourceResolvable> errors) Shortcut forresolveAndJoin(List, MessageSource, Locale)with an emptyMessageSourcethat simply formats the default message, or first error code, also prepending the field name for field errors.static StringresolveAndJoin(List<? extends MessageSourceResolvable> errors, MessageSource messageSource, Locale locale) Shortcut forresolveAndJoin(CharSequence, CharSequence, CharSequence, List, MessageSource, Locale)with", and "as delimiter, and an empty prefix and suffix.
- 
Constructor Details- 
BindErrorUtilspublic BindErrorUtils()
 
- 
- 
Method Details- 
resolveAndJoinShortcut forresolveAndJoin(List, MessageSource, Locale)with an emptyMessageSourcethat simply formats the default message, or first error code, also prepending the field name for field errors.
- 
resolveAndJoinpublic static String resolveAndJoin(List<? extends MessageSourceResolvable> errors, MessageSource messageSource, Locale locale) Shortcut forresolveAndJoin(CharSequence, CharSequence, CharSequence, List, MessageSource, Locale)with", and "as delimiter, and an empty prefix and suffix.
- 
resolveAndJoinpublic static String resolveAndJoin(CharSequence delimiter, CharSequence prefix, CharSequence suffix, List<? extends MessageSourceResolvable> errors, MessageSource messageSource, Locale locale) Resolve all errors through the givenMessageSourceand join them.- Parameters:
- delimiter- the delimiter to use between each error
- prefix- characters to insert at the beginning
- suffix- characters to insert at the end
- errors- the errors to resolve and join
- messageSource- the- MessageSourceto resolve with
- locale- the locale to resolve with
- Returns:
- the resolved errors formatted as a string
 
- 
resolveShortcut forresolve(List, MessageSource, Locale)with an emptyMessageSourcethat simply formats the default message, or first error code, also prepending the field name for field errors.
- 
resolvepublic static <E extends MessageSourceResolvable> Map<E,String> resolve(List<E> errors, MessageSource messageSource, Locale locale) Resolve all errors through the givenMessageSource.- Parameters:
- errors- the errors to resolve
- messageSource- the- MessageSourceto resolve with
- locale- the locale to resolve with an empty- MessageSource
- Returns:
- map with resolved errors as values, in the order of the input list
 
 
-