|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.action.issue.customfields.MockCustomFieldType
public class MockCustomFieldType
Mocks a CustomFieldType
Field Summary |
---|
Fields inherited from interface com.atlassian.jira.issue.customfields.CustomFieldType |
---|
DEFAULT_VALUE_TYPE, RESOURCE_PREVIEW |
Constructor Summary | |
---|---|
MockCustomFieldType()
|
|
MockCustomFieldType(String key,
String name)
|
|
MockCustomFieldType(String key,
String name,
String description)
|
Method Summary | |
---|---|
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)
Upadte 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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MockCustomFieldType()
public MockCustomFieldType(String key, String name)
public MockCustomFieldType(String key, String name, String description)
Method Detail |
---|
public String getKey()
CustomFieldType
getKey
in interface CustomFieldType
public void setKey(String key)
public String getName()
getName
in interface CustomFieldType
public void setName(String name)
public void init(CustomFieldTypeModuleDescriptor customFieldTypeModuleDescriptor)
CustomFieldType
init
in interface CustomFieldType
customFieldTypeModuleDescriptor
- CustomFieldTypeModuleDescriptorpublic String getDescription()
getDescription
in interface CustomFieldType
public CustomFieldTypeModuleDescriptor getDescriptor()
getDescriptor
in interface CustomFieldType
public String getStringFromSingularObject(Object singularObject)
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
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 Set<Long> remove(CustomField field)
CustomFieldType
CustomField.remove()
.
This includes removal of values & options.
remove
in interface CustomFieldType
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 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 field, Issue issue, Object value)
CustomFieldType
createValue
in interface CustomFieldType
field
- 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 void updateValue(CustomField field, Issue issue, Object value)
CustomFieldType
updateValue
in interface CustomFieldType
field
- 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
CustomFieldType
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, 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)
CustomFieldType
getStringValueFromCustomFieldParams
in interface CustomFieldType
parameters
- - CustomFieldParams containing String values
public Object getValueFromIssue(CustomField field, Issue issue)
CustomFieldType
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, T)
, CustomFieldType.updateValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, T)
public Object getDefaultValue(FieldConfig fieldConfig)
CustomFieldType
getDefaultValue
in interface CustomFieldType
fieldConfig
- CustomField for default value
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 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 getChangelogString(CustomField field, Object value)
CustomFieldType
getChangelogString
in interface CustomFieldType
field
- 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)
CustomFieldType
getVelocityParameters
in interface CustomFieldType
issue
- The issue currently in context (Note: this will be null in cases like 'default value')field
- CustomFieldfieldLayoutItem
- FieldLayoutItem
Map
of parameters to add to the velocity context, or an empty Map otherwise (never null)@Nonnull public List<FieldConfigItemType> getConfigurationItemTypes()
CustomFieldType
FieldConfigItemType
objects. Can not be immutable.
This opens up possibilties for configurable custom fields.
getConfigurationItemTypes
in interface CustomFieldType
FieldConfigItemType
public MockCustomFieldType setConfigurationItemTypes(List<FieldConfigItemType> itemTypes)
public List<FieldIndexer> getRelatedIndexers(CustomField customField)
CustomFieldType
getRelatedIndexers
in interface CustomFieldType
customField
- the custom field to get the related indexers of.
FieldIndexer
objects. Null if no related indexers.public boolean isRenderable()
CustomFieldType
isRenderable
in interface CustomFieldType
public boolean valuesEqual(Object v1, Object v2)
CustomFieldType
valuesEqual
in interface CustomFieldType
v1
- current valuev2
- new value
public String availableForBulkEdit(BulkEditBean bulkEditBean)
CustomFieldType
availableForBulkEdit
in interface CustomFieldType
bulkEditBean
- BulkEditBean
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |