|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.javalid.core.ValidationMessage
public class ValidationMessage
This class defines a general ValidationMessage that is used by the validator to store a validation error into.
| Constructor Summary | |
|---|---|
ValidationMessage(java.lang.String path,
java.lang.String message,
java.lang.Object[] values,
boolean globalMessage)
Constructs a validation message. |
|
| Method Summary | |
|---|---|
java.lang.String |
getMessage()
Returns the message code, you can override error codes in your own property file. |
java.lang.String |
getPath()
Returns the error path |
java.lang.Object[] |
getValues()
Returns the values associated to this message (if any), see the validation annotations to find out what is stored in here exactly. |
boolean |
isGlobalMessage()
Returns true if this message should be a global message (note that this property is originally taken from annotation's globalMessage), there it can be used to say that an error when validating for that annotation must be shown as a global message instead of using the validation path. |
void |
setGlobalMessage(boolean globalMessage)
Set to true if this message represents a global message (validation path is ignored) |
void |
setMessage(java.lang.String message)
Set the message code for this message |
void |
setPath(java.lang.String path)
Set the validation path for this message |
void |
setValues(java.lang.Object[] values)
The value parameters for this message |
java.lang.String |
toString()
Returns string representation of content of this message |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ValidationMessage(java.lang.String path,
java.lang.String message,
java.lang.Object[] values,
boolean globalMessage)
path - The full error path to the method where something went wrong, e.g. A { public String getExample() { .. } }
if with error, would result in: examplemessage - The message code (e.g. jv_error_XXXX)values - Values if relevant for the specific validation / message code), see the specific annotations
to find out what is stored in the values instance.| Method Detail |
|---|
public java.lang.String getPath()
public java.lang.String getMessage()
public java.lang.Object[] getValues()
public boolean isGlobalMessage()
public java.lang.String toString()
toString in class java.lang.Objectpublic void setPath(java.lang.String path)
path - The path for this messagepublic void setMessage(java.lang.String message)
message - The new message code (from properties file)public void setValues(java.lang.Object[] values)
values - The parameterspublic void setGlobalMessage(boolean globalMessage)
globalMessage - If this message is a global message or not
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||