javax.validation

## Interface MessageInterpolator

-     public interface MessageInterpolator

  Interpolates 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 and Description
    --- | ---
    `static interface` | `MessageInterpolator.Context` Information related to the interpolation context.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `interpolate(String messageTemplate, MessageInterpolator.Context context)` Interpolates the message template based on the constraint validation context.
    `String` | `interpolate(String messageTemplate, MessageInterpolator.Context context, Locale locale)` Interpolates the message template based on the constraint validation context.

- - ### Method Detail

    - #### interpolate

          String interpolate(String messageTemplate,
                           MessageInterpolator.Context context)

      Interpolates the message template based on the constraint 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

          String interpolate(String messageTemplate,
                           MessageInterpolator.Context context,
                           Locale locale)

      Interpolates the message template based on the constraint 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

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