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.DateCFType

Class Overview

Custom Field to allow setting of a Date

Transport Object Type
Date
Database Storage Type
Timestamp

Summary

Nested Classes
interface DateCFType.Visitor<T>  
[Expand]
Inherited Constants
From class com.atlassian.jira.issue.customfields.impl.AbstractSingleFieldType
From interface com.atlassian.jira.issue.customfields.CustomFieldType
Fields
protected final DatePickerConverter dateConverter
[Expand]
Inherited Fields
From class com.atlassian.jira.issue.customfields.impl.AbstractSingleFieldType
Public Constructors
DateCFType(CustomFieldValuePersister customFieldValuePersister, DatePickerConverter dateConverter, GenericConfigManager genericConfigManager, DateTimeFieldChangeLogHelper dateTimeFieldChangeLogHelper, DateFieldFormat dateFieldFormat, DateTimeFormatterFactory dateTimeFormatterFactory)
Public Methods
Object accept(VisitorBase visitor)
int compare(Date v1, Date v2, FieldConfig fieldConfig)
String getChangelogString(CustomField field, Date 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.
String getChangelogValue(CustomField field, Date value)
Date getDefaultValue(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.
String getNow()
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.
Date getSingularObjectFromString(String string)
String getStringFromSingularObject(Date customFieldObject)
@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).
boolean isUseNow(Date date)
boolean isUseNow(FieldConfig fieldConfig)
Protected Methods
@Nonnull PersistenceFieldType getDatabaseType()
Type of database field needed to store this field.
Object getDbValueFromObject(Date customFieldObject)
Returns the database representation of the Java object as stored for that CustomField.
Date 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

Fields

protected final DatePickerConverter dateConverter

Public Constructors

public DateCFType (CustomFieldValuePersister customFieldValuePersister, DatePickerConverter dateConverter, GenericConfigManager genericConfigManager, DateTimeFieldChangeLogHelper dateTimeFieldChangeLogHelper, DateFieldFormat dateFieldFormat, DateTimeFormatterFactory dateTimeFormatterFactory)

Public Methods

public Object accept (VisitorBase visitor)

public int compare (Date v1, Date v2, FieldConfig fieldConfig)

public String getChangelogString (CustomField field, Date 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.

public String getChangelogValue (CustomField field, Date value)

public Date getDefaultValue (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 String getNow ()

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 Date getSingularObjectFromString (String string)

public String getStringFromSingularObject (Date customFieldObject)

@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 boolean isUseNow (Date date)

public boolean isUseNow (FieldConfig fieldConfig)

Protected Methods

@Nonnull protected PersistenceFieldType getDatabaseType ()

Type of database field needed to store this field.

Returns

protected Object getDbValueFromObject (Date 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 Date 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