|
||||||||||
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.AbstractMultiSettableCFType com.atlassian.jira.issue.customfields.impl.MultiSelectCFType
public class MultiSelectCFType
Multiple Select Type
Collection
String
Field Summary | |
---|---|
static String |
COMMA_REPLACEMENT
|
Fields inherited from class com.atlassian.jira.issue.customfields.impl.AbstractMultiSettableCFType |
---|
customFieldValuePersister, genericConfigManager, optionsManager |
Fields inherited from interface com.atlassian.jira.issue.customfields.CustomFieldType |
---|
DEFAULT_VALUE_TYPE |
Constructor Summary | |
---|---|
MultiSelectCFType(OptionsManager optionsManager,
CustomFieldValuePersister valuePersister,
GenericConfigManager genericConfigManager)
|
Method Summary | |
---|---|
int |
compare(List<String> customFieldObjectValue1,
List<String> customFieldObjectValue2,
FieldConfig fieldConfig)
Compares the two custom field objects. |
void |
createValue(CustomField customField,
Issue issue,
Object value)
Create a select-list CF value for an issue |
static Collection<String> |
extractTransferObjectFromString(String value)
Parses the given comma-separated String value into a Collection. |
String |
getChangelogValue(CustomField field,
Object value)
Returns a values to be stored in the change log, example is the id of the changed item. |
List<FieldConfigItemType> |
getConfigurationItemTypes()
Returns a List of FieldConfigItemType objects. |
Object |
getDefaultValue(FieldConfig fieldConfig)
Retrieves the Object representing the default CustomField value for the Custom Field. |
Set<Long> |
getIssueIdsWithValue(CustomField field,
Option option)
Returns a Set with of Long Objects representing the issue ids that the value has been set for |
ProjectCustomFieldImporter |
getProjectImporter()
Returns the object that will perform the actual project import functions for the custom field type. |
Object |
getSingularObjectFromString(String string)
Returns a Singular Object, given the string value as passed by the presentation tier. |
String |
getStringFromSingularObject(Object singularObject)
Returns the String representation of a single value within the CustomFieldType. |
static String |
getStringFromTransferObject(Collection<String> collection)
Takes a Collection of values and creates a comma-separated String that represents this Collection. |
Object |
getStringValueFromCustomFieldParams(CustomFieldParams parameters)
Return the String value object from the CustomFieldParams. |
Object |
getValueFromCustomFieldParams(CustomFieldParams parameters)
Retrieves the Object representing the CustomField value instance from the CustomFieldParams of Strings. |
Object |
getValueFromIssue(CustomField field,
Issue issue)
Retrieves the Object representing the current CustomField value for the given issue. |
void |
removeValue(CustomField field,
Issue issue,
Option option)
|
void |
setDefaultValue(FieldConfig fieldConfig,
Object value)
Sets the default value for a Custom Field |
void |
updateValue(CustomField customField,
Issue issue,
Object value)
|
void |
validateFromParams(CustomFieldParams relevantParams,
ErrorCollection errorCollectionToAddTo,
FieldConfig config)
Ensures that the CustomFieldParams of Strings is a valid representation of the Custom Field values. |
boolean |
valuesEqual(Object v1,
Object v2)
Used to compare 2 field values and work out whether a change item should be generated |
Methods inherited from class com.atlassian.jira.issue.customfields.impl.AbstractMultiSettableCFType |
---|
getOptions, remove |
Methods inherited from class com.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType |
---|
assertObjectImplementsType, availableForBulkEdit, getChangelogString, getDescription, getDescriptor, getI18nBean, getKey, getName, getRelatedIndexers, getVelocityParameters, getVelocityParameters, init, isRenderable |
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.MultipleCustomFieldType |
---|
getOptions |
Methods inherited from interface com.atlassian.jira.issue.customfields.CustomFieldType |
---|
availableForBulkEdit, getChangelogString, getDescription, getDescriptor, getKey, getName, getRelatedIndexers, getVelocityParameters, init, isRenderable, remove |
Field Detail |
---|
public static final String COMMA_REPLACEMENT
Constructor Detail |
---|
public MultiSelectCFType(OptionsManager optionsManager, CustomFieldValuePersister valuePersister, GenericConfigManager genericConfigManager)
Method Detail |
---|
public Set<Long> getIssueIdsWithValue(CustomField field, Option option)
MultipleSettableCustomFieldType
getIssueIdsWithValue
in interface MultipleSettableCustomFieldType
field
- the CustomField to search onoption
- the Object representing a single value to search on.
public void setDefaultValue(FieldConfig fieldConfig, Object value)
CustomFieldType
setDefaultValue
in interface CustomFieldType
fieldConfig
- CustomField for which the default is being storedvalue
- Transport Object representing the value instance of the CustomFieldpublic Object getDefaultValue(FieldConfig fieldConfig)
CustomFieldType
CustomFieldType.getValueFromCustomFieldParams(com.atlassian.jira.issue.customfields.view.CustomFieldParams)
for more detailed notes.
getDefaultValue
in interface CustomFieldType
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)
public Object getValueFromCustomFieldParams(CustomFieldParams parameters) throws FieldValidationException
CustomFieldType
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)
) and Object returned from CustomFieldType.getValueFromIssue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue)
.
getValueFromCustomFieldParams
in interface CustomFieldType
parameters
- CustomFieldParams of String objects. Will contain one value for Singular field types.
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)
FieldValidationException
- if the String value fails to convert into ObjectsCustomFieldType.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 Object getStringValueFromCustomFieldParams(CustomFieldParams parameters)
CustomFieldType
getStringValueFromCustomFieldParams
in interface CustomFieldType
parameters
- - CustomFieldParams containing String values
public void validateFromParams(CustomFieldParams relevantParams, ErrorCollection errorCollectionToAddTo, FieldConfig config)
CustomFieldType
CustomFieldParams
of Strings is a valid representation of the Custom Field values.
Any errors should be added to the ErrorCollection
under the appropriate key as required.
validateFromParams
in interface CustomFieldType
relevantParams
- parameter object of StringserrorCollectionToAddTo
- errorCollection to which any erros should be added (never null)config
- FieldConfigpublic void createValue(CustomField customField, Issue issue, Object value)
createValue
in interface CustomFieldType
value
- A Collection
.public void updateValue(CustomField customField, Issue issue, Object value)
updateValue
in interface CustomFieldType
public void removeValue(CustomField field, Issue issue, Option option)
removeValue
in interface MultipleSettableCustomFieldType
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
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.getValueFromCustomFieldParams(com.atlassian.jira.issue.customfields.view.CustomFieldParams)
public String getChangelogValue(CustomField field, Object value)
CustomFieldType
getChangelogValue
in interface CustomFieldType
field
- CustomField that the value belongs tovalue
- Transport Object representing the value instance of the CustomField
public String getStringFromSingularObject(Object singularObject)
CustomFieldType
String
representation of a single value within the CustomFieldType. This is the value that
will is passed to the presentation tier for editing. For single CustomFieldTypes the Singular Object is
the same as a Transport Object. However, for multi-dimensional CustomFieldTypes, the Singular Object is
the Object contained within the Collection
or CustomFieldParams
getStringFromSingularObject
in interface CustomFieldType
singularObject
- the object
public Object getSingularObjectFromString(String string) throws FieldValidationException
CustomFieldType
getSingularObjectFromString
in interface CustomFieldType
string
- the String
FieldValidationException
- if the string is an invalid representation of the Object.public List<FieldConfigItemType> getConfigurationItemTypes()
CustomFieldType
FieldConfigItemType
objects.
This opens up possibilties for configurable custom fields
getConfigurationItemTypes
in interface CustomFieldType
getConfigurationItemTypes
in class AbstractCustomFieldType
FieldConfigItemType
public int compare(List<String> customFieldObjectValue1, List<String> customFieldObjectValue2, FieldConfig fieldConfig)
SortableCustomField
compare
in interface SortableCustomField<List<String>>
customFieldObjectValue1
- Never nullcustomFieldObjectValue2
- Never null
public ProjectCustomFieldImporter getProjectImporter()
ProjectImportableCustomField
getProjectImporter
in interface ProjectImportableCustomField
public static Collection<String> extractTransferObjectFromString(String value)
"red, white\, and blue"
would produce two tokens in its list:
value
- The comma-separated input String.
getStringFromTransferObject(java.util.Collection)
public static String getStringFromTransferObject(Collection<String> collection)
If any items in the collection include literal commas, then these commas are escaped with a prepended backslash. eg a list that looks like:
collection
-
public boolean valuesEqual(Object v1, Object v2)
CustomFieldType
valuesEqual
in interface CustomFieldType
valuesEqual
in class AbstractCustomFieldType
v1
- current valuev2
- new value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |