|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ErrorCollection
A very simple interface to collect errors. This is typically used during form validation for collecting field
validation errors (use addError(String, String)
), and general errors
(addErrorMessage(String)
) that aren't field-specific (eg. permission problems).
Method Summary | |
---|---|
void |
addError(String field,
String message)
Add a field-specific error message. |
void |
addErrorCollection(ErrorCollection errors)
Populate this ErrorCollection with general and field-specific errors. |
void |
addErrorMessage(String message)
Add error message relating to system state (not field-specific). |
void |
addErrorMessages(Collection<String> errorMessages)
Append new error messages to those already collected. |
void |
addErrors(Map<String,String> errors)
Append new field-specific errors to those already collected. |
Collection<String> |
getErrorMessages()
Get all non field-specific error messages. |
Map<String,String> |
getErrors()
Get all field-specific errors. |
Collection<String> |
getFlushedErrorMessages()
Get error messages, then get rid of them. |
boolean |
hasAnyErrors()
Whether any errors (of any type - field-specific or otherwise) have been collected. |
void |
setErrorMessages(Collection<String> errorMessages)
Populate this ErrorCollection with a new set of messages (existing errors are lost). |
Method Detail |
---|
void addError(String field, String message)
field
- Field name, eg. "assignee"message
- Error message.void addErrorMessage(String message)
message
- Error message.Collection<String> getErrorMessages()
void setErrorMessages(Collection<String> errorMessages)
errorMessages
- List of error message String
s.Collection<String> getFlushedErrorMessages()
Map<String,String> getErrors()
void addErrorCollection(ErrorCollection errors)
errors
- ErrorCollection whose errors/messages we obtain.void addErrorMessages(Collection<String> errorMessages)
errorMessages
- Collection of error strings.void addErrors(Map<String,String> errors)
errors
- of String: String pairs, eg. {"assignee": "Assignee is required"}boolean hasAnyErrors()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |