@PublicSpi public abstract class

AbstractCustomFieldOperationsHandler

extends Object
implements RestFieldOperationsHandler
java.lang.Object
   ↳ com.atlassian.jira.issue.customfields.impl.rest.AbstractCustomFieldOperationsHandler<T>
Known Direct Subclasses

@PublicSpi

This class is designed for plugins to implement.

Clients of @PublicSpi can expect that programs compiled against a given version will remain binary compatible with later versions of the @PublicSpi as per each product's API policy (clients should refer to each product's API policy for the exact guarantee -- usually binary compatibility is guaranteed at least across minor versions).

Note: @PublicSpi interfaces and classes are specifically designed to be implemented/extended by clients. Hence, the guarantee of binary compatibility is different to that of @PublicApi elements (if an element is both @PublicApi and @PublicSpi, both guarantees apply).

Summary

Fields
protected final CustomField field
protected final I18nHelper i18nHelper
Public Constructors
AbstractCustomFieldOperationsHandler(CustomField field, I18nHelper i18nHelper)
Constructor.
AbstractCustomFieldOperationsHandler(CustomField field)
Constructor.
Public Methods
Set<String> getSupportedOperations()
Returns a list of operation names which are supported by this field.
ErrorCollection updateIssueInputParameters(IssueContext issueCtx, Issue issue, String fieldId, IssueInputParameters inputParameters, List<FieldOperationHolder> operations)
This method has to set the field value(s) in the IssueInputParameters based on the operations.
Protected Methods
T applyOperation(IssueContext issueCtx, Issue issue, StandardOperation operation, T currentFieldValue, JsonData operationValue, ErrorCollection errors)
gets called (perhaps multiple times) to apply the given operation to the given currentValuye, retyrning the new value
abstract void finaliseOperation(T finalValue, IssueInputParameters parameters, ErrorCollection errors)
takes the value returnd by a call to applyOperation() and puts it into the inputparams
abstract T getInitialCreateValue(IssueContext issueCtx)
compute the "currentValue" to be passed to applyOperation()
abstract T getInitialValue(Issue issue, ErrorCollection errors)
compute the "currentValue" to be passed to applyOperation()
T handleAddOperation(IssueContext issueCtx, Issue issue, T currentFieldValue, JsonData operationValue, ErrorCollection errors)
T handleRemoveOperation(IssueContext issueCtx, Issue issue, T currentFieldValue, JsonData operationValue, ErrorCollection errors)
T handleSetOperation(IssueContext issueCtx, Issue issue, T currentFieldValue, JsonData operationValue, ErrorCollection errors)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.issue.fields.rest.RestFieldOperationsHandler

Fields

protected final CustomField field

protected final I18nHelper i18nHelper

Public Constructors

public AbstractCustomFieldOperationsHandler (CustomField field, I18nHelper i18nHelper)

Constructor.

Parameters
field Field the handler is for.
i18nHelper I18nHelper

public AbstractCustomFieldOperationsHandler (CustomField field)

Constructor.

Parameters
field Field the handler is for.

Public Methods

public Set<String> getSupportedOperations ()

Returns a list of operation names which are supported by this field.

Returns
  • a set of supported Operations

public ErrorCollection updateIssueInputParameters (IssueContext issueCtx, Issue issue, String fieldId, IssueInputParameters inputParameters, List<FieldOperationHolder> operations)

This method has to set the field value(s) in the IssueInputParameters based on the operations. The issue service will validate the new field values in the IssueInputParameters, thus all permission checks are done by the issue service.

Parameters
issueCtx the Issue Context , i.e. Project IssueType
issue the issue (may be null when creating an issue)
fieldId The Id of the field being processed.
inputParameters the inputparameters containing all updatd field values.
operations the operations to perform for this field. Has to be one of the supported operations.
Returns
  • contains errors, if there was a problem when setting the field values on the IssueInputParameters. No errors if it was able to update the IssueInputParameters.

Protected Methods

protected T applyOperation (IssueContext issueCtx, Issue issue, StandardOperation operation, T currentFieldValue, JsonData operationValue, ErrorCollection errors)

gets called (perhaps multiple times) to apply the given operation to the given currentValuye, retyrning the new value

protected abstract void finaliseOperation (T finalValue, IssueInputParameters parameters, ErrorCollection errors)

takes the value returnd by a call to applyOperation() and puts it into the inputparams

protected abstract T getInitialCreateValue (IssueContext issueCtx)

compute the "currentValue" to be passed to applyOperation()

protected abstract T getInitialValue (Issue issue, ErrorCollection errors)

compute the "currentValue" to be passed to applyOperation()

protected T handleAddOperation (IssueContext issueCtx, Issue issue, T currentFieldValue, JsonData operationValue, ErrorCollection errors)

protected T handleRemoveOperation (IssueContext issueCtx, Issue issue, T currentFieldValue, JsonData operationValue, ErrorCollection errors)

protected T handleSetOperation (IssueContext issueCtx, Issue issue, T currentFieldValue, JsonData operationValue, ErrorCollection errors)