|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType<T,T>
com.atlassian.jira.issue.customfields.impl.AbstractSingleFieldType<Option>
com.atlassian.jira.issue.customfields.impl.SelectCFType
public class SelectCFType
Select Custom Field Type allows selecting of a single Option
.
Transport Object is Option
dl>
Option
String
of Option ID
Nested Class Summary | |
---|---|
static interface |
SelectCFType.Visitor<T>
|
Nested classes/interfaces inherited from class com.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType |
---|
AbstractCustomFieldType.VisitorBase<X> |
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 |
Fields inherited from interface com.atlassian.jira.issue.customfields.CustomFieldType |
---|
DEFAULT_VALUE_TYPE |
Constructor Summary | |
---|---|
SelectCFType(CustomFieldValuePersister customFieldValuePersister,
OptionsManager optionsManager,
GenericConfigManager genericConfigManager,
JiraBaseUrls jiraBaseUrls)
|
|
SelectCFType(CustomFieldValuePersister customFieldValuePersister,
StringConverter stringConverter,
SelectConverter selectConverter,
OptionsManager optionsManager,
GenericConfigManager genericConfigManager,
JiraBaseUrls jiraBaseUrls)
Deprecated. Use SelectCFType(com.atlassian.jira.issue.customfields.persistence.CustomFieldValuePersister, com.atlassian.jira.issue.customfields.manager.OptionsManager, com.atlassian.jira.issue.customfields.manager.GenericConfigManager, com.atlassian.jira.issue.fields.rest.json.beans.JiraBaseUrls) instead. Since v5.0. |
Method Summary | |
---|---|
Object |
accept(AbstractCustomFieldType.VisitorBase visitor)
|
int |
compare(String customFieldObjectValue1,
String customFieldObjectValue2,
FieldConfig fieldConfig)
Compares the two custom field objects. |
String |
getChangelogString(CustomField field,
Option value)
Returns a String of representing values to be stored in the change log, an example is the name of a version field that a version id will resolve to within JIRA. |
List<FieldConfigItemType> |
getConfigurationItemTypes()
Returns a List of FieldConfigItemType objects. |
protected PersistenceFieldType |
getDatabaseType()
Type of database field needed to store this field. |
protected Object |
getDbValueFromObject(Option customFieldObject)
Returns the database representation of the Java object as stored for that CustomField. |
Option |
getDefaultValue(FieldConfig fieldConfig)
Retrieves the Object representing the default CustomField value for the Custom Field. |
FieldTypeInfo |
getFieldTypeInfo(FieldTypeInfoContext fieldTypeInfoContext)
Returns lower level Information about the field. |
Set<Long> |
getIssueIdsWithValue(CustomField field,
Option option)
Returns a Set of issue ids ( Long ) that have the given option selected. |
JsonData |
getJsonDefaultValue(IssueContext issueCtx,
CustomField field)
Return The default data for this system field. |
FieldJsonRepresentation |
getJsonFromIssue(CustomField field,
Issue issue,
boolean renderedVersionRequested,
FieldLayoutItem fieldLayoutItem)
Return a JsonData representation of the field value |
JsonType |
getJsonSchema(CustomField customField)
Return a description of the shape of this field when represented as JSON. |
protected Option |
getObjectFromDbValue(Object databaseValue)
Returns the Transport Object for the given Custom Field value as represented by the value stored in the database |
Options |
getOptions(FieldConfig config,
JiraContextNode jiraContextNode)
Returns all possible Options for this field. |
ProjectCustomFieldImporter |
getProjectImporter()
Returns the object that will perform the actual project import functions for the custom field type. |
org.apache.lucene.search.Query |
getQueryForGroup(String fieldID,
String groupName)
This method should be implemented in your custom type to return a Query. |
RestFieldOperationsHandler |
getRestFieldOperation(CustomField field)
Returns the RestFieldOperationsHandler for this field. |
Option |
getSingularObjectFromString(String string)
Returns a Singular Object, given the string value as passed by the presentation tier. |
String |
getStringFromSingularObject(Option optionObject)
Returns the String representation of a single value within the CustomFieldType. |
Set<Long> |
remove(CustomField field)
called when removing a field. |
void |
removeValue(CustomField field,
Issue issue,
Option option)
This default implementation will remove all values from the custom field for an issue. |
void |
setDefaultValue(FieldConfig fieldConfig,
Option option)
Sets the default value for a Custom Field |
void |
validateFromParams(CustomFieldParams relevantParams,
ErrorCollection errorCollectionToAddTo,
FieldConfig config)
Ensures that the CustomFieldParams of Strings is a valid representation of the Custom Field values. |
Methods inherited from class com.atlassian.jira.issue.customfields.impl.AbstractSingleFieldType |
---|
createValue, getChangelogValue, getStringValueFromCustomFieldParams, getValueFromCustomFieldParams, getValueFromIssue, updateValue |
Methods inherited from class com.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType |
---|
assertObjectImplementsType, availableForBulkEdit, 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, createValue, getChangelogValue, getDescription, getDescriptor, getKey, getName, getRelatedIndexers, getStringValueFromCustomFieldParams, getValueFromCustomFieldParams, getValueFromIssue, getVelocityParameters, init, isRenderable, updateValue, valuesEqual |
Constructor Detail |
---|
public SelectCFType(CustomFieldValuePersister customFieldValuePersister, OptionsManager optionsManager, GenericConfigManager genericConfigManager, JiraBaseUrls jiraBaseUrls)
@Deprecated public SelectCFType(CustomFieldValuePersister customFieldValuePersister, StringConverter stringConverter, SelectConverter selectConverter, OptionsManager optionsManager, GenericConfigManager genericConfigManager, JiraBaseUrls jiraBaseUrls)
SelectCFType(com.atlassian.jira.issue.customfields.persistence.CustomFieldValuePersister, com.atlassian.jira.issue.customfields.manager.OptionsManager, com.atlassian.jira.issue.customfields.manager.GenericConfigManager, com.atlassian.jira.issue.fields.rest.json.beans.JiraBaseUrls)
instead. Since v5.0.
Method Detail |
---|
public Set<Long> remove(CustomField field)
AbstractSingleFieldType
Subclasses should override this if they have specific cleanup that they need to do (such as removing select list values)
remove
in interface CustomFieldType<Option,Option>
remove
in class AbstractSingleFieldType<Option>
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 affected@NotNull protected PersistenceFieldType getDatabaseType()
AbstractSingleFieldType
getDatabaseType
in class AbstractSingleFieldType<Option>
PersistenceFieldType
types.protected Object getDbValueFromObject(Option customFieldObject)
AbstractSingleFieldType
AbstractSingleFieldType.getDatabaseType()
getDbValueFromObject
in class AbstractSingleFieldType<Option>
customFieldObject
- the Transport Object
protected Option getObjectFromDbValue(@NotNull Object databaseValue) throws FieldValidationException
AbstractSingleFieldType
getObjectFromDbValue
in class AbstractSingleFieldType<Option>
databaseValue
- - String, Double or Date objects as returned from AbstractSingleFieldType.getDbValueFromObject(Object)
FieldValidationException
- if field validation fails.public void removeValue(CustomField field, Issue issue, Option option)
removeValue
in interface MultipleSettableCustomFieldType<Option,Option>
option
- - ignoredfield
- being editedissue
- to remove stuff frompublic Option getSingularObjectFromString(String string) throws FieldValidationException
CustomFieldType
getSingularObjectFromString
in interface CustomFieldType<Option,Option>
string
- the String
FieldValidationException
- if the string is an invalid representation of the Object.public String getStringFromSingularObject(Option optionObject)
CustomFieldType
String
representation of a single value within the CustomFieldType. This is the value that
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 Map
getStringFromSingularObject
in interface CustomFieldType<Option,Option>
optionObject
- the object
public Set<Long> getIssueIdsWithValue(CustomField field, Option option)
MultipleSettableCustomFieldType
Long
) that have the given option selected.
getIssueIdsWithValue
in interface MultipleSettableCustomFieldType<Option,Option>
field
- the CustomField to search onoption
- the Object representing a single value to search on.
@NotNull public List<FieldConfigItemType> getConfigurationItemTypes()
CustomFieldType
FieldConfigItemType
objects. Can not be immutable.
This opens up possibilties for configurable custom fields.
getConfigurationItemTypes
in interface CustomFieldType<Option,Option>
getConfigurationItemTypes
in class AbstractCustomFieldType<Option,Option>
FieldConfigItemType
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<Option,Option>
validateFromParams
in class AbstractSingleFieldType<Option>
relevantParams
- parameter object of StringserrorCollectionToAddTo
- errorCollection to which any erros should be added (never null)config
- FieldConfigpublic void setDefaultValue(FieldConfig fieldConfig, Option option)
CustomFieldType
setDefaultValue
in interface CustomFieldType<Option,Option>
setDefaultValue
in class AbstractSingleFieldType<Option>
fieldConfig
- CustomField for which the default is being storedoption
- Transport Object representing the value instance of the CustomFieldpublic Option getDefaultValue(FieldConfig fieldConfig)
CustomFieldType
getDefaultValue
in interface CustomFieldType<Option,Option>
getDefaultValue
in class AbstractSingleFieldType<Option>
fieldConfig
- CustomField for default value
public String getChangelogString(CustomField field, Option value)
CustomFieldType
getChangelogString
in interface CustomFieldType<Option,Option>
getChangelogString
in class AbstractCustomFieldType<Option,Option>
field
- CustomField that the value belongs tovalue
- Transport Object representing the value instance of the CustomField
public Options getOptions(FieldConfig config, @Nullable JiraContextNode jiraContextNode)
MultipleCustomFieldType
getOptions
in interface MultipleCustomFieldType<Option,Option>
config
- configuration for this fieldjiraContextNode
- context
public int compare(@NotNull String customFieldObjectValue1, @NotNull String customFieldObjectValue2, FieldConfig fieldConfig)
SortableCustomField
compare
in interface SortableCustomField<String>
customFieldObjectValue1
- Never nullcustomFieldObjectValue2
- Never null
public ProjectCustomFieldImporter getProjectImporter()
ProjectImportableCustomField
getProjectImporter
in interface ProjectImportableCustomField
public Object accept(AbstractCustomFieldType.VisitorBase visitor)
accept
in class AbstractSingleFieldType<Option>
public org.apache.lucene.search.Query getQueryForGroup(String fieldID, 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
fieldID
- the id of the custom fieldgroupName
- the name of the group to filter on
public FieldTypeInfo getFieldTypeInfo(FieldTypeInfoContext fieldTypeInfoContext)
RestAwareCustomFieldType
getFieldTypeInfo
in interface RestAwareCustomFieldType
fieldTypeInfoContext
- context information for generating the FieldTypeInfo
.
public JsonType getJsonSchema(CustomField customField)
RestAwareCustomFieldType
getJsonSchema
in interface RestAwareCustomFieldType
public FieldJsonRepresentation getJsonFromIssue(CustomField field, Issue issue, boolean renderedVersionRequested, @Nullable FieldLayoutItem fieldLayoutItem)
RestAwareCustomFieldType
getJsonFromIssue
in interface RestAwareCustomFieldType
field
- configuration of the current fieldissue
- to get field data fromrenderedVersionRequested
- whether the use requested the return of rendered/pretty data as well as raw datafieldLayoutItem
- field layout for this field.
public RestFieldOperationsHandler getRestFieldOperation(CustomField field)
RestCustomFieldTypeOperations
getRestFieldOperation
in interface RestCustomFieldTypeOperations
field
- the Custom Field
public JsonData getJsonDefaultValue(IssueContext issueCtx, CustomField field)
RestCustomFieldTypeOperations
getJsonDefaultValue
in interface RestCustomFieldTypeOperations
getJsonDefaultValue
in class AbstractSingleFieldType<Option>
issueCtx
- Issue (This should really only need to be an issue context, but for historical reasons we need an issue object.field
- the Custom Field
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |