Package org.apache.bval.jsr
Class DefaultMessageInterpolator
- java.lang.Object
-
- org.apache.bval.jsr.DefaultMessageInterpolator
-
- All Implemented Interfaces:
jakarta.validation.MessageInterpolator
public class DefaultMessageInterpolator extends Object implements jakarta.validation.MessageInterpolator
Description: Resource bundle backed message interpolator. This message resolver resolve message descriptors into human-readable messages. It uses ResourceBundles to find the messages. This class is threadsafe.
-
-
Constructor Summary
Constructors Constructor Description DefaultMessageInterpolator()
Create a new DefaultMessageInterpolator instance.DefaultMessageInterpolator(ResourceBundle resourceBundle)
Create a new DefaultMessageInterpolator instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearCache()
String
interpolate(String message, jakarta.validation.MessageInterpolator.Context context)
String
interpolate(String message, jakarta.validation.MessageInterpolator.Context context, Locale locale)
void
setLocale(Locale locale)
Set the default locale used by thisDefaultMessageInterpolator
.
-
-
-
Constructor Detail
-
DefaultMessageInterpolator
public DefaultMessageInterpolator()
Create a new DefaultMessageInterpolator instance.
-
DefaultMessageInterpolator
public DefaultMessageInterpolator(ResourceBundle resourceBundle)
Create a new DefaultMessageInterpolator instance.- Parameters:
resourceBundle
-
-
-
Method Detail
-
interpolate
public String interpolate(String message, jakarta.validation.MessageInterpolator.Context context)
- Specified by:
interpolate
in interfacejakarta.validation.MessageInterpolator
-
interpolate
public String interpolate(String message, jakarta.validation.MessageInterpolator.Context context, Locale locale)
- Specified by:
interpolate
in interfacejakarta.validation.MessageInterpolator
-
clearCache
public void clearCache()
-
setLocale
public void setLocale(Locale locale)
Set the default locale used by thisDefaultMessageInterpolator
.- Parameters:
locale
-
-
-