|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType com.atlassian.jira.issue.customfields.impl.AbstractSingleFieldType com.atlassian.jira.issue.customfields.impl.StringCFType com.atlassian.jira.issue.customfields.impl.TextCFType com.atlassian.jira.issue.customfields.impl.AbstractMultiCFType
public abstract class AbstractMultiCFType
Abstract class for Multi-select Custom field types for either Users or Groups. Note that there is also another multi-select Custom Field for arbitrary options - MultiSelectCFType.
The Transport Object for this Custom Field type is a Collection of Users or Collection of Groups;
depending on the subclass.
Some of these methods will also accept a Collection of String as an input parameter.
See the javadoc of updateValue(com.atlassian.jira.issue.fields.CustomField,com.atlassian.jira.issue.Issue,Object)
,
createValue(com.atlassian.jira.issue.fields.CustomField,com.atlassian.jira.issue.Issue,Object)
, and
setDefaultValue(com.atlassian.jira.issue.fields.config.FieldConfig,Object)
for instance.
CustomFieldType
,
MultiSelectCFType
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 |
convertTypesToStringsIfRequired(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 multi-select 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)
Update a multi-select value for an issue. |
Methods inherited from class com.atlassian.jira.issue.customfields.impl.TextCFType |
---|
compare, getDatabaseType, getProjectImporter, 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 |
Methods inherited from interface com.atlassian.jira.issue.customfields.CustomFieldType |
---|
availableForBulkEdit, getChangelogString, getConfigurationItemTypes, getDescription, getDescriptor, getKey, getName, getRelatedIndexers, getSingularObjectFromString, getStringFromSingularObject, getStringValueFromCustomFieldParams, getValueFromCustomFieldParams, getVelocityParameters, init, isRenderable, remove, validateFromParams, valuesEqual |
Constructor Detail |
---|
public AbstractMultiCFType(CustomFieldValuePersister customFieldValuePersister, StringConverter stringConverter, GenericConfigManager genericConfigManager)
Method Detail |
---|
protected abstract Comparator getTypeComparator()
protected abstract String convertTypeToString(Object value)
value
- underlying type
protected abstract Object convertStringToType(String string)
string
- string representation of underlying type
public Object getDefaultValue(FieldConfig fieldConfig)
CustomFieldType
CustomFieldType.getValueFromCustomFieldParams(com.atlassian.jira.issue.customfields.view.CustomFieldParams)
for more detailed notes.
getDefaultValue
in interface CustomFieldType
getDefaultValue
in class AbstractSingleFieldType
fieldConfig
- CustomField for default value
CustomFieldType.createValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, java.lang.Object)
, CustomFieldType.updateValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, java.lang.Object)
CustomFieldType.getDefaultValue(com.atlassian.jira.issue.fields.config.FieldConfig)
public void setDefaultValue(FieldConfig fieldConfig, Object value)
The Transport Object for parameter value can be either a Collection of the underlying type (User or Group), or a Collection of String.
setDefaultValue
in interface CustomFieldType
setDefaultValue
in class AbstractSingleFieldType
fieldConfig
- CustomField for which the default is being storedvalue
- Transport Object representing the value instance of the CustomField.CustomFieldType.setDefaultValue(com.atlassian.jira.issue.fields.config.FieldConfig,Object)
public void createValue(CustomField customField, Issue issue, Object value)
The Transport Object for parameter value can be either a Collection of the underlying type (User or Group), or a Collection of String.
createValue
in interface CustomFieldType
createValue
in class AbstractSingleFieldType
customField
- CustomField
for which the value is being storedissue
- The Issue
.value
- Transport Object representing the value instance of the CustomField.CustomFieldType.createValue(com.atlassian.jira.issue.fields.CustomField,com.atlassian.jira.issue.Issue,Object)
public void updateValue(CustomField customField, Issue issue, Object value)
The Transport Object for parameter value can be either a Collection of the underlying type (User or Group), or a Collection of String.
updateValue
in interface CustomFieldType
updateValue
in class AbstractSingleFieldType
customField
- CustomField
for which the value is being storedissue
- The Issue
.value
- Transport Object representing the value instance of the CustomField.CustomFieldType.updateValue(com.atlassian.jira.issue.fields.CustomField,com.atlassian.jira.issue.Issue,Object)
public Object getValueFromIssue(CustomField field, Issue issue)
CustomFieldType
CustomFieldType.getValueFromCustomFieldParams(com.atlassian.jira.issue.customfields.view.CustomFieldParams)
for more detailed notes.
getValueFromIssue
in interface CustomFieldType
getValueFromIssue
in class AbstractSingleFieldType
field
- Custom field for which to retrieve the valueissue
- Issue from which to retrieve the value
CustomFieldType.createValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, java.lang.Object)
, CustomFieldType.updateValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, java.lang.Object)
CustomFieldType.getValueFromIssue(com.atlassian.jira.issue.fields.CustomField,com.atlassian.jira.issue.Issue)
public String getChangelogValue(CustomField field, Object value)
getChangelogValue
in interface CustomFieldType
getChangelogValue
in class AbstractSingleFieldType
field
- not usedvalue
- value to create a change log for
protected final Collection convertTypesToStringsIfRequired(Collection typedList)
If a Collection of String is passed, then a new Collection is still created, containing the original String values.
typedList
- a collection of underlying types
protected final Collection convertStringsToTypes(Collection strings)
strings
- a collection of string representations of underlying type
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |