public class MockAction extends webwork.action.ActionSupport implements ErrorCollection
ErrorCollection.Reason
Constructor and Description |
---|
MockAction() |
Modifier and Type | Method and Description |
---|---|
void |
addError(String field,
String message,
ErrorCollection.Reason reason)
Add a field-specific error message.
|
void |
addErrorCollection(ErrorCollection errors)
Populate this ErrorCollection with general and field-specific errors.
|
void |
addErrorMessage(String message,
ErrorCollection.Reason reason)
Add error message relating to system state (not field-specific), and a reason.
|
void |
addErrorMessages(Collection errorMessages)
Append new error messages to those already collected.
|
void |
addErrors(Map errors)
Append new field-specific errors to those already collected.
|
void |
addReason(ErrorCollection.Reason reason)
Add a reason why the function has not been performed.
|
void |
addReasons(Set<ErrorCollection.Reason> reasons)
Add reasons why the function has not been performed.
|
Collection<String> |
getFlushedErrorMessages()
Get error messages, then get rid of them.
|
String |
getFoo() |
Set<ErrorCollection.Reason> |
getReasons()
A set of well known reasons why the function has not been performed.
|
boolean |
hasAnyErrors()
Whether any errors (of any type - field-specific or otherwise) have been collected.
|
void |
setFoo(String foo) |
void |
setReasons(Set<ErrorCollection.Reason> reasons)
Set reasons why the function has not been performed.
|
addError, addErrorMessage, addIllegalArgumentException, doDefault, doExecute, doValidation, execute, getActionName, getCommandName, getErrorMessages, getErrors, getHasErrorMessages, getHasErrors, getLocale, getPropertyEditorMessage, getText, getTexts, getTexts, getTimezone, invalidInput, invokeCommand, isCommand, setCommand, setErrorMessages, setErrors, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addError, addErrorMessage, getErrorMessages, getErrors, setErrorMessages
public String getFoo()
public void setFoo(String foo)
public Collection<String> getFlushedErrorMessages()
ErrorCollection
getFlushedErrorMessages
in interface ErrorCollection
public void addErrorCollection(ErrorCollection errors)
ErrorCollection
addErrorCollection
in interface ErrorCollection
errors
- ErrorCollection whose errors/messages we obtain.public void addErrorMessages(Collection errorMessages)
ErrorCollection
addErrorMessages
in interface ErrorCollection
errorMessages
- Collection of error strings.public void addErrors(Map errors)
ErrorCollection
addErrors
in interface ErrorCollection
errors
- of String: String pairs, eg. {"assignee": "Assignee is required"}public boolean hasAnyErrors()
ErrorCollection
hasAnyErrors
in interface ErrorCollection
public void addError(String field, String message, ErrorCollection.Reason reason)
ErrorCollection
addError
in interface ErrorCollection
field
- Field name, eg. "assignee"message
- Error message.reason
- Reason for the error.public void addErrorMessage(String message, ErrorCollection.Reason reason)
ErrorCollection
addErrorMessage
in interface ErrorCollection
message
- Error message.reason
- Reason for the error.public void addReasons(Set<ErrorCollection.Reason> reasons)
ErrorCollection
addReasons
in interface ErrorCollection
reasons
- a set of well known reasons why the function has not been performed.public void addReason(ErrorCollection.Reason reason)
ErrorCollection
addReason
in interface ErrorCollection
reason
- a well known reasons why the function has not been performed.public void setReasons(Set<ErrorCollection.Reason> reasons)
ErrorCollection
setReasons
in interface ErrorCollection
reasons
- a set of well known reasons why the function has not been performed.public Set<ErrorCollection.Reason> getReasons()
ErrorCollection
getReasons
in interface ErrorCollection
Copyright © 2002-2018 Atlassian. All Rights Reserved.