Class AbstractCustomFieldType<T,S>
java.lang.Object
com.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType<T,S>
- All Implemented Interfaces:
CustomFieldType<T,S>
- Direct Known Subclasses:
AbstractMultiCFType,AbstractMultiSettableCFType,AbstractSingleFieldType,CalculatedCFType,CascadingSelectCFType,LabelsCFType
@PublicSpi
public abstract class AbstractCustomFieldType<T,S>
extends Object
implements CustomFieldType<T,S>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceVisitor interface for AbstractCustomFieldType.static interfaceMarker interface for visitors of AbstractCustomFieldType (acyclic visitor). -
Field Summary
Fields inherited from interface com.atlassian.jira.issue.customfields.CustomFieldType
DEFAULT_VALUE_TYPE, RESOURCE_PREVIEW -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidassertObjectImplementsType(Class<?> clazz, Object o) availableForBulkEdit(BulkEditBean bulkEditBean) Allow the custom field type perform a specific check as to its availability for bulk editing.getChangelogString(CustomField field, T value) Returns a String of representing values to be stored in the change log, an example is the name of a version field that a version id will resolve to within JIRA.Returns a List ofFieldConfigItemTypeobjects.final Stringprotected I18nHelperfinal StringgetKey()Returns the full key of the CustomFieldType.final StringgetName()getRelatedIndexers(CustomField customField) Returns a list of indexers that will be used for the field.final MapgetVelocityParameters(Issue issue) Implementers should override the 3-param version of this.getVelocityParameters(Issue issue, CustomField field, FieldLayoutItem fieldLayoutItem) The custom field may wish to pass parameters to the velocity context beyond the getValueFromIssue methods (eg managers).voidinit(CustomFieldTypeModuleDescriptor descriptor) Initialises the CustomFieldType with the given descriptor.booleanThis is a mirror of the method from the RenderableField interface and is needed to bridge the gap between CustomFields and CustomFieldTypes.booleanvaluesEqual(T v1, T v2) Used to compare 2 field values and work out whether a change item should be generatedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.jira.issue.customfields.CustomFieldType
areAllRequiredParametersPresent, createValue, getChangelogValue, getCloneOptionConfiguration, getCloneValue, getDefaultValue, getIndexers, getNonNullCustomFieldProvider, getSingularObjectFromString, getStringFromSingularObject, getStringValueFromCustomFieldParams, getValueFromCustomFieldParams, getValueFromIssue, isUserInputRequiredForMove, remove, requiresAdditionalParams, setDefaultValue, updateValue, validateFromParams
-
Constructor Details
-
AbstractCustomFieldType
public AbstractCustomFieldType()
-
-
Method Details
-
init
Description copied from interface:CustomFieldTypeInitialises the CustomFieldType with the given descriptor.- Specified by:
initin interfaceCustomFieldType<T,S> - Parameters:
descriptor- CustomFieldTypeModuleDescriptor
-
getKey
Description copied from interface:CustomFieldTypeReturns the full key of the CustomFieldType. Typically, this will be prefixed with "com.atlassian.jira.plugin.system.customfieldtypes:"- Specified by:
getKeyin interfaceCustomFieldType<T,S> - Returns:
- CustomFieldType Key prefixed with the Package
-
getName
- Specified by:
getNamein interfaceCustomFieldType<T,S>
-
getDescription
- Specified by:
getDescriptionin interfaceCustomFieldType<T,S>
-
getDescriptor
- Specified by:
getDescriptorin interfaceCustomFieldType<T,S>
-
getVelocityParameters
@Nonnull public Map<String,Object> getVelocityParameters(Issue issue, CustomField field, FieldLayoutItem fieldLayoutItem) Description copied from interface:CustomFieldTypeThe custom field may wish to pass parameters to the velocity context beyond the getValueFromIssue methods (eg managers).The values are added to the context for all velocity views (edit, search, view, xml)
- Specified by:
getVelocityParametersin interfaceCustomFieldType<T,S> - Parameters:
issue- The issue currently in context (Note: this will be null in cases like 'default value')field- CustomFieldfieldLayoutItem- FieldLayoutItem- Returns:
- A
Mapof parameters to add to the velocity context, or an empty Map otherwise (never null)
-
getVelocityParameters
Implementers should override the 3-param version of this. We want to make attempts to use this version a compile error so plugin developers must add the extra params. -
getConfigurationItemTypes
Description copied from interface:CustomFieldTypeReturns a List ofFieldConfigItemTypeobjects. Can not be immutable. This opens up possibilities for configurable custom fields.- Specified by:
getConfigurationItemTypesin interfaceCustomFieldType<T,S> - Returns:
- List of
FieldConfigItemType
-
getRelatedIndexers
Description copied from interface:CustomFieldTypeReturns a list of indexers that will be used for the field.- Specified by:
getRelatedIndexersin interfaceCustomFieldType<T,S> - Parameters:
customField- the custom field to get the related indexers of.- Returns:
- List of instantiated and initialised
FieldIndexerobjects. Null if no related indexers.
-
isRenderable
public boolean isRenderable()Description copied from interface:CustomFieldTypeThis is a mirror of the method from the RenderableField interface and is needed to bridge the gap between CustomFields and CustomFieldTypes.- Specified by:
isRenderablein interfaceCustomFieldType<T,S> - Returns:
- true if the field is configurable for use with the renderers, a text based field, false otherwise.
-
valuesEqual
Description copied from interface:CustomFieldTypeUsed to compare 2 field values and work out whether a change item should be generated- Specified by:
valuesEqualin interfaceCustomFieldType<T,S> - Parameters:
v1- current valuev2- new value- Returns:
- true if the change item should be generated, false otherwise
-
getChangelogString
Description copied from interface:CustomFieldTypeReturns a String of representing values to be stored in the change log, an example is the name of a version field that a version id will resolve to within JIRA.- Specified by:
getChangelogStringin interfaceCustomFieldType<T,S> - Parameters:
field- CustomField that the value belongs tovalue- Transport Object representing the value instance of the CustomField- Returns:
- Change log string.
-
assertObjectImplementsType
-
availableForBulkEdit
Description copied from interface:CustomFieldTypeAllow the custom field type perform a specific check as to its availability for bulk editing.- Specified by:
availableForBulkEditin interfaceCustomFieldType<T,S> - Parameters:
bulkEditBean- BulkEditBean- Returns:
- null if available for bulk edit or appropriate unavailable message
-
getI18nBean
-
accept
-