com.atlassian.jira.issue.customfields.impl
Class CalculatedCFType

java.lang.Object
  extended bycom.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType
      extended bycom.atlassian.jira.issue.customfields.impl.CalculatedCFType
All Implemented Interfaces:
CustomFieldType, SortableCustomField

public abstract class CalculatedCFType
extends AbstractCustomFieldType
implements SortableCustomField


Constructor Summary
CalculatedCFType()
           
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2, CustomField customField)
           
 void createValue(CustomField field, org.ofbiz.core.entity.GenericValue issue, java.lang.Object value)
          These methods take the Transport Object as a parameter
 java.lang.String getChangelogValue(CustomField field, java.lang.Object value)
          Returns a String of representing values to be stored in the change log.
 java.lang.Object getDefaultValue(CustomField field)
          Retrieves the Object representing the default CustomField value for the Custom Field.
 java.lang.Object getValueFromCustomFieldParams(CustomFieldParams parameters)
          Retrieves the Object representing the CustomField value instance from the CustomFieldParams of Strings.
 java.util.Set remove(CustomField field)
          Performs additional tasks when a CustomField of this type is being removed CustomField.remove().
 void removeValue(CustomField arg0, org.ofbiz.core.entity.GenericValue arg1, java.lang.Object arg2)
           
 void setDefaultValue(CustomField field, java.lang.Object value)
          Sets the default value for a Custom Field
 void updateValue(CustomField field, org.ofbiz.core.entity.GenericValue issue, java.lang.Object value)
           
 void validateFromParams(CustomFieldParams relevantParams, ErrorCollection errorCollectionToAddTo)
          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.AbstractCustomFieldType
assertObjectImplementsType, getDescription, getDescriptor, getKey, getName, getVelocityParameters, init
 
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
getSingularObjectFromString, getStringFromSingularObject, getValueFromIssue
 

Constructor Detail

CalculatedCFType

public CalculatedCFType()
Method Detail

remove

public java.util.Set remove(CustomField field)
Description copied from interface: CustomFieldType
Performs additional tasks when a CustomField of this type is being removed CustomField.remove(). This includes removal of values & options.

Specified by:
remove in interface CustomFieldType
Parameters:
field - The custom field that is being removed, so any data stored for any issues for that field can be deleted.
Returns:
Set of issue ids that has been affected

validateFromParams

public void validateFromParams(CustomFieldParams relevantParams,
                               ErrorCollection errorCollectionToAddTo)
Description copied from interface: CustomFieldType
Ensures that the 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.

Specified by:
validateFromParams in interface CustomFieldType
Parameters:
relevantParams - parameter object of Strings
errorCollectionToAddTo - errorCollection to which any erros should be added (never null)

createValue

public void createValue(CustomField field,
                        org.ofbiz.core.entity.GenericValue issue,
                        java.lang.Object value)
Description copied from interface: CustomFieldType
These methods take the Transport Object as a parameter

Specified by:
createValue in interface CustomFieldType

updateValue

public void updateValue(CustomField field,
                        org.ofbiz.core.entity.GenericValue issue,
                        java.lang.Object value)
Specified by:
updateValue in interface CustomFieldType

removeValue

public void removeValue(CustomField arg0,
                        org.ofbiz.core.entity.GenericValue arg1,
                        java.lang.Object arg2)

getDefaultValue

public java.lang.Object getDefaultValue(CustomField field)
Description copied from interface: CustomFieldType
Retrieves the Object representing the default CustomField value for the Custom Field. See CustomFieldType.getValueFromCustomFieldParams(com.atlassian.jira.issue.customfields.view.CustomFieldParams) for more detailed notes.

Specified by:
getDefaultValue in interface CustomFieldType
Parameters:
field - CustomField for default value
Returns:
Transport Object matching the Object parameter of CustomFieldType.createValue(com.atlassian.jira.issue.fields.CustomField, org.ofbiz.core.entity.GenericValue, java.lang.Object), CustomFieldType.updateValue(com.atlassian.jira.issue.fields.CustomField, org.ofbiz.core.entity.GenericValue, java.lang.Object)

setDefaultValue

public void setDefaultValue(CustomField field,
                            java.lang.Object value)
Description copied from interface: CustomFieldType
Sets the default value for a Custom Field

Specified by:
setDefaultValue in interface CustomFieldType
Parameters:
field - CustomField for which the default is being stored
value - Transport Object representing the value instance of the CustomField

getChangelogValue

public java.lang.String getChangelogValue(CustomField field,
                                          java.lang.Object value)
Description copied from interface: CustomFieldType
Returns a String of representing values to be stored in the change log.

Specified by:
getChangelogValue in interface CustomFieldType
Parameters:
field - CustomField that the value belongs to
value - Transport Object representing the value instance of the CustomField
Returns:
Change log string.

getValueFromCustomFieldParams

public java.lang.Object getValueFromCustomFieldParams(CustomFieldParams parameters)
                                               throws CustomFieldValidationException
Description copied from interface: CustomFieldType
Retrieves the Object representing the CustomField value instance from the CustomFieldParams of Strings. This return type must exactly match that of the value Object parameter in the persistance methods (CustomFieldType.createValue(com.atlassian.jira.issue.fields.CustomField, org.ofbiz.core.entity.GenericValue, java.lang.Object), CustomFieldType.updateValue(com.atlassian.jira.issue.fields.CustomField, org.ofbiz.core.entity.GenericValue, java.lang.Object)) and Object returned from CustomFieldType.getValueFromIssue(com.atlassian.jira.issue.fields.CustomField, org.ofbiz.core.entity.GenericValue).

Specified by:
getValueFromCustomFieldParams in interface CustomFieldType
Parameters:
parameters - CustomFieldParams of String objects. Will contain one value for Singular field types.
Returns:
Transport Object matching the Object parameter of CustomFieldType.createValue(com.atlassian.jira.issue.fields.CustomField, org.ofbiz.core.entity.GenericValue, java.lang.Object), CustomFieldType.updateValue(com.atlassian.jira.issue.fields.CustomField, org.ofbiz.core.entity.GenericValue, java.lang.Object)
Throws:
CustomFieldValidationException - if the String value fails to convert into Objects
See Also:
CustomFieldType.createValue(com.atlassian.jira.issue.fields.CustomField, org.ofbiz.core.entity.GenericValue, java.lang.Object), CustomFieldType.updateValue(com.atlassian.jira.issue.fields.CustomField, org.ofbiz.core.entity.GenericValue, java.lang.Object), CustomFieldType.getValueFromIssue(com.atlassian.jira.issue.fields.CustomField, org.ofbiz.core.entity.GenericValue)

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2,
                   CustomField customField)
Specified by:
compare in interface SortableCustomField


Copyright © 2002-2005 Atlassian. All Rights Reserved.