java.lang.Object
   ↳ com.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType<T, S>
     ↳ com.atlassian.jira.issue.customfields.impl.AbstractSingleFieldType<T>
       ↳ com.atlassian.jira.issue.customfields.impl.GenericTextCFType
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).

Class Overview

A CustomFieldType where data is stored and displayed as a single String By default it will only have a Limited Text Field for storage (if you need bigger override getDatabaseType())

Transport Object Type
String
Database Storage Type
String

Summary

Nested Classes
interface GenericTextCFType.Visitor<T>  
[Expand]
Inherited Constants
From class com.atlassian.jira.issue.customfields.impl.AbstractSingleFieldType
From interface com.atlassian.jira.issue.customfields.CustomFieldType
[Expand]
Inherited Fields
From class com.atlassian.jira.issue.customfields.impl.AbstractSingleFieldType
Protected Constructors
GenericTextCFType(CustomFieldValuePersister customFieldValuePersister, GenericConfigManager genericConfigManager)
Public Methods
Object accept(VisitorBase visitor)
int compare(String customFieldObjectValue1, String customFieldObjectValue2, FieldConfig fieldConfig)
FieldTypeInfo getFieldTypeInfo(FieldTypeInfoContext fieldTypeInfoContext)
Returns lower level Information about the field.
FieldJsonRepresentation getJsonFromIssue(CustomField field, Issue issue, boolean renderedVersionRequested, FieldLayoutItem fieldLayoutItem)
Return a JsonData representation of the field value
JsonType getJsonSchema(CustomField customField)
Return a description of the shape of this field when represented as JSON.
ProjectCustomFieldImporter getProjectImporter()
Returns the object that will perform the actual project import functions for the custom field type.
RestFieldOperationsHandler getRestFieldOperation(CustomField field)
Returns the RestFieldOperationsHandler for this field.
String getSingularObjectFromString(String string)
String getStringFromSingularObject(String value)
Protected Methods
@Nonnull PersistenceFieldType getDatabaseType()
Type of database field needed to store this field.
Object getDbValueFromObject(String customFieldObject)
Returns the database representation of the Java object as stored for that CustomField.
String getObjectFromDbValue(Object databaseValue)
Returns the Transport Object for the given Custom Field value as represented by the value stored in the database
[Expand]
Inherited Methods
From class com.atlassian.jira.issue.customfields.impl.AbstractSingleFieldType
From class com.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType
From class java.lang.Object
From interface com.atlassian.jira.imports.project.customfield.ProjectImportableCustomField
From interface com.atlassian.jira.issue.customfields.CustomFieldType
From interface com.atlassian.jira.issue.customfields.SortableCustomField
From interface com.atlassian.jira.issue.fields.rest.RestAwareCustomFieldType
From interface com.atlassian.jira.issue.fields.rest.RestCustomFieldTypeOperations

Protected Constructors

protected GenericTextCFType (CustomFieldValuePersister customFieldValuePersister, GenericConfigManager genericConfigManager)

Public Methods

public Object accept (VisitorBase visitor)

public int compare (String customFieldObjectValue1, String customFieldObjectValue2, FieldConfig fieldConfig)

public FieldTypeInfo getFieldTypeInfo (FieldTypeInfoContext fieldTypeInfoContext)

Returns lower level Information about the field. This information contains allowed values and/or the autocomplete url

Parameters
fieldTypeInfoContext context information for generating the FieldTypeInfo.
Returns
  • Low level information about the field.

public FieldJsonRepresentation getJsonFromIssue (CustomField field, Issue issue, boolean renderedVersionRequested, FieldLayoutItem fieldLayoutItem)

Return a JsonData representation of the field value

Parameters
field configuration of the current field
issue to get field data from
renderedVersionRequested whether the use requested the return of rendered/pretty data as well as raw data
fieldLayoutItem field layout for this field.
Returns
  • FieldJsonDataPair containing a json representation of the raw data for this field, and if required, a json representation of the rendered data for easy display.

public JsonType getJsonSchema (CustomField customField)

Return a description of the shape of this field when represented as JSON.

public ProjectCustomFieldImporter getProjectImporter ()

Returns the object that will perform the actual project import functions for the custom field type.

Returns
  • the object that will perform the actual project import functions for the custom field type.

public RestFieldOperationsHandler getRestFieldOperation (CustomField field)

Returns the RestFieldOperationsHandler for this field.

Parameters
field the Custom Field
Returns
  • the RestFieldOperationsHandler for this field.

public String getSingularObjectFromString (String string)

public String getStringFromSingularObject (String value)

Protected Methods

@Nonnull protected PersistenceFieldType getDatabaseType ()

Type of database field needed to store this field.

Returns

protected Object getDbValueFromObject (String customFieldObject)

Returns the database representation of the Java object as stored for that CustomField. (eg. ProjectId if the Value represents a project). Must be compatable with type returned by getDatabaseType()

Parameters
customFieldObject the Transport Object
Returns
  • String, Double or Date

protected String getObjectFromDbValue (Object databaseValue)

Returns the Transport Object for the given Custom Field value as represented by the value stored in the database

Parameters
databaseValue - String, Double or Date objects as returned from getDbValueFromObject(Object)
Returns
  • Domain object or GenericValue