|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
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(java.lang.String field,
java.lang.String message)
Add a field-specific error message. |
void |
addError(java.lang.String prefix,
java.lang.String field,
java.lang.String message)
Adds a new form validation error with a given prefix. |
void |
addErrorCollection(ErrorCollection errors)
Populate this ErrorCollection with general and field-specific errors. |
void |
addErrorMessage(java.lang.String message)
Add error message relating to system state (not field-specific). |
java.lang.String |
addErrorMessage(java.lang.String message,
java.lang.Exception e)
|
void |
addErrorMessages(java.util.Collection<java.lang.String> errorMessages)
Append new error messages to those already collected. |
void |
addErrors(java.util.Map<java.lang.String,?> errors)
Append new field-specific errors to those already collected. |
java.util.Collection<java.lang.String> |
getErrorMessages()
Get all non field-specific error messages. |
java.util.Map<java.lang.String,java.lang.String> |
getErrors()
Get all field-specific errors. |
java.util.Map<java.lang.String,java.lang.String> |
getFieldErrors()
|
java.util.Collection<java.lang.String> |
getFlushedErrorMessages()
Get error messages, then get rid of them. |
int |
getTotalErrors()
|
boolean |
hasAnyErrors()
Whether any errors (of any type - field-specific or otherwise) have been collected. |
void |
setErrorMessages(java.util.Collection<java.lang.String> errorMessages)
Populate this ErrorCollection with a new set of messages (existing errors are lost). |
Method Detail |
---|
void addError(java.lang.String field, java.lang.String message)
field
- Field name, eg. "assignee"message
- Error message.void addError(java.lang.String prefix, java.lang.String field, java.lang.String message)
prefix
- The prefix of the field in . formfield
- The id of the form element in errormessage
- The error message to display to the uservoid addErrorMessage(java.lang.String message)
message
- Error message.java.lang.String addErrorMessage(java.lang.String message, java.lang.Exception e)
java.util.Collection<java.lang.String> getErrorMessages()
void setErrorMessages(java.util.Collection<java.lang.String> errorMessages)
errorMessages
- List of error message String
s.java.util.Collection<java.lang.String> getFlushedErrorMessages()
java.util.Map<java.lang.String,java.lang.String> getErrors()
void addErrorCollection(@NotNull ErrorCollection errors)
errors
- ErrorCollection whose errors/messages we obtain.void addErrorMessages(java.util.Collection<java.lang.String> errorMessages)
errorMessages
- Collection of error strings.void addErrors(java.util.Map<java.lang.String,?> errors)
errors
- A Map
from String
field names, to String
error messages, or Collection
s of
String
error messages.boolean hasAnyErrors()
true
if there are errors; false
otherwise.java.util.Map<java.lang.String,java.lang.String> getFieldErrors()
int getTotalErrors()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |