|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wicket.validation.ValidationError
public class ValidationError
A versatile implementation of IValidationError that supports message resolution from
IErrorMessageSource, default message (if none of the keys matched), and variable
substitution.
The final error message is constructed via the following process:
addMessageKey(String) via the provided
IErrorMessageSource.setMessage(String), if
any.
| Constructor Summary | |
|---|---|
ValidationError()
Constructor. |
|
| Method Summary | |
|---|---|
ValidationError |
addMessageKey(String key)
Adds a key to the list of keys that will be tried against IErrorMessageSource to
locate the error message string. |
String |
getErrorMessage(IErrorMessageSource messageSource)
Retrieves the error message (usually user-facing). |
List<String> |
getKeys()
Gets error keys. |
String |
getMessage()
Gets the default message that will be used when no message could be located via message keys. |
Map<String,Object> |
getVariables()
Retrieves the variables map for this error. |
ValidationError |
setMessage(String message)
Sets message that will be used when no message could be located via message keys. |
ValidationError |
setVariable(String name,
Object value)
Sets a key and value in the variables map for use in substitution. |
ValidationError |
setVariables(Map<String,Object> vars)
Sets the variables map for this error. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ValidationError()
| Method Detail |
|---|
public ValidationError addMessageKey(String key)
IErrorMessageSource to
locate the error message string.
key - a message key to be added
ValidationError for chaining purposes
public ValidationError setVariable(String name,
Object value)
name - a variable namevalue - a variable value
ValidationError for chaining purposespublic final Map<String,Object> getVariables()
Map of variables for this errorpublic final ValidationError setVariables(Map<String,Object> vars)
vars - a variables map
ValidationError for chaining purposespublic final String getErrorMessage(IErrorMessageSource messageSource)
IValidationError
getErrorMessage in interface IValidationErrormessageSource - the message source
StringIValidationError.getErrorMessage(IErrorMessageSource)public final String getMessage()
public final ValidationError setMessage(String message)
message - a default message to be used when all keys yield no message
ValidationError for chaining purposespublic List<String> getKeys()
public String toString()
toString in class ObjectObject.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||