public abstract class AbstractMessageInterpolator extends Object implements MessageInterpolator
MessageInterpolator.Context
Modifier and Type | Field and Description |
---|---|
static String |
CONTRIBUTOR_VALIDATION_MESSAGES
Default name of the message bundle defined by a constraint definition contributor.
|
static String |
USER_VALIDATION_MESSAGES
The name of the user-provided message bundle as defined in the specification.
|
Constructor and Description |
---|
AbstractMessageInterpolator() |
AbstractMessageInterpolator(ResourceBundleLocator userResourceBundleLocator) |
AbstractMessageInterpolator(ResourceBundleLocator userResourceBundleLocator,
ResourceBundleLocator contributorResourceBundleLocator)
MessageInterpolator taking two resource bundle locators. |
AbstractMessageInterpolator(ResourceBundleLocator userResourceBundleLocator,
ResourceBundleLocator contributorResourceBundleLocator,
boolean cacheMessages)
MessageInterpolator taking two resource bundle locators. |
Modifier and Type | Method and Description |
---|---|
abstract String |
interpolate(MessageInterpolator.Context context,
Locale locale,
String term) |
String |
interpolate(String message,
MessageInterpolator.Context context)
Interpolates the message template based on the constraint validation context.
|
String |
interpolate(String message,
MessageInterpolator.Context context,
Locale locale)
Interpolates the message template based on the constraint validation context.
|
public static final String USER_VALIDATION_MESSAGES
public static final String CONTRIBUTOR_VALIDATION_MESSAGES
public AbstractMessageInterpolator()
public AbstractMessageInterpolator(ResourceBundleLocator userResourceBundleLocator)
public AbstractMessageInterpolator(ResourceBundleLocator userResourceBundleLocator, ResourceBundleLocator contributorResourceBundleLocator)
MessageInterpolator
taking two resource bundle locators.userResourceBundleLocator
- ResourceBundleLocator
used to load user provided resource bundlecontributorResourceBundleLocator
- ResourceBundleLocator
used to load resource bundle of constraint contributorpublic AbstractMessageInterpolator(ResourceBundleLocator userResourceBundleLocator, ResourceBundleLocator contributorResourceBundleLocator, boolean cacheMessages)
MessageInterpolator
taking two resource bundle locators.userResourceBundleLocator
- ResourceBundleLocator
used to load user provided resource bundlecontributorResourceBundleLocator
- ResourceBundleLocator
used to load resource bundle of constraint contributorcacheMessages
- Whether resolved messages should be cached or not.public String interpolate(String message, MessageInterpolator.Context context)
MessageInterpolator
The locale is defaulted according to the MessageInterpolator
implementation. See the implementation documentation for more detail.
interpolate
in interface MessageInterpolator
message
- the message to interpolatecontext
- contextual information related to the interpolationpublic String interpolate(String message, MessageInterpolator.Context context, Locale locale)
MessageInterpolator
Locale
used is provided as a parameter.interpolate
in interface MessageInterpolator
message
- the message to interpolatecontext
- contextual information related to the interpolationlocale
- the locale targeted for the messagepublic abstract String interpolate(MessageInterpolator.Context context, Locale locale, String term)
Copyright © 2021 JBoss by Red Hat. All rights reserved.