@PublicSpi public abstract class

AbstractCustomFieldType

extends Object
implements CustomFieldType<T, S>
java.lang.Object
   ↳ com.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType<T, S>
Known Direct Subclasses
Known Indirect 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

Nested Classes
interface AbstractCustomFieldType.Visitor<X> Visitor interface for AbstractCustomFieldType. 
interface AbstractCustomFieldType.VisitorBase<X> Marker interface for visitors of AbstractCustomFieldType (acyclic visitor). 
[Expand]
Inherited Constants
From interface com.atlassian.jira.issue.customfields.CustomFieldType
Public Constructors
AbstractCustomFieldType()
Public Methods
Object accept(VisitorBase visitor)
String availableForBulkEdit(BulkEditBean bulkEditBean)
Allow the custom field type perform a specific check as to its availability for bulk editing.
String 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.
@Nonnull List<FieldConfigItemType> getConfigurationItemTypes()
Returns a List of FieldConfigItemType objects.
final String getDescription()
final CustomFieldTypeModuleDescriptor getDescriptor()
final String getKey()
Returns the full key of the CustomFieldType.
final String getName()
List<FieldIndexer> getRelatedIndexers(CustomField customField)
Returns a list of indexers that will be used for the field.
@Nonnull Map<StringObject> 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).
final Map getVelocityParameters(Issue issue)
Implementers should override the 3-param version of this.
void init(CustomFieldTypeModuleDescriptor descriptor)
Initialises the CustomFieldType with the given descriptor.
boolean isRenderable()
This is a mirror of the method from the RenderableField interface and is needed to bridge the gap between CustomFields and CustomFieldTypes.
boolean valuesEqual(T v1, T v2)
Used to compare 2 field values and work out whether a change item should be generated
Protected Methods
void assertObjectImplementsType(Class<?> clazz, Object o)
I18nHelper getI18nBean()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.issue.customfields.CustomFieldType

Public Constructors

public AbstractCustomFieldType ()

Public Methods

public Object accept (VisitorBase visitor)

public String availableForBulkEdit (BulkEditBean bulkEditBean)

Allow the custom field type perform a specific check as to its availability for bulk editing.

Parameters
bulkEditBean BulkEditBean
Returns
  • null if available for bulk edit or appropriate unavailable message

public String 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.

Parameters
field CustomField that the value belongs to
value Transport Object representing the value instance of the CustomField
Returns
  • Change log string.

@Nonnull public List<FieldConfigItemType> getConfigurationItemTypes ()

Returns a List of FieldConfigItemType objects. Can not be immutable. This opens up possibilities for configurable custom fields.

Returns

public final String getDescription ()

public final CustomFieldTypeModuleDescriptor getDescriptor ()

public final String getKey ()

Returns the full key of the CustomFieldType. Typically, this will be prefixed with "com.atlassian.jira.plugin.system.customfieldtypes:"

Returns
  • CustomFieldType Key prefixed with the Package

public final String getName ()

public List<FieldIndexer> getRelatedIndexers (CustomField customField)

Returns a list of indexers that will be used for the field.

Parameters
customField the custom field to get the related indexers of.
Returns
  • List of instantiated and initialised FieldIndexer objects. Null if no related indexers.

@Nonnull public Map<StringObject> 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).

The values are added to the context for all velocity views (edit, search, view, xml)

Parameters
issue The issue currently in context (Note: this will be null in cases like 'default value')
field CustomField
fieldLayoutItem FieldLayoutItem
Returns
  • A Map of parameters to add to the velocity context, or an empty Map otherwise (never null)

public final Map getVelocityParameters (Issue issue)

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.

public void init (CustomFieldTypeModuleDescriptor descriptor)

Initialises the CustomFieldType with the given descriptor.

Parameters
descriptor CustomFieldTypeModuleDescriptor

public boolean isRenderable ()

This is a mirror of the method from the RenderableField interface and is needed to bridge the gap between CustomFields and CustomFieldTypes.

Returns
  • true if the field is configurable for use with the renderers, a text based field, false otherwise.

public boolean valuesEqual (T v1, T v2)

Used to compare 2 field values and work out whether a change item should be generated

Parameters
v1 current value
v2 new value
Returns
  • true if the change item should be generated, false otherwise

Protected Methods

protected void assertObjectImplementsType (Class<?> clazz, Object o)

protected I18nHelper getI18nBean ()