com.atlassian.jira.util
Interface ErrorCollection

All Known Implementing Classes:
AbstractAddScheme, AbstractAddWorkflowTransitionDescriptor, AbstractAddWorkflowTransitionDescriptorParams, AbstractAdministerFilter, AbstractBrowser, AbstractBulkOperationAction, AbstractBulkOperationDetailsAction, AbstractCommentableAssignableIssue, AbstractCommentableIssue, AbstractConfigureFieldLayout, AbstractConstantAction, AbstractConvertIssue, AbstractCopyScheme, AbstractDashboardAdministration, AbstractDeleteConstant, AbstractDeleteScheme, AbstractDeleteWorkflowTransitionDescriptor, AbstractEditConfigurationItemAction, AbstractEditConstant, AbstractEditFieldLayoutItem, AbstractEditFieldLayoutSchemeAction, AbstractEditScheme, AbstractEditWorkflowTransitionDescriptorParams, AbstractFieldLayoutAction, AbstractFieldScreenAction, AbstractFieldScreenSchemeAction, AbstractFieldScreenSchemeItemAction, AbstractGroupToRoleAction, AbstractImportEntity, AbstractImportIssue, AbstractIssueLinkAction, AbstractIssueSelectAction, AbstractManageIssueTypeOptionsAction, AbstractMergeAction, AbstractProjectAction, AbstractProjectImportProgress, AbstractProjectImportUsersMissing, AbstractProjectRole, AbstractRoleActorAction, AbstractRoleActors, AbstractSchemeAware, AbstractSchemeAwareAction, AbstractSchemePickerAction, AbstractSchemePurgeAction, AbstractSchemeToolAction, AbstractSelectProjectScheme, AbstractSetupAction, AbstractTrustedApplicationAction, AbstractViewConstants, AbstractViewIssue, AbstractViewIssueColumns, AbstractViewSchemes, AbstractViewWorkflowMetaAttributes, AbstractWorkflowAction, AbstractWorkflowDraftResultAction, AbstractWorkflowStep, AbstractWorkflowTransition, AbstractWorkflowTransitionAction, AbstractWorklogAction, AcknowledgeTask, AddComment, AddComponent, AddFieldConfiguration, AddFieldConfigurationScheme, AddFieldScreenSchemeItem, AddIssueSecurity, AddIssueTypeScreenScheme, AddIssueTypeScreenScreenSchemeAssociation, AddIssueTypeToFieldConfigurationAssociation, AddNewIssueTypeToScheme, AddNotification, AddPermission, AddPortalPage, AddProject, AddProjectCategory, AddRepository, AddScheme, AddScheme, AddScheme, AddScheme, AddUser, AddVersion, AddWebLink, AddWorkflowSchemeEntity, AddWorkflowTransition, AddWorkflowTransitionCondition, AddWorkflowTransitionConditionParams, AddWorkflowTransitionFunctionParams, AddWorkflowTransitionPostFunction, AddWorkflowTransitionValidator, AddWorkflowTransitionValidatorParams, AdjustFavourite, AdminSummary, AdvancedApplicationProperties, AllUsersRememberMeCookies, AssignIssue, AssociateFieldToScreens, AssociateIssueTypeSchemes, AssociateIssueTypeSchemesWithDefault, AttachFile, AttachScreenshot, AttachTemporaryFile, BrowseComponent, BrowseProject, BrowseProjects, BrowseVersion, BulkCancelWizard, BulkChooseOperation, BulkDelete, BulkEdit, BulkEdit1, BulkEditUserGroups, BulkMigrate, BulkMove, BulkWorkflowTransition, CantBrowseCreatedIssue, ChangePassword, ChangeSharedDashboardOwner, ChangeSharedFilterOwner, CleanData, ClearRememberMeCookies, CloneIssueDetails, CloneWorkflow, CommentAssignIssue, ConfigureCrowdServer, ConfigureCustomField, ConfigureFieldLayout, ConfigureFieldLayoutScheme, ConfigureFieldScreen, ConfigureFieldScreenScheme, ConfigureIssueTypeOptionScheme, ConfigureIssueTypeScreenScheme, ConfigureLogging, ConfigureOptionScheme, ConfigurePortalPages, ConfigureReport, ConfigureWhitelist, ConfirmInstallationWithLicense, ConfirmNewInstallationWithOldLicense, ContactAdministrators, ConvertIssueToSubTask, ConvertSubTaskToIssue, CopyFieldLayout, CopyFieldLayoutScheme, CopyScheme, CopyScheme, CopyScheme, CopyScheme, CreateCustomField, CreateDraftWorkflow, CreateIssue, CreateIssueDetails, CreateSubTaskIssue, CreateSubTaskIssueDetails, CreateWorklog, CurrentUsersList, Dashboard, DateRangePicker, DeleteAttachment, DeleteComment, DeleteCustomField, DeleteFilter, DeleteGroup, DeleteIssue, DeleteIssueSecurity, DeleteIssueSecurityLevel, DeleteIssueType, DeleteLink, DeleteLinkType, DeleteNotification, DeleteOptionScheme, DeletePermission, DeletePortalPage, DeletePriority, DeleteProject, DeleteProjectCategory, DeleteProjectEntity, DeleteProjectRole, DeleteRemoteIssueLink, DeleteRepository, DeleteResolution, DeleteScheme, DeleteScheme, DeleteScheme, DeleteScheme, DeleteScheme, DeleteSharedDashboard, DeleteSharedFilter, DeleteStatus, DeleteSubTaskIssueType, DeleteTrustedApplication, DeleteUser, DeleteUserProperty, DeleteWorkflowSchemeEntity, DeleteWorkflowStep, DeleteWorkflowTransitionCondition, DeleteWorkflowTransitionPostFunction, DeleteWorkflowTransitions, DeleteWorkflowTransitionValidator, DeleteWorklog, DisableSubTasks, EditAnnouncementBanner, EditApplicationProperties, EditAttachmentSettings, EditBasicConfig, EditComment, EditCrowdApplication, EditCustomField, EditCustomFieldDefaults, EditCustomFieldOptions, EditDarkFeatures, EditDefaultDashboard, EditDefaultFieldLayoutItem, EditFieldLayout, EditFieldLayoutItem, EditFieldLayoutItemRenderer, EditFieldLayoutItemRendererConfirmation, EditFieldLayoutScheme, EditFieldScreen, EditFieldScreenScheme, EditFieldScreenSchemeItem, EditFilter, EditIssue, EditIssueSecurities, EditIssueType, EditIssueTypeScreenScheme, EditLabels, EditLinkType, EditListener, EditLookAndFeel, EditNestedGroups, EditNotifications, EditPermissions, EditPortalPage, EditPriority, EditProfile, EditProject, EditProjectCategory, EditProjectLeadAndDefaultAssignee, EditProjectRole, EditResolution, EditScheme, EditScheme, EditScheme, EditScheme, EditService, EditStatus, EditSubTaskIssueTypes, EditTrustedApplication, EditUser, EditUserDefaultSettings, EditUserGroups, EditUserProjectRoles, EditUserProperties, EditUserProperty, EditWorkflow, EditWorkflowDispatcher, EditWorkflowScheme, EditWorkflowSchemeEntities, EditWorkflowStep, EditWorkflowTransition, EditWorkflowTransitionConditionParams, EditWorkflowTransitionPostFunctionParams, EditWorkflowTransitionValidatorParams, EnterpriseSelectProjectRepository, FavouriteFilters, FilterPickerPopup, FilterSubscription, ForgotLoginDetails, GenericEditProfile, GlobalPermissions, GroupBrowser, GroupPickerBrowser, GroupRoleActorAction, IconPicker, ImportAll, ImportResult, ImportWorkflow, IndexAdminImpl, IndexOptimize, IntegrityChecker, IssueActionSupport, IssueNavigator, IssuePicker, JellyRunner, JiraCreditsPage, JiraWebActionSupport, JiraWizardActionSupport, LeaveAdmin, LinkConfluencePage, LinkExistingIssue, LinkJiraIssue, ListEventTypes, ListWorkflows, Logout, MailQueueAdmin, ManageAttachments, ManageConfigurationScheme, ManageFilters, ManageIssueTypeSchemes, ManageSubscriptions, ManageSubTasks, ManageWatchers, MapColumns, MapCustomFields, MapIssueTypes, MapPriorities, MapResolutions, MapStatuses, MapUsers, MapValidateImport, MigrateIssueTypes, MoveIssue, MoveIssueConfirm, MoveIssueSubtasks, MoveIssueUpdateFields, MoveIssueUpdateWorkflow, MoveSubTask, MoveSubTaskChooseOperation, MoveSubTaskParent, MyJiraHome, PreparedReferenceAction, ProjectActionSupport, ProjectEmail, ProjectImportBackupOverviewProgress, ProjectImportMappingProgress, ProjectImportMissingMandatoryUsersCannotCreate, ProjectImportMissingMandatoryUsersExtMgmt, ProjectImportMissingOptionalUsersCannotCreate, ProjectImportMissingOptionalUsersExtMgmt, ProjectImportMissingUsersAutoCreate, ProjectImportProgress, ProjectImportResultsAction, ProjectImportSelectBackup, ProjectImportSelectProject, ProjectImportSummary, ProjectRoleUsageAction, PublishDraftWorkflow, QuickSearch, RecentIssueHistory, ReferenceAction, ReferenceComponentAction, ReferenceComponentImportAction, ReferenceModuleTypeAction, ReferenceResourceAction, ReleaseNote, RepositoryActionSupport, RepositoryTest, ResetFailedLoginCount, ResetPassword, RestoreDefaultDashboard, SaveAsFilter, SaveFilter, SchedulerAdmin, SchemeAwareIssueSecurityAction, SchemeAwareNotificationAction, SchemeAwarePermissionAction, SchemeAwareWorkflowAction, SchemeComparisonPickerAction, SchemeComparisonToolAction, SchemeGroupToRoleMapperAction, SchemeGroupToRolePickerAction, SchemeGroupToRoleResultAction, SchemeGroupToRoleTransformerAction, SchemeMergeAction, SchemeMergePreviewAction, SchemeMergeResultAction, SchemePurgeToolPreviewAction, SchemePurgeToolResultsAction, SchemePurgeTypePickerAction, SchemeToolsAction, SchemeTypePickerAction, SearchDescriptionEnabledAction, SelectComponentAssignees, SelectFieldLayoutScheme, SelectIssueTypeSchemeForProject, SelectIssueTypeScreenScheme, SelectProjectCategory, SelectProjectIssueSecurityScheme, SelectProjectPermissionScheme, SelectProjectRepository, SelectProjectScheme, SelectProjectSecuritySchemeStep2, SelectProjectWorkflowScheme, SelectProjectWorkflowSchemeStep2, SelectProjectWorkflowSchemeStep3, SendBulkMail, ServiceExecutor, SessionTimeoutMessage, SetGlobalEmailPreference, SetPassword, SetSelectedIssue, Setup, Setup2, Setup3, SetupBonfire, SetupComplete, SetupDatabase, SetupGreenHopper, SetupImport, ShowConstantsHelp, ShowTimeTrackingHelp, Signup, SimpleErrorCollection, SimpleWorkflowAction, SiteDarkFeatures, TaskAdmin, TimeTrackingAdmin, UpdateIssueFields, UpdateMyJiraHome, UpdateRepository, UpdateUserPreferences, UpdateWorklog, UploadXmlFile, UserBrowser, UserPickerBrowser, UserProperty, UserRememberMeCookies, UserRoleActorAction, ViewApplicationProperties, ViewAttachmentSettings, ViewCustomFields, ViewDefaultProjectRoleActors, ViewFieldLayouts, ViewFieldScreens, ViewFieldScreenSchemes, ViewGroup, ViewInstrumentation, ViewIssue, ViewIssueColumns, ViewIssueFields, ViewIssueTypes, ViewIssueTypeScreenSchemes, ViewKeyboardShortcuts, ViewLicense, ViewLinkTypes, ViewListeners, ViewLogging, ViewMemoryInfo, ViewPriorities, ViewProfile, ViewProject, ViewProjectRoleActors, ViewProjectRoles, ViewProjects, ViewResolutions, ViewSchemes, ViewSchemes, ViewSchemes, ViewSchemes, ViewSchemes, ViewSearchRequestIssueColumns, ViewServices, ViewSharedDashboards, ViewSharedFilters, ViewStatuses, ViewSubtaskFragmentAction, ViewSystemInfo, ViewTranslations, ViewTrustedApplications, ViewUpgradeHistory, ViewUser, ViewUserDefaultSettings, ViewUserHover, ViewUserIssueColumns, ViewUserPreferences, ViewUserProjectRoles, ViewVoters, ViewWorkflowStep, ViewWorkflowStepMetaAttributes, ViewWorkflowSteps, ViewWorkflowTransition, ViewWorkflowTransitionConditionalResult, ViewWorkflowTransitionMetaAttributes, ViewWorkflowXml, VoteOrWatchIssue, WebSudoAuthenticate, WikiRendererHelpAction, WorkflowUIDispatcher, XmlBackup, XsrfErrorAction

@PublicApi
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).


Nested Class Summary
static class ErrorCollection.Reason
           
 
Method Summary
 void addError(String field, String message)
          Add a field-specific error message.
 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)
          Add error message relating to system state (not field-specific).
 void addErrorMessage(String message, ErrorCollection.Reason reason)
          Add error message relating to system state (not field-specific), and a reason.
 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.
 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> 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.
 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 setErrorMessages(Collection<String> errorMessages)
          Populate this ErrorCollection with a new set of messages (existing errors are lost).
 void setReasons(Set<ErrorCollection.Reason> reasons)
          Set reasons why the function has not been performed.
 

Method Detail

addError

void addError(String field,
              String message)
Add a field-specific error message.

Parameters:
field - Field name, eg. "assignee"
message - Error message.

addError

void addError(String field,
              String message,
              ErrorCollection.Reason reason)
Add a field-specific error message.

Parameters:
field - Field name, eg. "assignee"
message - Error message.
reason - Reason for the error.

addErrorMessage

void addErrorMessage(String message)
Add error message relating to system state (not field-specific).

Parameters:
message - Error message.

addErrorMessage

void addErrorMessage(String message,
                     ErrorCollection.Reason reason)
Add error message relating to system state (not field-specific), and a reason.

Parameters:
message - Error message.
reason - Reason for the error.

getErrorMessages

Collection<String> getErrorMessages()
Get all non field-specific error messages.

Returns:
Collection of error Strings.

setErrorMessages

void setErrorMessages(Collection<String> errorMessages)
Populate this ErrorCollection with a new set of messages (existing errors are lost).

Parameters:
errorMessages - List of error message Strings.

getFlushedErrorMessages

Collection<String> getFlushedErrorMessages()
Get error messages, then get rid of them.

Returns:
The (now cleared) error messages.

getErrors

Map<String,String> getErrors()
Get all field-specific errors.

Returns:
Map of String: String pairs, eg. {"assignee": "Assignee is required"}

addErrorCollection

void addErrorCollection(ErrorCollection errors)
Populate this ErrorCollection with general and field-specific errors.

Parameters:
errors - ErrorCollection whose errors/messages we obtain.

addErrorMessages

void addErrorMessages(Collection<String> errorMessages)
Append new error messages to those already collected.

Parameters:
errorMessages - Collection of error strings.

addErrors

void addErrors(Map<String,String> errors)
Append new field-specific errors to those already collected.

Parameters:
errors - of String: String pairs, eg. {"assignee": "Assignee is required"}

hasAnyErrors

boolean hasAnyErrors()
Whether any errors (of any type - field-specific or otherwise) have been collected.

Returns:
true if any errors (of any type - field-specific or otherwise) have been collected.

addReasons

void addReasons(Set<ErrorCollection.Reason> reasons)
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.

Parameters:
reasons - a set of well known reasons why the function has not been performed.

addReason

void addReason(ErrorCollection.Reason reason)
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.

Parameters:
reason - a well known reasons why the function has not been performed.

setReasons

void setReasons(Set<ErrorCollection.Reason> reasons)
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.

Parameters:
reasons - a set of well known reasons why the function has not been performed.

getReasons

Set<ErrorCollection.Reason> getReasons()
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.

Returns:
a set of well known reasons why the function has not been performed.


Copyright © 2002-2013 Atlassian. All Rights Reserved.