|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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(java.lang.String key)
Adds a key to the list of keys that will be tried against IErrorMessageSource
to locate the error message string. |
java.lang.String |
getErrorMessage(IErrorMessageSource messageSource)
Retrieves the error message (usually user-facing). |
java.lang.String |
getMessage()
Gets the default message that will be used when no message could be located via message keys. |
java.util.Map |
getVariables()
Retrieves the variables map for this error. |
ValidationError |
setMessage(java.lang.String message)
Sets message that will be used when no message could be located via message keys. |
ValidationError |
setVariable(java.lang.String name,
java.lang.Object value)
Sets a key and value in the variables map for use in substitution. |
ValidationError |
setVariables(java.util.Map vars)
Sets the variables map for this error. |
java.lang.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(java.lang.String key)
IErrorMessageSource
to locate the error message string.
key
- a message key to be added
ValidationError
for chaining purposespublic ValidationError setVariable(java.lang.String name, java.lang.Object value)
name
- a variable namevalue
- a variable value
ValidationError
for chaining purposespublic final java.util.Map getVariables()
Map
of variables for this errorpublic final ValidationError setVariables(java.util.Map vars)
vars
- a variables map
ValidationError
for chaining purposespublic final java.lang.String getErrorMessage(IErrorMessageSource messageSource)
IValidationError
getErrorMessage
in interface IValidationError
messageSource
- the message source
String
IValidationError.getErrorMessage(IErrorMessageSource)
public final java.lang.String getMessage()
public final ValidationError setMessage(java.lang.String message)
message
- a default message to be used when all keys yield no message
ValidationError
for chaining purposespublic java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |