public class MockCustomFieldType extends Object implements CustomFieldType
DEFAULT_VALUE_TYPE, RESOURCE_PREVIEW| Constructor and Description |
|---|
MockCustomFieldType() |
MockCustomFieldType(String key,
String name) |
MockCustomFieldType(String key,
String name,
String description) |
| Modifier and Type | Method and Description |
|---|---|
String |
availableForBulkEdit(BulkEditBean bulkEditBean)
Allow the custom field type perform a specific check as to its availability for bulk editing.
|
void |
createValue(CustomField field,
Issue issue,
Object value)
Save the value for this Custom Field in a particular issue to the database.
|
String |
getChangelogString(CustomField field,
Object 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.
|
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.
|
String |
getDescription() |
CustomFieldTypeModuleDescriptor |
getDescriptor() |
String |
getKey()
Returns the full key of the CustomFieldType.
|
String |
getName() |
List<FieldIndexer> |
getRelatedIndexers(CustomField customField)
Returns a list of indexers that will be used for the field.
|
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. |
Object |
getStringValueFromCustomFieldParams(CustomFieldParams parameters)
Return the String value object from the CustomFieldParams.
|
Object |
getValueFromCustomFieldParams(CustomFieldParams parameters)
Retrieves the Transport Object representing the CustomField value instance from the CustomFieldParams of Strings.
|
Object |
getValueFromIssue(CustomField field,
Issue issue)
Retrieves the Transport Object representing the current CustomField value for the given issue.
|
Map<String,Object> |
getVelocityParameters(Issue issue,
CustomField field,
FieldLayoutItem fieldLayoutItem)
The custom field may wish to pass parameters to the velocity context beyond the getValueFromIssue methods
(eg managers).
|
void |
init(CustomFieldTypeModuleDescriptor customFieldTypeModuleDescriptor)
Initialises the CustomFieldType with the given descriptor.
|
boolean |
isRenderable()
This is a mirror of the method from the RenderableField interface and is needed to bridge the gap between
CustomFields and CustomFieldTypes.
|
Set<Long> |
remove(CustomField field)
Performs additional tasks when an entire CustomField of this type is being removed
CustomField.remove(). |
MockCustomFieldType |
setConfigurationItemTypes(List<FieldConfigItemType> itemTypes) |
void |
setDefaultValue(FieldConfig fieldConfig,
Object value)
Sets the default value for a Custom Field
|
void |
setKey(String key) |
void |
setName(String name) |
String |
toString() |
void |
updateValue(CustomField field,
Issue issue,
Object value)
Update the value for this Custom Field in a particular issue currently stored in the database.
|
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
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetCloneOptionConfiguration, getCloneValue, isUserInputRequiredForMovepublic String getKey()
CustomFieldTypegetKey in interface CustomFieldTypepublic void setKey(String key)
public String getName()
getName in interface CustomFieldTypepublic void setName(String name)
public void init(CustomFieldTypeModuleDescriptor customFieldTypeModuleDescriptor)
CustomFieldTypeinit in interface CustomFieldTypecustomFieldTypeModuleDescriptor - CustomFieldTypeModuleDescriptorpublic String getDescription()
getDescription in interface CustomFieldTypepublic CustomFieldTypeModuleDescriptor getDescriptor()
getDescriptor in interface CustomFieldTypepublic String getStringFromSingularObject(Object singularObject)
CustomFieldTypeString 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 MapgetStringFromSingularObject in interface CustomFieldTypesingularObject - the objectpublic Object getSingularObjectFromString(String string) throws FieldValidationException
CustomFieldTypegetSingularObjectFromString in interface CustomFieldTypestring - the StringFieldValidationException - if the string is an invalid representation of the Object.public Set<Long> remove(CustomField field)
CustomFieldTypeCustomField.remove().
This includes removal of values & options.remove in interface CustomFieldTypefield - 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 void validateFromParams(CustomFieldParams relevantParams, ErrorCollection errorCollectionToAddTo, FieldConfig config)
CustomFieldTypeCustomFieldParams 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 CustomFieldTyperelevantParams - parameter object of StringserrorCollectionToAddTo - errorCollection to which any errors should be added (never null)config - FieldConfigpublic void createValue(CustomField field, Issue issue, @Nonnull Object value)
CustomFieldTypecreateValue in interface CustomFieldTypefield - CustomField for which the value is being storedissue - The Issue to be stored against.value - Transport Object representing the value instance of the CustomField.
Can not be null.public void updateValue(CustomField field, Issue issue, Object value)
CustomFieldTypeupdateValue in interface CustomFieldTypefield - CustomField for which the value is being storedissue - The Issue to be stored against.value - Transport Object representing the value instance of the CustomField.public Object getValueFromCustomFieldParams(CustomFieldParams parameters) throws FieldValidationException
CustomFieldTypegetValueFromCustomFieldParams in interface CustomFieldTypeparameters - 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, T), CustomFieldType.updateValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, T)FieldValidationException - if the String value fails to convert into ObjectsCustomFieldType.createValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, Object),
CustomFieldType.updateValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, Object),
CustomFieldType.getValueFromIssue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue)public Object getStringValueFromCustomFieldParams(CustomFieldParams parameters)
CustomFieldTypegetStringValueFromCustomFieldParams in interface CustomFieldTypeparameters - - CustomFieldParams containing String valuespublic Object getValueFromIssue(CustomField field, Issue issue)
CustomFieldTypegetValueFromIssue in interface CustomFieldTypefield - Custom field for which to retrieve the valueissue - Issue from which to retrieve the valueCustomFieldType.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)public Object getDefaultValue(FieldConfig fieldConfig)
CustomFieldTypegetDefaultValue in interface CustomFieldTypefieldConfig - CustomField for default valuepublic void setDefaultValue(FieldConfig fieldConfig, Object value)
CustomFieldTypesetDefaultValue in interface CustomFieldTypefieldConfig - CustomField for which the default is being storedvalue - Transport Object representing the value instance of the CustomFieldpublic String getChangelogValue(CustomField field, Object value)
CustomFieldTypegetChangelogValue in interface CustomFieldTypefield - CustomField that the value belongs tovalue - Transport Object representing the value instance of the CustomFieldpublic String getChangelogString(CustomField field, Object value)
CustomFieldTypegetChangelogString in interface CustomFieldTypefield - CustomField that the value belongs tovalue - Transport Object representing the value instance of the CustomField@Nonnull public Map<String,Object> getVelocityParameters(Issue issue, CustomField field, FieldLayoutItem fieldLayoutItem)
CustomFieldTypeThe values are added to the context for all velocity views (edit, search, view, xml)
getVelocityParameters in interface CustomFieldTypeissue - The issue currently in context (Note: this will be null in cases like 'default value')field - CustomFieldfieldLayoutItem - FieldLayoutItemMap of parameters to add to the velocity context, or an empty Map otherwise (never null)@Nonnull public List<FieldConfigItemType> getConfigurationItemTypes()
CustomFieldTypeFieldConfigItemType objects. Can not be immutable.
This opens up possibilities for configurable custom fields.getConfigurationItemTypes in interface CustomFieldTypeFieldConfigItemTypepublic MockCustomFieldType setConfigurationItemTypes(List<FieldConfigItemType> itemTypes)
public List<FieldIndexer> getRelatedIndexers(CustomField customField)
CustomFieldTypegetRelatedIndexers in interface CustomFieldTypecustomField - the custom field to get the related indexers of.FieldIndexer objects. Null if no related indexers.public boolean isRenderable()
CustomFieldTypeisRenderable in interface CustomFieldTypepublic boolean valuesEqual(Object v1, Object v2)
CustomFieldTypevaluesEqual in interface CustomFieldTypev1 - current valuev2 - new valuepublic String availableForBulkEdit(BulkEditBean bulkEditBean)
CustomFieldTypeavailableForBulkEdit in interface CustomFieldTypebulkEditBean - BulkEditBeanCopyright © 2002-2017 Atlassian. All Rights Reserved.