Spring Framework

org.springframework.validation.beanvalidation
Class LocaleContextMessageInterpolator

java.lang.Object
  extended by org.springframework.validation.beanvalidation.LocaleContextMessageInterpolator
All Implemented Interfaces:
javax.validation.MessageInterpolator

public class LocaleContextMessageInterpolator
extends java.lang.Object
implements javax.validation.MessageInterpolator

Delegates to a target MessageInterpolator implementation but enforces Spring's managed Locale. Typically used to wrap the validation provider's default interpolator.

Since:
3.0
Author:
Juergen Hoeller
See Also:
LocaleContextHolder.getLocale()

Nested Class Summary
 
Nested classes/interfaces inherited from interface javax.validation.MessageInterpolator
javax.validation.MessageInterpolator.Context
 
Constructor Summary
LocaleContextMessageInterpolator(javax.validation.MessageInterpolator targetInterpolator)
          Create a new LocaleContextMessageInterpolator, wrapping the given target interpolator.
 
Method Summary
 java.lang.String interpolate(java.lang.String message, javax.validation.MessageInterpolator.Context context)
           
 java.lang.String interpolate(java.lang.String message, javax.validation.MessageInterpolator.Context context, java.util.Locale locale)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocaleContextMessageInterpolator

public LocaleContextMessageInterpolator(javax.validation.MessageInterpolator targetInterpolator)
Create a new LocaleContextMessageInterpolator, wrapping the given target interpolator.

Parameters:
targetInterpolator - the target MessageInterpolator to wrap
Method Detail

interpolate

public java.lang.String interpolate(java.lang.String message,
                                    javax.validation.MessageInterpolator.Context context)
Specified by:
interpolate in interface javax.validation.MessageInterpolator

interpolate

public java.lang.String interpolate(java.lang.String message,
                                    javax.validation.MessageInterpolator.Context context,
                                    java.util.Locale locale)
Specified by:
interpolate in interface javax.validation.MessageInterpolator

Spring Framework