This message interpolator is different from the default one in the following ways:
| Modifier and Type | Class and Description |
|---|---|
| private static class | MessageInterpolatorImpl.
A resource bundle that takes strings from the annotation context. |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final boolean | cacheMessages
Flag indicating whether this interpolator should chance some of the interpolation steps. |
| public static final String | DEFAULT_VALIDATION_MESSAGES
The name of the default message bundle. |
| private final Locale | defaultLocale
The default locale for the current user. |
| private static final Pattern | MESSAGE_PARAMETER_PATTERN
Regular expression used to do message interpolation. |
| private final Map | resolvedMessages
Step 1-3 of message interpolation can be cached. |
| public static final String | USER_VALIDATION_MESSAGES
The name of the user-provided message bundle as defined in the specification. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private String | escapeMetaCharacters(String
The string in which to replace the meta characters '$' and '\'. s)Returns: A string where meta characters relevant for |
| private boolean | |
| public String | interpolate(String message, MessageInterpolator.
Implements jakarta. Interpolates the message template based on the constraint validation context. |
| public String | Returns: the interpolated message.the message to interpolate message, MessageInterpolator.the context of the annotation which holds the parameters
for which to interpolate this message context,the locale)Locale to use for the resource bundle.Implements jakarta. Runs the message interpolation according to algorithm specified in JSR 303. |
| private String | |
| private String | |
| private String | |
| private String |
| cacheMessages | back to summary |
|---|---|
| private final boolean cacheMessages Flag indicating whether this interpolator should chance some of the interpolation steps. | |
| DEFAULT_VALIDATION_MESSAGES | back to summary |
|---|---|
| public static final String DEFAULT_VALIDATION_MESSAGES The name of the default message bundle. | |
| defaultLocale | back to summary |
|---|---|
| private final Locale defaultLocale The default locale for the current user. | |
| MESSAGE_PARAMETER_PATTERN | back to summary |
|---|---|
| private static final Pattern MESSAGE_PARAMETER_PATTERN Regular expression used to do message interpolation. | |
| resolvedMessages | back to summary |
|---|---|
| private final Map<MessageInterpolatorImpl. Step 1-3 of message interpolation can be cached. We do this in this map. | |
| USER_VALIDATION_MESSAGES | back to summary |
|---|---|
| public static final String USER_VALIDATION_MESSAGES The name of the user-provided message bundle as defined in the specification. | |
| MessageInterpolatorImpl | back to summary |
|---|---|
| public MessageInterpolatorImpl() | |
| escapeMetaCharacters | back to summary |
|---|---|
private String escapeMetaCharacters(String s)
| |
| hasReplacementTakenPlace | back to summary |
|---|---|
| private boolean hasReplacementTakenPlace(String origMessage, String newMessage) | |
| interpolate | back to summary |
|---|---|
| public String interpolate(String message, MessageInterpolator. Implements jakarta. Doc from jakarta. Interpolates the message template based on the constraint validation context.
The locale is defaulted according to the
| |
| interpolate | back to summary |
|---|---|
| public String interpolate(String message, MessageInterpolator. Implements jakarta. Runs the message interpolation according to algorithm specified in JSR 303.
| |
| removeCurlyBrace | back to summary |
|---|---|
| private String removeCurlyBrace(String parameter) | |
| replaceAnnotationAttributes | back to summary |
|---|---|
| private String replaceAnnotationAttributes(String message, Map<String, Object> annotationParameters) | |
| replaceVariables | back to summary |
|---|---|
| private String replaceVariables(String message, ResourceBundle bundle, Locale locale, boolean recurse) | |
| resolveParameter | back to summary |
|---|---|
| private String resolveParameter(String parameterName, ResourceBundle bundle, Locale locale, boolean recurse) | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv ResourceBundle | |
| pack-priv ResourceBundle |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public Enumeration | |
| protected Object | handleGetObject(String key)
Implements abstract java. Gets an object for the given key from this resource bundle. |
| contextBundle | back to summary |
|---|---|
| pack-priv ResourceBundle contextBundle | |
| userBundle | back to summary |
|---|---|
| pack-priv ResourceBundle userBundle | |
| ContextResourceBundle | back to summary |
|---|---|
| pack-priv ContextResourceBundle(MessageInterpolator. | |
| getKeys | back to summary |
|---|---|
| public Enumeration Implements abstract java. Doc from java. Returns an enumeration of the keys.
| |
| handleGetObject | back to summary |
|---|---|
| protected Object handleGetObject(String key) Implements abstract java. Doc from java. Gets an object for the given key from this resource bundle. Returns null if this resource bundle does not contain an object for the given key.
| |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object o)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public int |
| locale | back to summary |
|---|---|
| private final Locale locale | |
| message | back to summary |
|---|---|
| private final String message | |
| LocalisedMessage | back to summary |
|---|---|
| pack-priv LocalisedMessage(String message, Locale locale) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |