|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.bamboo.utils.error.SimpleErrorCollection
public class SimpleErrorCollection
Constructor Summary | |
---|---|
SimpleErrorCollection()
|
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> incomingMessages)
Append new error messages to those already collected. |
void |
addErrors(java.util.Map<java.lang.String,?> incomingErrors)
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). |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SimpleErrorCollection()
Method Detail |
---|
public void addError(java.lang.String field, java.lang.String message)
ErrorCollection
addError
in interface ErrorCollection
field
- Field name, eg. "assignee"message
- Error message.public void addErrorMessage(java.lang.String message)
ErrorCollection
addErrorMessage
in interface ErrorCollection
message
- Error message.public java.util.Collection<java.lang.String> getErrorMessages()
ErrorCollection
getErrorMessages
in interface ErrorCollection
public void setErrorMessages(java.util.Collection<java.lang.String> errorMessages)
ErrorCollection
setErrorMessages
in interface ErrorCollection
errorMessages
- List of error message String
s.public java.util.Collection<java.lang.String> getFlushedErrorMessages()
ErrorCollection
getFlushedErrorMessages
in interface ErrorCollection
public java.util.Map<java.lang.String,java.lang.String> getErrors()
ErrorCollection
getErrors
in interface ErrorCollection
public void addErrorCollection(@NotNull ErrorCollection errors)
ErrorCollection
addErrorCollection
in interface ErrorCollection
errors
- ErrorCollection whose errors/messages we obtain.public void addErrorMessages(java.util.Collection<java.lang.String> incomingMessages)
ErrorCollection
addErrorMessages
in interface ErrorCollection
incomingMessages
- Collection of error strings.public java.lang.String addErrorMessage(java.lang.String message, java.lang.Exception e)
addErrorMessage
in interface ErrorCollection
public void addErrors(java.util.Map<java.lang.String,?> incomingErrors)
ErrorCollection
addErrors
in interface ErrorCollection
incomingErrors
- A Map
from String
field names, to String
error messages, or Collection
s of
String
error messages.public boolean hasAnyErrors()
ErrorCollection
hasAnyErrors
in interface ErrorCollection
true
if there are errors; false
otherwise.public java.util.Map<java.lang.String,java.lang.String> getFieldErrors()
getFieldErrors
in interface ErrorCollection
public int getTotalErrors()
getTotalErrors
in interface ErrorCollection
public java.lang.String toString()
toString
in class java.lang.Object
public void addError(java.lang.String prefix, java.lang.String field, java.lang.String message)
ErrorCollection
addError
in interface ErrorCollection
prefix
- The prefix of the field in . formfield
- The id of the form element in errormessage
- The error message to display to the user
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |