com.atlassian.bamboo.utils.error
Interface ErrorCollection

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
AboutAction, AbstractAdminRestAction, AbstractContinuableBuildAction, AbstractCreateDeploymentVersion, AbstractCreateNewJiraIssueAction, AbstractDeploymentVersionAction, AbstractDeploymentVersionHistoryAction, AbstractEntityPagerSupport, AbstractJiraIssueAction, AbstractJiraRelatedAction, AbstractMigrationAction, AbstractNotificationBulkAction, AbstractPermissionAction, AbstractPluginConfigurationAction, AbstractRemoteAgentAuthenticationAction, AbstractRepositoryBulkAction, AbstractSetupAction, AbstractViewCapabilitiesByType, AccessDeniedAction, AddNotificationBulkAction, AddPermissionAction, AddRemoteAgent, AddSharedLocalBuilderCapability, AddSharedLocalCapability, AddSharedRemoteCapability, AddStageAction, AdminErrorAction, AdministerAction, AdministerAuthors, AdminUpdateLicenseAction, AgentJsonProvider, AllBuildsRssFeedAction, AllElasticInstancesAction, AllowLicenseUpdateOrShowExpirationInfo, ArtifactUrlRedirectAction, AvailableVariablesAction, Backup, BambooActionSupport, BambooAgentInstallerAction, BrowseGroupsAction, BuildActionSupport, BuildConfigurationSupport, BuildExpiryAction, BuildJsonProviderAction, BuildList, BuildResultsAction, BulkEditBuildPermissions, BulkPlanAction, CapabilityConfigurationSupport, ChainActionSupport, ChainResultProviderAction, ChainResultsAction, ChangeForgottenPassword, ChangePassword, CloneDeploymentProject, CloneEnvironment, ConfigurationAction, ConfigureAgentAssignments, ConfigureAgentCapability, ConfigureAgentDetails, ConfigureAgentDetailsForGlobalAdmin, ConfigureAgents, ConfigureAlias, ConfigureArtifactHandlers, ConfigureArtifactSubscription, ConfigureBranches, ConfigureBuildArtifact, ConfigureBuildDetails, ConfigureBuildMiscellaneousOptions, ConfigureBuildNotification, ConfigureBuildPermissions, ConfigureBuildRepository, ConfigureBuildRequirement, ConfigureBuildTasks, ConfigureCapability, ConfigureCapabilityKey, ConfigureChainNotification, ConfigureChainTrigger, ConfigureChainTriggers, ConfigureCloverPlugin, ConfigureConcurrentBuilds, ConfigureDeploymentProject, ConfigureDeploymentProjectDetails, ConfigureDeploymentProjectPermissions, ConfigureDeploymentProjectVersioning, ConfigureElasticCapability, ConfigureElasticCloudAction, ConfigureElasticImageConfiguration, ConfigureElasticImageConfigurationAssignments, ConfigureElasticInstanceSchedule, ConfigureElasticInstanceSchedules, ConfigureEnvironment, ConfigureEnvironmentAgents, ConfigureEnvironmentNotifications, ConfigureEnvironmentPermissions, ConfigureEnvironmentTasks, ConfigureEnvironmentTriggers, ConfigureGlobalBuildHangingDetection, ConfigureGlobalPermissions, ConfigureGlobalRepository, ConfigureGlobalRepositoryPermissions, ConfigureGlobalVariables, ConfigureGroup, ConfigureInstantMessagingServer, ConfigureLog4jAction, ConfigureMailServer, ConfigureNotificationPreferences, ConfigurePerforceManager, ConfigurePlanDependencies, ConfigurePlanVariables, ConfigureProfile, ConfigureRemoteAgentAuthentications, ConfigureRepository, ConfigureSecurity, ConfigureSharedCapability, ConfigureSharedCredentials, ConfigureSharedLocalCapability, ConfigureSharedRemoteCapability, ConfigureSingleGlobalRepository, ConfigureSpotInstancesAction, ConfigureSystemNotifications, ConfigureUser, ConfigureVariablesForEnvironment, ContinueBuild, ControlRemoteAgentsAuthentication, ControlRemoteAgentsAvailability, ConvertLocalToGlobalRepository, CreateChain, CreateChainBranch, CreateChainTrigger, CreateDeploymentProjectDetails, CreateDeploymentVersion, CreateEnvironment, CreateEnvironmentTask, CreateEnvironmentTrigger, CreateGlobalRepository, CreateGlobalVariable, CreateInstantMessagingServer, CreateJob, CreateNewJiraIssueForBuildResultAction, CreateNewJiraIssueForTestAction, CreatePlanVariable, CreateRemoteJiraLinkAction, CreateRepository, CreateSharedCredentials, CreateTask, CreateTasksChainWizard, CreateTasksJobWizard, CreateVariableForEnvironment, CronExpressionGeneratorAction, CvsBulkAction, DashboardFilter, DashboardSummaryAction, DecoratedRepository, DeleteAllNotificationBulkAction, DeleteBuildFiles, DeleteBuilds, DeleteChainTrigger, DeleteDeploymentProject, DeleteDeploymentResult, DeleteDeploymentVersion, DeleteEnvironment, DeleteEnvironmentTask, DeleteEnvironmentTrigger, DeleteGitCacheDirectoryAction, DeleteGlobalRepository, DeleteGlobalVariable, DeleteHgCacheDirectory, DeletePlan, DeletePlanResults, DeletePlanVariable, DeleteRepository, DeleteSharedCredentials, DeleteStageAction, DeleteTask, DeleteVariableForEnvironment, DescribeAgentAvailability, DescribeAgentAvailability, DetectBranches, DisablePlanBulkAction, EditAgentCapability, EditChainBranchDetails, EditChainBranchNotifications, EditChainBranchRepository, EditChainDetails, EditChainTrigger, EditCommentAction, EditDeploymentVersionCommentAction, EditElasticCapability, EditEnvironmentTask, EditEnvironmentTrigger, EditGlobalRepository, EditJiraIssues, EditLabelsAction, EditProjectName, EditRemoteAgentAuthenticationIp, EditRepository, EditSharedCapability, EditSharedCredentials, EditTask, EnablePlanBulkAction, ErrorAction, ExecuteManualDeployment, ExecuteRenameAgentCapability, Export, FilterCookieWriterAction, FinishSetupAction, FiveOhOh, ForgotPassword, GetFingerprintAction, GetJiraIssueSchemaAction, GetPkFileAction, GlobalAdminAction, GlobalTrackingConfiguration, GotoAuthors, GotoBuildResult, Import, ImportMavenPlanAction, ImportMavenPlanCheckoutPomAction, ImportMavenPlanCreatePlanAction, JiraRedirectAction, LabelRssFeedAction, LinkTestToJiraIssueAction, ListBuildResults, ListChainResults, ListJobsForChain, ListRunningInstances, LoadGitHubRepositories, Login, Login, Logout, Logout, LogToServer, ManageElasticInstancesAction, ManualBuildBulkAction, MoveBuilds, MoveEnvironment, MoveEnvironmentTask, MoveJobAction, MoveRepository, MoveStageAction, MoveTask, ParameterisedManualBuild, PerformanceStatsAction, PerformanceStatsJmxAction, PlanActionSupport, PlanResultsAction, PlanStatusHistoryAction, Profile, QuarantineSettings, QuarantineTest, ReindexAction, RemoveBuildArtifacts, RemoveBuildError, RenameAgentCapability, RenameDeploymentVersion, ReorderBuild, ReplaceTriggersAction, ReplaceTriggersBulkAction, RepositorySettingsAction, RerunBuild, ResponsibleAvatars, RestartBuild, RssFeedAction, SearchUserAction, SelectBuildConfigurationTab, SelectSetupStepAction, SetAgentBuildFilter, SetFavouriteAction, SetResultsFilter, SetupAdminUserAction, SetupDatabaseAction, SetupDatabaseConnectionAction, SetupDefaultsAction, SetupEmbeddedDatabaseAction, SetupGeneralConfiguration, SetupImportDataAction, SetupLicenseAction, SetupUpdateLicenseAction, ShowLatestBuildStatus, SignupUser, SimpleErrorCollection, StageAction, StartElasticAgents, StarterAction, StopAllElasticAgents, StopDeployment, StopElasticAgents, StopPlan, SuspendBuild, SvnBulkAction, SystemErrorList, SystemInfoAction, TestOgnlEscaping, ToggleArtifactDefinitionSharing, TransitionJiraIssueAction, TriggerBranchExpiryAction, TriggerManualBuild, TriggerRemoteBuild, UnlinkTestToJiraIssueAction, UpdateCvsModuleBulkAction, UpdateCvsRootCredentialsBulkAction, UpdateDefaultsLocalCapability, UpdateGlobalVariable, UpdateLicenseAction, UpdatePlanVariable, UpdateResponsibilitiesAction, UpdateSvnCredentialsBulkAction, UpdateSvnUrlBulkAction, UpdateTaskState, UpdateVariableForEnvironment, UpdateWebUrlBulkAction, UserManagement, UserPickerAction, ViewActivityLog, ViewAdministrators, ViewAgent, ViewAgentAdmin, ViewAgentDetailsAction, ViewAgentPlanMatrix, ViewAgentPlanMatrixWizard, ViewAgents, ViewAggregatedAuthors, ViewAggregatedJobPlugins, ViewAllDeploymentProjects, ViewAllRepositories, ViewAuthor, ViewAuthorChart, ViewAuthors, ViewAuthors, ViewBambooInternals, ViewBuild, ViewBuildConfiguration, ViewBuildError, ViewBuilders, ViewBuildFiles, ViewBuildLogs, ViewBuildNumberChart, ViewBuildResults, ViewBuildResultsByJiraKey, ViewBuildResultsForLabelAction, ViewBuildResultsSuccessfulTests, ViewBuildResultsTable, ViewBuildResultsTableByPlans, ViewBuildResultsTests, ViewChainArtifacts, ViewChainAuditLog, ViewChainBranches, ViewChainConfiguration, ViewChainLogs, ViewChainResult, ViewChainSummary, ViewChainTestResults, ViewCloverBuildResults, ViewCloverCoverageSummary, ViewCombinedByBuildNumberChart, ViewCombinedByTimePeriodChart, ViewDatabaseConfigurationAction, ViewDeploymentProjects, ViewDeploymentResult, ViewDeploymentVersion, ViewDeploymentVersionCommits, ViewDeploymentVersionJiraIssues, ViewDeploymentVersionVariables, ViewElasticAgentHistoryAction, ViewElasticInstanceAction, ViewEnvironment, ViewGadgetUrls, ViewGlobalAuditLogAction, ViewInstancesForConfigurationAction, ViewJdks, ViewJiraIssueForPlan, ViewJiraIssues, ViewLabels, ViewMaven2ChainSummary, ViewNextBuildResults, ViewOfflineAgents, ViewOfflineElasticAgentDetailsAction, ViewOfflineElasticAgentDetailsAdminAction, ViewPlanConfiguration, ViewPlanStatusByJiraKey, ViewPlanUpdates, ViewPreviousBuildResults, ViewProject, ViewQuarantinedTests, ViewRejectedRequirements, ViewRemoteAgentAuthentications, ViewReport, ViewReportChart, ViewResponsibilitiesForUser, ViewRunningPlans, ViewTelemetryAction, ViewTestCaseAction, ViewTestCaseResultAction, ViewTestClassResultAction, ViewTestsSummary, ViewTestsSummaryForPlan, ViewTrackingForBuildResult, ViewUserSummary

public interface ErrorCollection
extends java.io.Serializable

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


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.
 java.lang.String 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> errorMessages)
          Append new error messages to those already collected.
 void addErrors(java.util.Map<java.lang.String,?> errors)
          Deprecated. since 5.1 use $addFieldErrors(java.util.Map) instead
 void addFieldErrors(java.util.Map<java.lang.String,java.util.List<java.lang.String>> errors)
          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.util.List<java.lang.String>> getErrors()
          Get all field-specific errors.
 java.util.Map<java.lang.String,java.util.List<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).
 

Method Detail

addError

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

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

addError

void addError(java.lang.String prefix,
              java.lang.String field,
              java.lang.String message)
Adds a new form validation error with a given prefix. ie. prefix of "builder.ant" and field "target" will result in a key of "builder.ant.target"

Parameters:
prefix - The prefix of the field in . form
field - The id of the form element in error
message - The error message to display to the user

addErrorMessage

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

Parameters:
message - Error message.

addErrorMessage

java.lang.String addErrorMessage(java.lang.String message,
                                 java.lang.Exception e)

getErrorMessages

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

Returns:
Collection of error Strings.

setErrorMessages

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

Parameters:
errorMessages - List of error message Strings.

getFlushedErrorMessages

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

Returns:
The (now cleared) error messages.

getErrors

java.util.Map<java.lang.String,java.util.List<java.lang.String>> getErrors()
Get all field-specific errors.

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

addErrorCollection

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

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

addErrorMessages

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

Parameters:
errorMessages - Collection of error strings.

addErrors

@Deprecated
void addErrors(java.util.Map<java.lang.String,?> errors)
Deprecated. since 5.1 use $addFieldErrors(java.util.Map) instead

Append new field-specific errors to those already collected.

Parameters:
errors - A Map from String field names, to String error messages, or Collections of String error messages.

addFieldErrors

void addFieldErrors(java.util.Map<java.lang.String,java.util.List<java.lang.String>> errors)
Append new field-specific errors to those already collected.

Parameters:
errors - A Map from String field names, to String error messages, or Collections of String error messages.

hasAnyErrors

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

Returns:
true if there are errors; false otherwise.

getFieldErrors

java.util.Map<java.lang.String,java.util.List<java.lang.String>> getFieldErrors()

getTotalErrors

int getTotalErrors()


Copyright © 2014 Atlassian Software Systems Pty Ltd. All Rights Reserved.