|
||||||||||
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
Nested Class Summary | |
---|---|
static interface |
MultiSelectCFType.Visitor<T>
|
Nested classes/interfaces inherited from class com.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType |
---|
AbstractCustomFieldType.VisitorBase<T> |
Field Summary | |
---|---|
static java.lang.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 | |
---|---|
java.lang.Object |
accept(AbstractCustomFieldType.VisitorBase visitor)
|
int |
compare(java.util.List<java.lang.String> customFieldObjectValue1,
java.util.List<java.lang.String> customFieldObjectValue2,
FieldConfig fieldConfig)
Compares the two custom field objects. |
void |
createValue(CustomField customField,
Issue issue,
java.lang.Object value)
Create a select-list CF value for an issue |
static java.util.Collection<java.lang.String> |
extractTransferObjectFromString(java.lang.String value)
Parses the given comma-separated String value into a Collection. |
java.lang.String |
getChangelogValue(CustomField field,
java.lang.Object value)
Returns a values to be stored in the change log, example is the id of the changed item. |
java.util.List<FieldConfigItemType> |
getConfigurationItemTypes()
Returns a List of FieldConfigItemType objects. |
java.lang.Object |
getDefaultValue(FieldConfig fieldConfig)
Retrieves the Object representing the default CustomField value for the Custom Field. |
java.util.Set<java.lang.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. |
org.apache.lucene.search.Query |
getQueryForGroup(java.lang.String fieldName,
java.lang.String groupName)
This method should be implemented in your custom type to return a Query. |
java.lang.Object |
getSingularObjectFromString(java.lang.String string)
Returns a Singular Object, given the string value as passed by the presentation tier. |
java.lang.String |
getStringFromSingularObject(java.lang.Object singularObject)
Returns the String representation of a single value within the CustomFieldType. |
static java.lang.String |
getStringFromTransferObject(java.util.Collection<java.lang.String> collection)
Takes a Collection of values and creates a comma-separated String that represents this Collection. |
java.lang.Object |
getStringValueFromCustomFieldParams(CustomFieldParams parameters)
Return the String value object from the CustomFieldParams. |
java.lang.Object |
getValueFromCustomFieldParams(CustomFieldParams parameters)
Retrieves the Object representing the CustomField value instance from the CustomFieldParams of Strings. |
java.lang.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,
java.lang.Object value)
Sets the default value for a Custom Field |
void |
updateValue(CustomField customField,
Issue issue,
java.lang.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(java.lang.Object v1,
java.lang.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 java.lang.String COMMA_REPLACEMENT
Constructor Detail |
---|
public MultiSelectCFType(OptionsManager optionsManager, CustomFieldValuePersister valuePersister, GenericConfigManager genericConfigManager)
Method Detail |
---|
public java.util.Set<java.lang.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, java.lang.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 java.lang.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 java.lang.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 java.lang.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, java.lang.Object value)
createValue
in interface CustomFieldType
value
- A Collection
.public void updateValue(CustomField customField, Issue issue, java.lang.Object value)
updateValue
in interface CustomFieldType
public void removeValue(CustomField field, Issue issue, Option option)
removeValue
in interface MultipleSettableCustomFieldType
public java.lang.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 java.lang.String getChangelogValue(CustomField field, java.lang.Object value)
CustomFieldType
getChangelogValue
in interface CustomFieldType
field
- CustomField that the value belongs tovalue
- Transport Object representing the value instance of the CustomField
public java.lang.String getStringFromSingularObject(java.lang.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 java.lang.Object getSingularObjectFromString(java.lang.String string) throws FieldValidationException
CustomFieldType
getSingularObjectFromString
in interface CustomFieldType
string
- the String
FieldValidationException
- if the string is an invalid representation of the Object.public java.util.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(java.util.List<java.lang.String> customFieldObjectValue1, java.util.List<java.lang.String> customFieldObjectValue2, FieldConfig fieldConfig)
SortableCustomField
compare
in interface SortableCustomField<java.util.List<java.lang.String>>
customFieldObjectValue1
- Never nullcustomFieldObjectValue2
- Never null
public ProjectCustomFieldImporter getProjectImporter()
ProjectImportableCustomField
getProjectImporter
in interface ProjectImportableCustomField
public static java.util.Collection<java.lang.String> extractTransferObjectFromString(java.lang.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 java.lang.String getStringFromTransferObject(java.util.Collection<java.lang.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
- a collection of Strings to be comma separated
public boolean valuesEqual(java.lang.Object v1, java.lang.Object v2)
CustomFieldType
valuesEqual
in interface CustomFieldType
valuesEqual
in class AbstractCustomFieldType
v1
- current valuev2
- new value
public java.lang.Object accept(AbstractCustomFieldType.VisitorBase visitor)
accept
in class AbstractCustomFieldType
public org.apache.lucene.search.Query getQueryForGroup(java.lang.String fieldName, java.lang.String groupName)
GroupSelectorField
fieldName:groupName
. However some custom fields, such as (@Link SelectCFType)
manipulate the field identifiers and values before storing in the index. In cases like this you will have to
implement the method such that it searches the correct fields.
getQueryForGroup
in interface GroupSelectorField
fieldName
- the id of the custom fieldgroupName
- the name of the group to filter on
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |