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 |
DEFAULT_VALIDATION_MESSAGES
The name of the default message bundle.
|
static String |
USER_VALIDATION_MESSAGES
The name of the user-provided message bundle as defined in the specification.
|
Constructor and Description |
---|
AbstractMessageInterpolator()
MessageInterpolator using the default resource bundle locators. |
AbstractMessageInterpolator(ResourceBundleLocator userResourceBundleLocator)
MessageInterpolator taking a resource bundle locator. |
AbstractMessageInterpolator(ResourceBundleLocator userResourceBundleLocator,
ResourceBundleLocator contributorResourceBundleLocator)
MessageInterpolator taking two resource bundle locators. |
AbstractMessageInterpolator(ResourceBundleLocator userResourceBundleLocator,
ResourceBundleLocator contributorResourceBundleLocator,
boolean cacheMessages)
MessageInterpolator taking two resource bundle locators. |
AbstractMessageInterpolator(ResourceBundleLocator userResourceBundleLocator,
ResourceBundleLocator contributorResourceBundleLocator,
Set<Locale> localesToInitialize,
Locale defaultLocale,
LocaleResolver localeResolver,
boolean preloadResourceBundles)
MessageInterpolator taking two resource bundle locators. |
AbstractMessageInterpolator(ResourceBundleLocator userResourceBundleLocator,
ResourceBundleLocator contributorResourceBundleLocator,
Set<Locale> locales,
Locale defaultLocale,
LocaleResolver localeResolver,
boolean preloadResourceBundles,
boolean cacheMessages)
MessageInterpolator taking two resource bundle locators. |
AbstractMessageInterpolator(ResourceBundleLocator userResourceBundleLocator,
Set<Locale> locales,
Locale defaultLocale,
LocaleResolver localeResolver,
boolean preloadResourceBundles)
MessageInterpolator taking a resource bundle locator. |
AbstractMessageInterpolator(Set<Locale> locales,
Locale defaultLocale,
LocaleResolver localeResolver,
boolean preloadResourceBundles)
MessageInterpolator using the default resource bundle locators. |
Modifier and Type | Method and Description |
---|---|
protected abstract String |
interpolate(MessageInterpolator.Context context,
Locale locale,
String term) |
String |
interpolate(String message,
MessageInterpolator.Context context) |
String |
interpolate(String message,
MessageInterpolator.Context context,
Locale locale) |
public static final String DEFAULT_VALIDATION_MESSAGES
public static final String USER_VALIDATION_MESSAGES
public static final String CONTRIBUTOR_VALIDATION_MESSAGES
public AbstractMessageInterpolator()
MessageInterpolator
using the default resource bundle locators.public AbstractMessageInterpolator(ResourceBundleLocator userResourceBundleLocator)
MessageInterpolator
taking a resource bundle locator.userResourceBundleLocator
- ResourceBundleLocator
used to load user provided resource bundlepublic 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.@Incubating public AbstractMessageInterpolator(Set<Locale> locales, Locale defaultLocale, LocaleResolver localeResolver, boolean preloadResourceBundles)
MessageInterpolator
using the default resource bundle locators.locales
- the set of locales to initialize at bootstrapdefaultLocale
- the default localelocaleResolver
- the locale resolverpreloadResourceBundles
- if the resource bundled should be initialized at initialization time, this is useful in the case of a
PredefinedScopeValidatorFactoryImpl
@Incubating public AbstractMessageInterpolator(ResourceBundleLocator userResourceBundleLocator, Set<Locale> locales, Locale defaultLocale, LocaleResolver localeResolver, boolean preloadResourceBundles)
MessageInterpolator
taking a resource bundle locator.userResourceBundleLocator
- ResourceBundleLocator
used to load user provided resource bundlelocales
- the set of locales to initialize at bootstrapdefaultLocale
- the default localelocaleResolver
- the locale resolverpreloadResourceBundles
- if the resource bundled should be initialized at initialization time, this is useful in the case of a
PredefinedScopeValidatorFactoryImpl
@Incubating public AbstractMessageInterpolator(ResourceBundleLocator userResourceBundleLocator, ResourceBundleLocator contributorResourceBundleLocator, Set<Locale> localesToInitialize, Locale defaultLocale, LocaleResolver localeResolver, boolean preloadResourceBundles)
MessageInterpolator
taking two resource bundle locators.userResourceBundleLocator
- ResourceBundleLocator
used to load user provided resource bundlecontributorResourceBundleLocator
- ResourceBundleLocator
used to load resource bundle of constraint contributorlocalesToInitialize
- the set of locales to initialize at bootstrapdefaultLocale
- the default localelocaleResolver
- the locale resolverpreloadResourceBundles
- if the resource bundled should be initialized at initialization time, this is useful in the case of a
PredefinedScopeValidatorFactoryImpl
@Incubating public AbstractMessageInterpolator(ResourceBundleLocator userResourceBundleLocator, ResourceBundleLocator contributorResourceBundleLocator, Set<Locale> locales, Locale defaultLocale, LocaleResolver localeResolver, boolean preloadResourceBundles, 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
contributorlocales
- the set of locales to initialize at bootstrapdefaultLocale
- the default localecacheMessages
- whether resolved messages should be cached or notlocaleResolver
- the locale resolverpreloadResourceBundles
- if the resource bundled should be initialized at initialization time, this is useful in the case of a
PredefinedScopeValidatorFactoryImpl
public String interpolate(String message, MessageInterpolator.Context context)
interpolate
in interface MessageInterpolator
public String interpolate(String message, MessageInterpolator.Context context, Locale locale)
interpolate
in interface MessageInterpolator
protected abstract String interpolate(MessageInterpolator.Context context, Locale locale, String term)
Copyright © 2007-2021 Red Hat, Inc. All Rights Reserved