|
||||||||||
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<Collection<S>,S> com.atlassian.jira.issue.customfields.impl.AbstractMultiCFType<S>
S
- Single object contained within the Collection Transport Object@PublicSpi public abstract class AbstractMultiCFType<S>
Abstract class for Multi-select Custom field types.
Note that there is also another multi-select Custom Field for arbitrary Option
s - (MultiSelectCFType which lives in jira-core).
The Transport Object for this Custom Field type is a Collection of S, where S is defined by the subclass
Data is stored in the database a representations of a single S. E.g. A Custom Field that stores multiple Users,
will have each user saved seperately as an Object defined by convertTypeToDbValue(S)
See the javadoc of CustomFieldType.updateValue(com.atlassian.jira.issue.fields.CustomField,com.atlassian.jira.issue.Issue,Object)
,
CustomFieldType.createValue(com.atlassian.jira.issue.fields.CustomField,com.atlassian.jira.issue.Issue,Object)
, and
CustomFieldType.setDefaultValue(com.atlassian.jira.issue.fields.config.FieldConfig,Object)
for instance.
CustomFieldType
Nested Class Summary | |
---|---|
static interface |
AbstractMultiCFType.Visitor<X>
|
Nested classes/interfaces inherited from class com.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType |
---|
AbstractCustomFieldType.VisitorBase<X> |
Field Summary | |
---|---|
protected CustomFieldValuePersister |
customFieldValuePersister
|
protected GenericConfigManager |
genericConfigManager
|
Fields inherited from interface com.atlassian.jira.issue.customfields.CustomFieldType |
---|
DEFAULT_VALUE_TYPE |
Constructor Summary | |
---|---|
protected |
AbstractMultiCFType(CustomFieldValuePersister customFieldValuePersister,
GenericConfigManager genericConfigManager)
|
Method Summary | |
---|---|
Object |
accept(AbstractCustomFieldType.VisitorBase visitor)
|
protected Collection<S> |
convertDbObjectToTypes(Collection<Object> dbObjects)
Converts a collection of objects representing the underlying type to a collection of underlying types. |
protected abstract S |
convertDbValueToType(Object dbValue)
Converts a given db value to Single form of Transport Object |
protected Collection<Object> |
convertTypesToDbObjects(Collection<S> typedList)
Converts a collection of underlying types to a collection of db representations of underlying type. |
protected abstract Object |
convertTypeToDbValue(S value)
Converts a given underlying type to its db storage value. |
void |
createValue(CustomField customField,
Issue issue,
Collection<S> value)
Create a multi-select value for an issue. |
String |
getChangelogValue(CustomField field,
Collection<S> values)
Returns a string representation of the value if not null. |
protected abstract PersistenceFieldType |
getDatabaseType()
Type of database field needed to store this field. |
Collection<S> |
getDefaultValue(FieldConfig fieldConfig)
Retrieves the Object representing the default CustomField value for the Custom Field. |
protected abstract Comparator<S> |
getTypeComparator()
Returns a comparator for underlying type of this custom field. |
Collection<S> |
getValueFromIssue(CustomField field,
Issue issue)
Retrieves the Transport Object representing the current CustomField value for the given issue. |
Set<Long> |
remove(CustomField field)
called when removing a field. |
void |
setDefaultValue(FieldConfig fieldConfig,
Collection<S> value)
Sets the default value for a Custom Field. |
void |
updateValue(CustomField customField,
Issue issue,
Collection<S> value)
Update a multi-select value for an issue. |
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 |
---|
getSingularObjectFromString, getStringFromSingularObject, getStringValueFromCustomFieldParams, getValueFromCustomFieldParams, validateFromParams |
Field Detail |
---|
protected final CustomFieldValuePersister customFieldValuePersister
protected final GenericConfigManager genericConfigManager
Constructor Detail |
---|
protected AbstractMultiCFType(CustomFieldValuePersister customFieldValuePersister, GenericConfigManager genericConfigManager)
Method Detail |
---|
@Nullable protected abstract Comparator<S> getTypeComparator()
@Nullable protected abstract Object convertTypeToDbValue(@Nullable S value)
PersistenceFieldType
returned by getDatabaseType()
value
- Single form of Transport Object
@Nullable protected abstract S convertDbValueToType(@Nullable Object dbValue)
dbValue
- db representation as returned by convertTypeToDbValue(Object)
@NotNull protected abstract PersistenceFieldType getDatabaseType()
PersistenceFieldType
types.public Collection<S> getDefaultValue(FieldConfig fieldConfig)
CustomFieldType
fieldConfig
- CustomField for default value
CustomFieldType.getDefaultValue(com.atlassian.jira.issue.fields.config.FieldConfig)
public void setDefaultValue(FieldConfig fieldConfig, Collection<S> value)
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, Collection<S> value)
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, Collection<S> value)
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 Collection<S> getValueFromIssue(CustomField field, Issue issue)
CustomFieldType
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, T)
, CustomFieldType.updateValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, T)
CustomFieldType.getValueFromIssue(com.atlassian.jira.issue.fields.CustomField,com.atlassian.jira.issue.Issue)
public String getChangelogValue(CustomField field, Collection<S> values)
field
- not usedvalues
- value to create a change log for
protected final Collection<Object> convertTypesToDbObjects(Collection<S> 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<S> convertDbObjectToTypes(Collection<Object> dbObjects)
dbObjects
- collection of db representations of types.
public Set<Long> remove(CustomField field)
field
- The custom field that is being removed, so any data stored for
any issues for that field can be deleted.
Set
of issue ids that has been affectedpublic Object accept(AbstractCustomFieldType.VisitorBase visitor)
accept
in class AbstractCustomFieldType<Collection<S>,S>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |