com.atlassian.jira.util
Interface ErrorCollection

All Known Implementing Classes:
AboutPage, AbstractAddScheme, AbstractAddWorkflowTransitionDescriptor, AbstractAddWorkflowTransitionDescriptorParams, AbstractAdministerFilter, AbstractBrowser, AbstractBulkOperationAction, AbstractBulkOperationDetailsAction, AbstractBulkWatchOperationAction, AbstractCommentableAssignableIssue, AbstractCommentableIssue, AbstractConfigureFieldLayout, AbstractConstantAction, AbstractConvertIssue, AbstractCopyScheme, AbstractDashboardAdministration, AbstractDeleteConstant, AbstractDeleteScheme, AbstractDeleteWorkflowTransitionDescriptor, AbstractEditConfigurationItemAction, AbstractEditConstant, AbstractEditFieldLayoutItem, AbstractEditFieldLayoutSchemeAction, AbstractEditScheme, AbstractEditWorkflowTransitionDescriptorParams, AbstractFieldLayoutAction, AbstractFieldScreenAction, AbstractFieldScreenSchemeAction, AbstractFieldScreenSchemeItemAction, AbstractFilterAction, AbstractGroupToRoleAction, AbstractImportEntity, AbstractImportIssue, AbstractIssueLinkAction, AbstractIssueSelectAction, AbstractManageIssueTypeOptionsAction, AbstractMergeAction, AbstractPluggableTabPanelAction, AbstractProjectAction, AbstractProjectAndSchemeAwareAction, AbstractProjectImportProgress, AbstractProjectImportUsersMissing, AbstractProjectRole, AbstractRoleActorAction, AbstractRoleActors, AbstractSchemeAware, AbstractSchemeAwareAction, AbstractSchemePickerAction, AbstractSchemePurgeAction, AbstractSchemeToolAction, AbstractSelectProjectScheme, AbstractSetupAction, AbstractTrustedApplicationAction, AbstractViewConstants, AbstractViewIssue, AbstractViewSchemes, AbstractWorkflowAction, AbstractWorkflowDraftResultAction, AbstractWorkflowStep, AbstractWorkflowTransition, AbstractWorkflowTransitionAction, AbstractWorklogAction, AcknowledgeTask, AddComment, AddComponent, AddFieldConfiguration, AddFieldConfigurationScheme, AddFieldScreenSchemeItem, AddIssueSecurity, AddIssueTypeScreenScheme, AddIssueTypeScreenScreenSchemeAssociation, AddIssueTypeToFieldConfigurationAssociation, AddNewIssueTypeToScheme, AddNotification, AddPermission, AddPortalPage, AddProject, AddProjectCategory, AddScheme, AddScheme, AddScheme, AddScheme, AddUser, AddVersion, AddWebLink, AddWorkflowTransition, AddWorkflowTransitionCondition, AddWorkflowTransitionConditionParams, AddWorkflowTransitionFunctionParams, AddWorkflowTransitionPostFunction, AddWorkflowTransitionValidator, AddWorkflowTransitionValidatorParams, AdjustFavourite, AdvancedApplicationProperties, AllUsersRememberMeCookies, AssignIssue, AssociateFieldToScreens, AssociateIssueTypeSchemes, AssociateIssueTypeSchemesWithDefault, AttachFile, AttachScreenshot, AttachTemporaryFile, BrowseProjects, BulkCancelWizard, BulkChooseOperation, BulkDelete, BulkEdit, BulkEdit1, BulkEditUserGroups, BulkMigrate, BulkMove, BulkUnwatch, BulkWatch, BulkWorkflowTransition, CantBrowseCreatedIssue, ChangePassword, ChangeSharedDashboardOwner, ChangeSharedFilterOwner, CleanData, ClearRememberMeCookies, CloneIssueDetails, CloneWorkflow, CommentAssignIssue, ConfigureCrowdServer, ConfigureCustomField, ConfigureFieldLayout, ConfigureFieldLayoutScheme, ConfigureFieldScreen, ConfigureFieldScreenScheme, ConfigureIssueTypeOptionScheme, ConfigureIssueTypeScreenScheme, ConfigureLogging, ConfigureOptionScheme, ConfigurePortalPages, ConfigureReport, ConfirmNewInstallationWithOldLicense, ContactAdministrators, ConvertIssueToSubTask, ConvertSubTaskToIssue, CopyFieldLayout, CopyFieldLayoutScheme, CopyScheme, CopyScheme, CopyScheme, CopyScheme, CreateCustomField, CreateDraftWorkflow, CreateIssue, CreateIssueDetails, CreateSubTaskIssue, CreateSubTaskIssueDetails, CreateWorklog, CurrentUsersList, Dashboard, DeleteAttachment, DeleteComment, DeleteCustomField, DeleteFilter, DeleteGroup, DeleteIssue, DeleteIssueSecurity, DeleteIssueSecurityLevel, DeleteIssueType, DeleteJobRunner, DeleteLink, DeleteLinkType, DeleteNotification, DeleteOptionScheme, DeletePermission, DeletePortalPage, DeletePriority, DeleteProject, DeleteProjectCategory, DeleteProjectEntity, DeleteProjectRole, DeleteRemoteIssueLink, DeleteResolution, DeleteScheme, DeleteScheme, DeleteScheme, DeleteScheme, DeleteScheme, DeleteSharedDashboard, DeleteSharedFilter, DeleteStatus, DeleteSubTaskIssueType, DeleteTrustedApplication, DeleteUser, DeleteUserProperty, DeleteWorkflowStep, DeleteWorkflowTransitionCondition, DeleteWorkflowTransitionPostFunction, DeleteWorkflowTransitions, DeleteWorkflowTransitionValidator, DeleteWorklog, DisableSubTasks, EditAnnouncementBanner, EditApplicationProperties, EditAttachmentSettings, EditComment, EditCrowdApplication, EditCustomField, EditCustomFieldDefaults, EditCustomFieldOptions, EditCustomFieldUserPickerFilter, EditDarkFeatures, EditDefaultDashboard, EditDefaultFieldLayoutItem, EditFieldLayout, EditFieldLayoutItem, EditFieldLayoutItemRenderer, EditFieldLayoutItemRendererConfirmation, EditFieldLayoutScheme, EditFieldScreen, EditFieldScreenScheme, EditFieldScreenSchemeItem, EditFilter, EditIndexRecoverySettings, EditIssue, EditIssueSecurities, EditIssueType, EditIssueTypeScreenScheme, EditLabels, EditLinkType, EditListener, EditLookAndFeel, EditNestedGroups, EditNotifications, EditPermissions, EditPortalPage, EditPriority, EditProfile, EditProject, EditProjectCategory, EditProjectLeadAndDefaultAssignee, EditProjectRole, EditResolution, EditScheme, EditScheme, EditScheme, EditService, EditStatus, EditSubTaskIssueTypes, EditTrustedApplication, EditUser, EditUserDefaultSettings, EditUserGroups, EditUserProjectRoles, EditUserProperties, EditUserProperty, EditWorkflow, EditWorkflowDispatcher, EditWorkflowScheme, EditWorkflowStep, EditWorkflowTransition, EditWorkflowTransitionConditionParams, EditWorkflowTransitionPostFunctionParams, EditWorkflowTransitionValidatorParams, Error404, FavouriteFilters, FilterPickerPopup, FilterSubscription, ForgotLoginDetails, GenericEditProfile, GlobalPermissions, GroupBrowser, GroupPickerBrowser, GroupRoleActorAction, IconPicker, ImportAll, ImportResult, ImportWorkflow, IndexAdminImpl, IndexOptimize, IndexProject, IntegrityChecker, IssueActionSupport, IssuePicker, JellyRunner, JiraCreditsPage, JiraWebActionSupport, JiraWizardActionSupport, LeaveAdmin, LicenseRoles, LinkConfluencePage, LinkExistingIssue, LinkJiraIssue, ListEventTypes, ListWorkflows, Logout, MailQueueAdmin, ManageAttachments, ManageConfigurationScheme, ManageFilters, ManageIssueTypeSchemes, ManageSubscriptions, ManageSubTasks, ManageWatchers, MapColumns, MapCustomFields, MapIssueTypes, MapPriorities, MapResolutions, MapStatuses, MapUsers, MapValidateImport, MigrateIssueTypes, MockAbstractBrowser, MockAction, 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, ReferenceSoyAction, ReleaseNote, ResetFailedLoginCount, ResetPassword, RestoreDefaultDashboard, SaveAsFilter, SaveFilter, SchedulerAdmin, SchemeAwareIssueSecurityAction, SchemeAwareNotificationAction, SchemeAwarePermissionAction, SchemeComparisonPickerAction, SchemeComparisonToolAction, SchemeGroupToRoleMapperAction, SchemeGroupToRolePickerAction, SchemeGroupToRoleResultAction, SchemeGroupToRoleTransformerAction, SchemeMergeAction, SchemeMergePreviewAction, SchemeMergeResultAction, SchemePurgeToolPreviewAction, SchemePurgeToolResultsAction, SchemePurgeTypePickerAction, SchemeToolsAction, SchemeTypePickerAction, SearchDescriptionEnabledAction, SelectComponentAssignees, SelectFieldLayoutScheme, SelectIssueTypeSchemeForProject, SelectIssueTypeScreenScheme, SelectProjectCategory, SelectProjectIssueSecurityScheme, SelectProjectPermissionScheme, SelectProjectScheme, SelectProjectSecuritySchemeStep2, SelectProjectWorkflowScheme, SelectProjectWorkflowSchemeStep2, SelectProjectWorkflowSchemeStep3, SendBulkMail, ServiceExecutor, SessionTimeoutMessage, SetGlobalEmailPreference, SetPassword, SetSelectedIssue, SetupAdminAccount, SetupApplicationProperties, SetupBonfire, SetupComplete, SetupDatabase, SetupGreenHopper, SetupImport, SetupLicense, SetupMailNotifications, SetupProductBundle, SetupProductBundleReport, ShowConstantsHelp, ShowTimeTrackingHelp, Signup, SimpleErrorCollection, SimpleWorkflowAction, SiteDarkFeatures, TimeTrackingAdmin, TranslateCustomField, UpdateMyJiraHome, UpdateUserPreferences, UpdateWorklog, UploadXmlFile, UserBrowser, UserPickerBrowser, UserProperty, UserRememberMeCookies, UserRoleActorAction, VersionAction, ViewApplicationProperties, ViewAttachmentSettings, ViewCustomFields, ViewDefaultProjectRoleActors, ViewFieldLayouts, ViewFieldScreens, ViewFieldScreenSchemes, ViewGroup, ViewInstrumentation, ViewIssueFields, ViewIssueTypes, ViewIssueTypeScreenSchemes, ViewKeyboardShortcuts, ViewLicense, ViewLinkTypes, ViewListeners, ViewLogging, ViewMemoryInfo, ViewPriorities, ViewProfile, ViewProject, ViewProjectRoleActors, ViewProjectRoles, ViewProjects, ViewResolutions, ViewSchemes, ViewSchemes, ViewSchemes, ViewSchemes, ViewSchemes, ViewServices, ViewSharedDashboards, ViewSharedFilters, ViewStatuses, ViewSubtaskFragmentAction, ViewSystemInfo, ViewTranslations, ViewTrustedApplications, ViewUpgradeHistory, ViewUser, ViewUserDefaultSettings, ViewUserHover, 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-2014 Atlassian. All Rights Reserved.