Package jakarta.validation
Interface MessageInterpolator
-
public interface MessageInterpolatorInterpolates a given constraint violation message.Implementations should be as tolerant as possible on syntax errors. Implementations must be thread-safe.
- Author:
- Emmanuel Bernard, Hardy Ferentschik
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceMessageInterpolator.ContextInformation related to the interpolation context.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Stringinterpolate(java.lang.String messageTemplate, MessageInterpolator.Context context)Interpolates the message template based on the constraint validation context.java.lang.Stringinterpolate(java.lang.String messageTemplate, MessageInterpolator.Context context, java.util.Locale locale)Interpolates the message template based on the constraint validation context.
-
-
-
Method Detail
-
interpolate
java.lang.String interpolate(java.lang.String messageTemplate, MessageInterpolator.Context context)Interpolates the message template based on the constraint validation context.The locale is defaulted according to the
MessageInterpolatorimplementation. See the implementation documentation for more detail.- Parameters:
messageTemplate- the message to interpolatecontext- contextual information related to the interpolation- Returns:
- interpolated error message
-
interpolate
java.lang.String interpolate(java.lang.String messageTemplate, MessageInterpolator.Context context, java.util.Locale locale)Interpolates the message template based on the constraint validation context. TheLocaleused is provided as a parameter.- Parameters:
messageTemplate- the message to interpolatecontext- contextual information related to the interpolationlocale- the locale targeted for the message- Returns:
- interpolated error message
-
-