com.atlassian.jira.action
Class MockAction

java.lang.Object
  extended by webwork.action.ActionSupport
      extended by com.atlassian.jira.action.MockAction
All Implemented Interfaces:
ErrorCollection, Serializable, webwork.action.Action, webwork.action.IllegalArgumentAware

public class MockAction
extends webwork.action.ActionSupport
implements ErrorCollection

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.jira.util.ErrorCollection
ErrorCollection.Reason
 
Field Summary
 
Fields inherited from class webwork.action.ActionSupport
command, errorMap, errorMessages, log
 
Fields inherited from interface webwork.action.Action
ERROR, INPUT, LOGIN, NONE, SUCCESS
 
Constructor Summary
MockAction()
           
 
Method Summary
 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.
 
Methods inherited from class webwork.action.ActionSupport
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.jira.util.ErrorCollection
addError, addErrorMessage, getErrorMessages, getErrors, setErrorMessages
 

Constructor Detail

MockAction

public MockAction()
Method Detail

getFoo

public String getFoo()

setFoo

public void setFoo(String foo)

getFlushedErrorMessages

public Collection<String> getFlushedErrorMessages()
Description copied from interface: ErrorCollection
Get error messages, then get rid of them.

Specified by:
getFlushedErrorMessages in interface ErrorCollection
Returns:
The (now cleared) error messages.

addErrorCollection

public void addErrorCollection(ErrorCollection errors)
Description copied from interface: ErrorCollection
Populate this ErrorCollection with general and field-specific errors.

Specified by:
addErrorCollection in interface ErrorCollection
Parameters:
errors - ErrorCollection whose errors/messages we obtain.

addErrorMessages

public void addErrorMessages(Collection errorMessages)
Description copied from interface: ErrorCollection
Append new error messages to those already collected.

Specified by:
addErrorMessages in interface ErrorCollection
Parameters:
errorMessages - Collection of error strings.

addErrors

public void addErrors(Map errors)
Description copied from interface: ErrorCollection
Append new field-specific errors to those already collected.

Specified by:
addErrors in interface ErrorCollection
Parameters:
errors - of String: String pairs, eg. {"assignee": "Assignee is required"}

hasAnyErrors

public boolean hasAnyErrors()
Description copied from interface: ErrorCollection
Whether any errors (of any type - field-specific or otherwise) have been collected.

Specified by:
hasAnyErrors in interface ErrorCollection
Returns:
true if any errors (of any type - field-specific or otherwise) have been collected.

addError

public void addError(String field,
                     String message,
                     ErrorCollection.Reason reason)
Description copied from interface: ErrorCollection
Add a field-specific error message.

Specified by:
addError in interface ErrorCollection
Parameters:
field - Field name, eg. "assignee"
message - Error message.
reason - Reason for the error.

addErrorMessage

public void addErrorMessage(String message,
                            ErrorCollection.Reason reason)
Description copied from interface: ErrorCollection
Add error message relating to system state (not field-specific), and a reason.

Specified by:
addErrorMessage in interface ErrorCollection
Parameters:
message - Error message.
reason - Reason for the error.

addReasons

public void addReasons(Set<ErrorCollection.Reason> reasons)
Description copied from interface: ErrorCollection
Add reasons why the function has not been performed. The reasons may be used by callers of services to set return codes etc. for example in REST services.

Specified by:
addReasons in interface ErrorCollection
Parameters:
reasons - a set of well known reasons why the function has not been performed.

addReason

public void addReason(ErrorCollection.Reason reason)
Description copied from interface: ErrorCollection
Add a reason why the function has not been performed. The reasons may be used by callers of services to set return codes etc. for example in REST services.

Specified by:
addReason in interface ErrorCollection
Parameters:
reason - a well known reasons why the function has not been performed.

setReasons

public void setReasons(Set<ErrorCollection.Reason> reasons)
Description copied from interface: ErrorCollection
Set reasons why the function has not been performed. The reasons may be used by callers of services to set return codes etc. for example in REST services.

Specified by:
setReasons in interface ErrorCollection
Parameters:
reasons - a set of well known reasons why the function has not been performed.

getReasons

public Set<ErrorCollection.Reason> getReasons()
Description copied from interface: ErrorCollection
A set of well known reasons why the function has not been performed. The reasons may be used by callers of services to set return codes etc. for example in REST services.

Specified by:
getReasons in interface ErrorCollection
Returns:
a set of well known reasons why the function has not been performed.


Copyright © 2002-2014 Atlassian. All Rights Reserved.