com.atlassian.jira.issue.customfields.impl
Class AbstractMultiCFType

java.lang.Object
  extended bycom.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType
      extended bycom.atlassian.jira.issue.customfields.impl.AbstractSingleFieldType
          extended bycom.atlassian.jira.issue.customfields.impl.StringCFType
              extended bycom.atlassian.jira.issue.customfields.impl.TextCFType
                  extended bycom.atlassian.jira.issue.customfields.impl.AbstractMultiCFType
All Implemented Interfaces:
CustomFieldType, SortableCustomField
Direct Known Subclasses:
MultiGroupCFType, MultiUserCFType

public abstract class AbstractMultiCFType
extends TextCFType


Field Summary
 
Fields inherited from class com.atlassian.jira.issue.customfields.impl.AbstractSingleFieldType
customFieldValuePersister, FIELD_TYPE_DATE, FIELD_TYPE_NUMBER, FIELD_TYPE_STRING, FIELD_TYPE_TEXT, genericConfigManager, log
 
Fields inherited from interface com.atlassian.jira.issue.customfields.CustomFieldType
DEFAULT_VALUE_TYPE
 
Constructor Summary
AbstractMultiCFType(CustomFieldValuePersister customFieldValuePersister, StringConverter stringConverter, GenericConfigManager genericConfigManager)
          Overriden, calls super constructor.
 
Method Summary
protected  Collection convertStringsToTypes(Collection strings)
          Converts a collection of string representations of underlying type to a collection of underlying types.
protected abstract  Object convertStringToType(String string)
          Converts a given String to underlying type
protected  Collection convertTypesToStrings(Collection typedList)
          Converts a collection of underlying types to a collection of string representations of underlying type.
protected abstract  String convertTypeToString(Object value)
          Converts a given underlying type to String.
 void createValue(CustomField customField, Issue issue, Object value)
          Create a CF value for an issue.
 String getChangelogValue(CustomField field, Object value)
          Returns a string representation of the value if not null.
 Object getDefaultValue(FieldConfig fieldConfig)
          Retrieves the Object representing the default CustomField value for the Custom Field.
protected abstract  Comparator getTypeComparator()
          Returns a comparator for underlying type of this custom field.
 Object getValueFromIssue(CustomField field, Issue issue)
          Retrieves the Object representing the current CustomField value for the given issue.
 void setDefaultValue(FieldConfig fieldConfig, Object value)
          Sets the default value for a Custom Field
 void updateValue(CustomField customField, Issue issue, Object value)
          the value does exist, and the new value is different than the existing one.
 
Methods inherited from class com.atlassian.jira.issue.customfields.impl.TextCFType
compare, getDatabaseType, getSingularObjectFromString, getStringFromSingularObject
 
Methods inherited from class com.atlassian.jira.issue.customfields.impl.StringCFType
getDbValueFromObject, getObjectFromDbValue, makeSearchParameter
 
Methods inherited from class com.atlassian.jira.issue.customfields.impl.AbstractSingleFieldType
getStringValueFromCustomFieldParams, getValueFromCustomFieldParams, remove, validateFromParams
 
Methods inherited from class com.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType
assertObjectImplementsType, availableForBulkEdit, getChangelogString, getConfigurationItemTypes, getDescription, getDescriptor, getI18nBean, getKey, getName, getRelatedIndexers, getVelocityParameters, getVelocityParameters, init, isRenderable, valuesEqual
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMultiCFType

public AbstractMultiCFType(CustomFieldValuePersister customFieldValuePersister,
                           StringConverter stringConverter,
                           GenericConfigManager genericConfigManager)
Overriden, calls super constructor.

Method Detail

getTypeComparator

protected abstract Comparator getTypeComparator()
Returns a comparator for underlying type of this custom field.

Returns:
a comparator

convertTypeToString

protected abstract String convertTypeToString(Object value)
Converts a given underlying type to String.

Parameters:
value - underlying type
Returns:
string representation of underlying type

convertStringToType

protected abstract Object convertStringToType(String string)
Converts a given String to underlying type

Parameters:
string - string representation of underlying type
Returns:
underlying type

getDefaultValue

public Object getDefaultValue(FieldConfig fieldConfig)
Description copied from interface: CustomFieldType
Retrieves the Object representing the default CustomField value for the Custom Field. See CustomFieldType.getValueFromCustomFieldParams(com.atlassian.jira.issue.customfields.view.CustomFieldParams) for more detailed notes.

Specified by:
getDefaultValue in interface CustomFieldType
Overrides:
getDefaultValue in class AbstractSingleFieldType
See Also:
CustomFieldType.getDefaultValue(com.atlassian.jira.issue.fields.config.FieldConfig)

setDefaultValue

public void setDefaultValue(FieldConfig fieldConfig,
                            Object value)
Description copied from interface: CustomFieldType
Sets the default value for a Custom Field

Specified by:
setDefaultValue in interface CustomFieldType
Overrides:
setDefaultValue in class AbstractSingleFieldType
See Also:
CustomFieldType.setDefaultValue(com.atlassian.jira.issue.fields.config.FieldConfig, Object)

createValue

public void createValue(CustomField customField,
                        Issue issue,
                        Object value)
Create a CF value for an issue.

Specified by:
createValue in interface CustomFieldType
Overrides:
createValue in class AbstractSingleFieldType
Parameters:
value - A Collection of Users.

updateValue

public void updateValue(CustomField customField,
                        Issue issue,
                        Object value)
Description copied from class: AbstractSingleFieldType
the value does exist, and the new value is different than the existing one.

Specified by:
updateValue in interface CustomFieldType
Overrides:
updateValue in class AbstractSingleFieldType
See Also:
CustomFieldType.updateValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, Object)

getValueFromIssue

public Object getValueFromIssue(CustomField field,
                                Issue issue)
Description copied from interface: CustomFieldType
Retrieves the Object representing the current CustomField value for the given issue. See CustomFieldType.getValueFromCustomFieldParams(com.atlassian.jira.issue.customfields.view.CustomFieldParams) for more detailed notes.

Specified by:
getValueFromIssue in interface CustomFieldType
Overrides:
getValueFromIssue in class AbstractSingleFieldType
See Also:
CustomFieldType.getValueFromIssue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue)

getChangelogValue

public String getChangelogValue(CustomField field,
                                Object value)
Returns a string representation of the value if not null.

Specified by:
getChangelogValue in interface CustomFieldType
Overrides:
getChangelogValue in class AbstractSingleFieldType
Parameters:
field - not used
value - value to create a change log for
Returns:
string representaion of value if not null, empty string otherwise

convertTypesToStrings

protected final Collection convertTypesToStrings(Collection typedList)
Converts a collection of underlying types to a collection of string representations of underlying type. Returns null when typedList is null.

Parameters:
typedList - a collection of underlying types
Returns:
a collection of string representations of underlying type

convertStringsToTypes

protected final Collection convertStringsToTypes(Collection strings)
Converts a collection of string representations of underlying type to a collection of underlying types. Returns null when given strings collection is null.

Parameters:
strings - a collection of string representations of underlying type
Returns:
a collection of underlying types


Copyright © 2002-2006 Atlassian. All Rights Reserved.