com.atlassian.jira.issue.customfields.CustomFieldType<T, S> |
Known Indirect Subclasses
AbstractCustomFieldType<T, S>,
AbstractMultiCFType<S>,
AbstractMultiSettableCFType<T, S>,
AbstractSingleFieldType<T>,
CalculatedCFType<T, S>,
CascadingSelectCFType,
DateCFType,
DateTimeCFType,
GenericTextCFType,
ImportIdLinkCFType,
LabelsCFType,
MockCustomFieldType,
MultiGroupCFType,
MultiSelectCFType,
MultiUserCFType,
and
13 others.
|
Clients of @PublicApi
can expect
that programs compiled against a given version will remain binary compatible with later versions of the
@PublicApi
as per each product's API policy as long as the client does not implement/extend
@PublicApi
interfaces or classes (refer to each product's API policy for the exact
guarantee---usually binary compatibility is guaranteed at least across minor versions).
@PublicApi
interfaces and classes are not designed to be implemented or extended by clients,
we may perform certain types of binary-incompatible changes to these classes and interfaces, but these will not
affect well-behaved clients that do not extend/implement these types (in general, only classes and interfaces
annotated with @PublicSpi
are safe to extend/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).
@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).
This interface represents a particular type of CustomField
. It encapsulates all logic dealing with values
of a Custom Field, such as creation, update and removal of values, storage & retrieval of defaults and validation of
values.
A value instance of a custom field is represented as an Object
, from hereon in referred to as a
Transport Object. These may be of singular types (eg. Number
, String
) or
Multi-Dimensional (eg. Collection
of Strings, Map
of Date Objects, CustomFieldParams
of Option
). Most methods in the interface expect/returns Transfer Objects (e.g.
Persistence Methods (createValue(CustomField, Issue, T)
, updateValue(CustomField, Issue, T)
) and Transfer Object Getters
getValueFromIssue(CustomField, Issue)
and getValueFromCustomFieldParams(CustomFieldParams)
.
However, two special conversion methods (getSingularObjectFromString(String)
& getStringFromSingularObject(S)
) act on the Singular Object level. Thus, even when the
Transfer Object type is a Collection of Number, getSingularObjectFromString would still return a single Number
object.
Implementing classes should clearly document the exact structure of the Transport Object in the Class javadoc header. If the Transport Object is Multi-Dimensional, the type of the Singular Object should also be specified. This is especially relevant for complex custom field types (CascadingSelectCFType for example)
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | DEFAULT_VALUE_TYPE | ||||||||||
String | RESOURCE_PREVIEW | Name of the resource that can be used as a preview for the CustomField when rendering in the UI. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Allow the custom field type perform a specific check as to its availability for bulk editing.
| |||||||||||
Save the value for this Custom Field in a particular issue to the database.
| |||||||||||
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 values to be stored in the change log, example is the id of the changed item.
| |||||||||||
Returns a List of
FieldConfigItemType objects. | |||||||||||
Retrieves the Object representing the default CustomField value for the Custom Field.
| |||||||||||
Returns the full key of the CustomFieldType.
| |||||||||||
Returns a list of indexers that will be used for the field.
| |||||||||||
Returns a Singular Object, given the string value as passed by the presentation tier.
| |||||||||||
Returns the
String representation of a single value within the CustomFieldType. | |||||||||||
Return the String value object from the CustomFieldParams.
| |||||||||||
Retrieves the Transport Object representing the CustomField value instance from the CustomFieldParams of Strings.
| |||||||||||
Retrieves the Transport Object representing the current CustomField value for the given issue.
| |||||||||||
The custom field may wish to pass parameters to the velocity context beyond the getValueFromIssue methods
(eg managers).
| |||||||||||
Initialises the CustomFieldType with the given descriptor.
| |||||||||||
This is a mirror of the method from the RenderableField interface and is needed to bridge the gap between
CustomFields and CustomFieldTypes.
| |||||||||||
Performs additional tasks when an entire CustomField of this type is being removed
remove() . | |||||||||||
Sets the default value for a Custom Field
| |||||||||||
Update the value for this Custom Field in a particular issue currently stored in the database.
| |||||||||||
Ensures that the
CustomFieldParams of Strings is a valid representation of the Custom Field values. | |||||||||||
Used to compare 2 field values and work out whether a change item should be generated
|
Name of the resource that can be used as a preview for the CustomField when rendering in the UI.
Allow the custom field type perform a specific check as to its availability for bulk editing.
bulkEditBean | BulkEditBean |
---|
Save the value for this Custom Field in a particular issue to the database.
field | CustomField for which the value is being stored |
---|---|
issue | The Issue to be stored against. |
value | Transport Object representing the value instance of the CustomField.
Can not be null .
|
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.
field | CustomField that the value belongs to |
---|---|
value | Transport Object representing the value instance of the CustomField |
Returns a values to be stored in the change log, example is the id of the changed item.
field | CustomField that the value belongs to |
---|---|
value | Transport Object representing the value instance of the CustomField |
Returns a List of FieldConfigItemType
objects. Can not be immutable.
This opens up possibilities for configurable custom fields.
FieldConfigItemType
Retrieves the Object representing the default CustomField value for the Custom Field.
fieldConfig | CustomField for default value |
---|
Returns the full key of the CustomFieldType. Typically, this will be prefixed with "com.atlassian.jira.plugin.system.customfieldtypes:"
Returns a list of indexers that will be used for the field.
customField | the custom field to get the related indexers of. |
---|
FieldIndexer
objects. Null if no related indexers.
Returns a Singular Object, given the string value as passed by the presentation tier. Throws FieldValidationException if the string is an invalid representation of the Object.
string | the String |
---|
FieldValidationException | if the string is an invalid representation of the Object. |
---|
Returns the String
representation of a single value within the CustomFieldType. This is the value that
is passed to the presentation tier for editing. For single CustomFieldTypes the Singular Object is
the same as a Transport Object. However, for multi-dimensional CustomFieldTypes, the Singular Object is
the Object contained within the Collection
or Map
singularObject | the object |
---|
Return the String value object from the CustomFieldParams. The object may be a single String (e.g. TextCFType, List of Strings (e.g. MultiSelectCFType) or CustomFieldParams of Strings (e.g. CascadingSelectCFType). Among other things these values are passed to Velocity for rendering edit screens.
parameters | - CustomFieldParams containing String values |
---|
Retrieves the Transport Object representing the CustomField value instance from the CustomFieldParams of Strings.
parameters | CustomFieldParams of String objects. Will contain one value for Singular field types. |
---|
createValue(CustomField, Issue, T)
, updateValue(CustomField, Issue, T)
FieldValidationException | if the String value fails to convert into Objects |
---|
Retrieves the Transport Object representing the current CustomField value for the given issue.
field | Custom field for which to retrieve the value |
---|---|
issue | Issue from which to retrieve the value |
createValue(CustomField, Issue, T)
, updateValue(CustomField, Issue, T)
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)issue | The issue currently in context (Note: this will be null in cases like 'default value') |
---|---|
field | CustomField |
fieldLayoutItem | FieldLayoutItem |
Map
of parameters to add to the velocity context, or an empty Map otherwise (never null)
Initialises the CustomFieldType with the given descriptor.
customFieldTypeModuleDescriptor | CustomFieldTypeModuleDescriptor |
---|
This is a mirror of the method from the RenderableField interface and is needed to bridge the gap between CustomFields and CustomFieldTypes.
Performs additional tasks when an entire CustomField of this type is being removed remove()
.
This includes removal of values & options.
field | The custom field that is being removed, so any data stored for any issues for that field can be deleted. |
---|
Sets the default value for a Custom Field
fieldConfig | CustomField for which the default is being stored |
---|---|
value | Transport Object representing the value instance of the CustomField |
Update the value for this Custom Field in a particular issue currently stored in the database.
field | CustomField for which the value is being stored |
---|---|
issue | The Issue to be stored against. |
value | Transport Object representing the value instance of the CustomField. |
Ensures that the CustomFieldParams
of Strings is a valid representation of the Custom Field values.
Any errors should be added to the ErrorCollection
under the appropriate key as required.
relevantParams | parameter object of Strings |
---|---|
errorCollectionToAddTo | errorCollection to which any erros should be added (never null) |
config | FieldConfig |
Used to compare 2 field values and work out whether a change item should be generated
v1 | current value |
---|---|
v2 | new value |