javax.validation
Interface MessageInterpolator


public interface MessageInterpolator

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

Author:
Emmanuel Bernard, Hardy Ferentschik

Nested Class Summary
static interface MessageInterpolator.Context
          Information related to the interpolation context
 
Method Summary
 java.lang.String interpolate(java.lang.String messageTemplate, MessageInterpolator.Context context)
          Interpolate the message template based on the contraint validation context.
 java.lang.String interpolate(java.lang.String messageTemplate, MessageInterpolator.Context context, java.util.Locale locale)
          Interpolate the message template based on the contraint validation context.
 

Method Detail

interpolate

java.lang.String interpolate(java.lang.String messageTemplate,
                             MessageInterpolator.Context context)
Interpolate the message template based on the contraint validation context. 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 template based on the contraint validation context. 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.


Submit a bug or feature

Copyright © 2009-2011, Oracle Corporation and/or its affiliates. All Rights Reserved. Use is subject to license terms.

Generated on 10-February-2011 12:41