|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springmodules.validation.commons.MessageUtils
public abstract class MessageUtils
| Constructor Summary | |
|---|---|
MessageUtils()
|
|
| Method Summary | |
|---|---|
static MessageSourceResolvable |
createMessage(java.lang.Object obj)
Create a MessageSourceResolvable using the string value of the parameter as a code. |
static java.lang.Object[] |
getArgs(ValidatorAction va,
Field field)
Gets the message arguments based on the current ValidatorAction and Field. |
static java.lang.Object |
getMessage(Arg arg)
Get the message associated with the argument. |
static java.lang.String |
getMessage(MessageSource messages,
java.util.Locale locale,
ValidatorAction va,
Field field)
Get a message for the given validator action and field from the specified message source. |
static java.lang.String |
getMessageKey(ValidatorAction va,
Field field)
Gets the ActionError based on the ValidatorAction message and the Field's
arg objects. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MessageUtils()
| Method Detail |
|---|
public static java.lang.String getMessageKey(ValidatorAction va,
Field field)
ActionError based on the ValidatorAction message and the Field's
arg objects.
public static java.lang.Object[] getArgs(ValidatorAction va,
Field field)
ValidatorAction and Field. The array
returned here is an array of MessageSourceResolvable's that will be
resolved at a later time.
Note: this implementation is especially crappy (only four arguments are
supported), but it's the best we can do until the next version of
validator-validator is out of beta.
-param actionName
action name.
field - the validator field.
public static java.lang.Object getMessage(Arg arg)
public static MessageSourceResolvable createMessage(java.lang.Object obj)
obj - Object whose string value is the code for this message.
public static java.lang.String getMessage(MessageSource messages,
java.util.Locale locale,
ValidatorAction va,
Field field)
messages - MessageSource from which to get the message.locale - Locale for for this message.va - ValidatorAction for this message.field - Field field for this message.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||