javax.validation
Interface MessageInterpolator


public interface MessageInterpolator

Interpolate a given constraint error message. Implementations should be as tolerant as possible on syntax errors.

Author:
Emmanuel Bernard, Hardy Ferentschik

Nested Class Summary
static interface MessageInterpolator.Context
          Informations related to the interpolation context
 
Method Summary
 java.lang.String interpolate(java.lang.String messageTemplate, MessageInterpolator.Context context)
          Interpolate the message from the constraint parameters and the actual validated object.
 java.lang.String interpolate(java.lang.String messageTemplate, MessageInterpolator.Context context, java.util.Locale locale)
          Interpolate the message from the constraint parameters and the actual validated object.
 

Method Detail

interpolate

java.lang.String interpolate(java.lang.String messageTemplate,
                             MessageInterpolator.Context context)
Interpolate the message from the constraint parameters and the actual validated object. The locale is defaulted according to the MessageInterpolator implementation. See the implementation documentation for more detail.

Parameters:
messageTemplate - The message to interpolate.
context - 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)
Interpolate the message from the constraint parameters and the actual validated object. The Locale used is provided as a parameter.

Parameters:
messageTemplate - The message to interpolate.
context - contextual information related to the interpolation
locale - the locale targeted for the message
Returns:
Interpolated error message.


Copyright © 2007-2009. All Rights Reserved.