Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.atlassian.bamboo.utils.error
Interface ErrorCollection

All Known Implementing Classes:
  AbstractAction, AbstractBuildAction, AbstractConfigurationAction, AbstractLicenseAction, AbstractPluginConfigurationAction, AbstractRestAction, AbstractSetupAction, AbstractSetupDatabaseAction, AddProject, AdminErrorAction, AdministerAction, BambooActionSupport, BuildActionSupport, BuildConfigurationSupport, BuildExpiry, BuildJdkList, BuildList, BuildResultsAction, BuildResultsFilterList, ChangePassword, ConfigurationAction, configureAutoFavouriteAction, ConfigureBuildArtifact, ConfigureBuildBuilder, ConfigureBuildDependencies, ConfigureBuilder, ConfigureBuildPostAction, ConfigureBuildRepository, ConfigureGroup, ConfigureInstantMessagingServer, ConfigureJdks, ConfigureJiraServer, ConfigureMailServer, ConfigurePipeline, ConfigureProfile, ConfigureSecurity, ConfigureUser, CreateBuild, DeleteBuildResults, DeleteBuilds, EditCommentAction, EditLabelsAction, EditProjectPlanName, EmailStrategyList, Error, ExecuteBuild, Export, FilterCookieWriterAction, FinishSetupAction, FiveOhOh, ForgotPassword, GetLatestBuildResults, GetLatestUserBuilds, GotoAuthors, GotoBuildResult, Import, LabelRssFeedAction, LicenseAction, ListBuildNames, Login, Login, Logout, Logout, MoveBuilds, Profile, ReindexAction, RemoveBuildError, RepositoryList, SaveConfig, SaveNewProject, SelectSetupStepAction, SetFavouriteAction, SetResultsFilter, SetupDataAction, SetupEmbeddedDatabaseAction, SetupLicenseAction, SetupPathsAction, SignupUser, SimpleErrorCollection, StarterAction, StopBuild, SuspendBuild, SystemErrorList, SystemInfoAction, UpdateAndBuild, UpdateLicenseAction, UpgradeWizard, ValidateBuildWizard, VersionAction, ViewAdministrators, ViewAuditLog, ViewAuthor, ViewAuthorChart, ViewAuthorFailuresChart, ViewAuthors, ViewBuild, ViewBuildActivityLog, ViewBuildConfiguration, ViewBuildError, ViewBuildFiles, ViewBuildResults, ViewBuildResultsByJiraKey, ViewBuildResultsForLabelAction, ViewBuildResultsSuccessfulTests, ViewBuildResultsTable, ViewBuildResultsTests, ViewCloverCoverageSummary, ViewCombinedByBuildNumberChart, ViewCombinedByTimePeriodChart, ViewCurrentRunningBuild, ViewJiraIssues, ViewLabels, ViewLatestBuild, ViewNextBuildResults, ViewPreviousBuildResults, ViewProject, ViewRecentlyCompletedBuilds, ViewReport, ViewReportChart, ViewTestCaseAction, ViewTestCaseResultAction, ViewTestClassResultAction, ViewTestsSummary, WelcomeWizard, WelcomeWizard1

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

Method Summary
`void` | `addError(String field, String message)` Add a field-specific error message.
`void` | `addError(String prefix, String field, 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.
`void` | `addErrorMessage(String message)` Add error message relating to system state (not field-specific).
`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.
`Collection` | `getErrorMessages()` Get all non field-specific error messages.
`Map` | `getErrors()` Get all field-specific errors.
`Map` | `getFieldErrors()`
`Collection` | `getFlushedErrorMessages()` Get error messages, then get rid of them.
`boolean` | `hasAnyErrors()` Whether any errors (of any type - field-specific or otherwise) have been collected.
`void` | `setErrorMessages(Collection errorMessages)` Populate this ErrorCollection with a new set of messages (existing errors are lost).

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 prefix,
                  String field,
                  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

    void addErrorMessage(String message)

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

  Parameters:
    `message` - Error message.

### getErrorMessages

    Collection getErrorMessages()

  Get all non field-specific error messages.

  Returns:
    Collection of error Strings.

### setErrorMessages

    void setErrorMessages(Collection errorMessages)

  Populate this ErrorCollection with a new set of messages (existing errors are lost).

  Parameters:
    `errorMessages` - List of error message `String`s.

### getFlushedErrorMessages

    Collection getFlushedErrorMessages()

  Get error messages, then get rid of them.

  Returns:
    The (now cleared) error messages.

### getErrors

    Map 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 errorMessages)

  Append new error messages to those already collected.

  Parameters:
    `errorMessages` - Collection of error strings.

### addErrors

    void addErrors(Map 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.

### getFieldErrors

    Map getFieldErrors()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2006 Atlassian Software Systems. All Rights Reserved.