Class AbstractCustomFieldOperationsHandler<T>
java.lang.Object
com.atlassian.jira.issue.customfields.impl.rest.AbstractCustomFieldOperationsHandler<T>
- All Implemented Interfaces:
RestFieldOperationsHandler
- Direct Known Subclasses:
CascadingSelectCustomFieldOperationsHandler,DateCustomFieldOperationsHandler,DateTimeCustomFieldOperationsHandler,GroupCustomFieldOperationsHandler,LabelsCustomFieldOperationsHandler,MultiGroupCustomFieldOperationsHandler,MultiSelectCustomFieldOperationsHandler,MultiUserCustomFieldOperationsHandler,NumberCustomFieldOperationsHandler,ProjectCustomFieldOperationsHandler,SelectCustomFieldOperationsHandler,TextCustomFieldOperationsHandler,UserCustomFieldOperationsHandler
@PublicSpi
public abstract class AbstractCustomFieldOperationsHandler<T>
extends Object
implements RestFieldOperationsHandler
- Since:
- v5.0
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.AbstractCustomFieldOperationsHandler(CustomField field, I18nHelper i18nHelper) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected TapplyOperation(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 valueprotected abstract voidfinaliseOperation(T finalValue, IssueInputParameters parameters, ErrorCollection errors) takes the value returnd by a call to applyOperation() and puts it into the inputparamsprotected abstract TgetInitialCreateValue(IssueContext issueCtx) compute the "currentValue" to be passed to applyOperation()protected abstract TgetInitialValue(Issue issue, ErrorCollection errors) compute the "currentValue" to be passed to applyOperation()Returns a list of operation names which are supported by this field.protected ThandleAddOperation(IssueContext issueCtx, Issue issue, T currentFieldValue, JsonData operationValue, ErrorCollection errors) protected ThandleRemoveOperation(IssueContext issueCtx, Issue issue, T currentFieldValue, JsonData operationValue, ErrorCollection errors) protected ThandleSetOperation(IssueContext issueCtx, Issue issue, T currentFieldValue, JsonData operationValue, ErrorCollection errors) updateIssueInputParameters(IssueContext issueCtx, Issue issue, String fieldId, IssueInputParameters inputParameters, List<FieldOperationHolder> operations) This method has to set the field value(s) in theIssueInputParametersbased on the operations.
-
Field Details
-
field
-
i18nHelper
-
-
Constructor Details
-
AbstractCustomFieldOperationsHandler
Constructor.- Parameters:
field- Field the handler is for.i18nHelper- I18nHelper
-
AbstractCustomFieldOperationsHandler
Deprecated.@since 5.0-RC2 Use the constructorAbstractCustomFieldOperationsHandler(CustomField field, I18nHelper i18nHelper)Constructor.- Parameters:
field- Field the handler is for.
-
-
Method Details
-
getSupportedOperations
Description copied from interface:RestFieldOperationsHandlerReturns a list of operation names which are supported by this field.- Specified by:
getSupportedOperationsin interfaceRestFieldOperationsHandler- Returns:
- a set of supported Operations
-
getInitialValue
compute the "currentValue" to be passed to applyOperation() -
getInitialCreateValue
compute the "currentValue" to be passed to applyOperation() -
finaliseOperation
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 -
updateIssueInputParameters
public ErrorCollection updateIssueInputParameters(IssueContext issueCtx, Issue issue, String fieldId, IssueInputParameters inputParameters, List<FieldOperationHolder> operations) Description copied from interface:RestFieldOperationsHandlerThis method has to set the field value(s) in theIssueInputParametersbased 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.- Specified by:
updateIssueInputParametersin interfaceRestFieldOperationsHandler- Parameters:
issueCtx- the Issue Context , i.e. Project IssueTypeissue- 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.
-
handleSetOperation
protected T handleSetOperation(IssueContext issueCtx, Issue issue, T currentFieldValue, JsonData operationValue, ErrorCollection errors) -
handleRemoveOperation
protected T handleRemoveOperation(IssueContext issueCtx, Issue issue, T currentFieldValue, JsonData operationValue, ErrorCollection errors) -
handleAddOperation
protected T handleAddOperation(IssueContext issueCtx, Issue issue, T currentFieldValue, JsonData operationValue, ErrorCollection errors) -
applyOperation
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
-
AbstractCustomFieldOperationsHandler(CustomField field, I18nHelper i18nHelper)