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

java.lang.Object
  extended by com.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType
All Implemented Interfaces:
CustomFieldType
Direct Known Subclasses:
AbstractMultiSettableCFType, AbstractSingleFieldType, CalculatedCFType, LabelsCFType, VersionCFType

public abstract class AbstractCustomFieldType
extends java.lang.Object
implements CustomFieldType


Nested Class Summary
static interface AbstractCustomFieldType.Visitor<T>
          Visitor interface for AbstractCustomFieldType.
static interface AbstractCustomFieldType.VisitorBase<T>
          Marker interface for visitors of AbstractCustomFieldType (acyclic visitor).
 
Field Summary
 
Fields inherited from interface com.atlassian.jira.issue.customfields.CustomFieldType
DEFAULT_VALUE_TYPE
 
Constructor Summary
AbstractCustomFieldType()
           
 
Method Summary
 java.lang.Object accept(AbstractCustomFieldType.VisitorBase visitor)
           
protected  void assertObjectImplementsType(java.lang.Class<?> clazz, java.lang.Object o)
           
 java.lang.String availableForBulkEdit(BulkEditBean bulkEditBean)
          Allow the custom field type perform a specific check as to its availability for bulk editing.
 java.lang.String getChangelogString(CustomField field, java.lang.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.
 java.util.List<FieldConfigItemType> getConfigurationItemTypes()
          Returns a List of FieldConfigItemType objects.
 java.lang.String getDescription()
           
 CustomFieldTypeModuleDescriptor getDescriptor()
           
protected  I18nHelper getI18nBean()
           
 java.lang.String getKey()
          Returns the full key of the CustomFieldType.
 java.lang.String getName()
           
 java.util.List<FieldIndexer> getRelatedIndexers(CustomField customField)
          Returns a list of indexers that will be used for the field.
 java.util.Map getVelocityParameters(Issue issue)
          Implementers should override the 3-param version of this.
 java.util.Map<java.lang.String,java.lang.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 descriptor)
          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.
 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.jira.issue.customfields.CustomFieldType
createValue, getChangelogValue, getDefaultValue, getSingularObjectFromString, getStringFromSingularObject, getStringValueFromCustomFieldParams, getValueFromCustomFieldParams, getValueFromIssue, remove, setDefaultValue, updateValue, validateFromParams
 

Constructor Detail

AbstractCustomFieldType

public AbstractCustomFieldType()
Method Detail

init

public void init(CustomFieldTypeModuleDescriptor descriptor)
Description copied from interface: CustomFieldType
Initialises the CustomFieldType with the given descriptor.

Specified by:
init in interface CustomFieldType
Parameters:
descriptor - CustomFieldTypeModuleDescriptor

getKey

public final java.lang.String getKey()
Description copied from interface: CustomFieldType
Returns the full key of the CustomFieldType. Typically, this will be prefixed with "com.atlassian.jira.plugin.system.customfieldtypes:"

Specified by:
getKey in interface CustomFieldType
Returns:
CustomFieldType Key prefixed with the Package

getName

public final java.lang.String getName()
Specified by:
getName in interface CustomFieldType

getDescription

public final java.lang.String getDescription()
Specified by:
getDescription in interface CustomFieldType

getDescriptor

public final CustomFieldTypeModuleDescriptor getDescriptor()
Specified by:
getDescriptor in interface CustomFieldType

getVelocityParameters

public java.util.Map<java.lang.String,java.lang.Object> getVelocityParameters(Issue issue,
                                                                              CustomField field,
                                                                              FieldLayoutItem fieldLayoutItem)
Description copied from interface: CustomFieldType
The custom field may wish to pass parameters to the velocity context beyond the getValueFromIssue methods (eg managers).

The values are added to the context for all velocity views (edit, search, view, xml)

Specified by:
getVelocityParameters in interface CustomFieldType
Parameters:
issue - The issue currently in context (Note: this will be null in cases like 'default value')
field - CustomField
fieldLayoutItem - FieldLayoutItem
Returns:
A Map of parameters to add to the velocity context, or an empty Map otherwise (never null)

getVelocityParameters

public final java.util.Map getVelocityParameters(Issue issue)
                                          throws java.lang.IllegalAccessException
Implementers should override the 3-param version of this. We want to make attempts to use this version a compile error so plugin developers must add the extra params.

Throws:
java.lang.IllegalAccessException
See Also:
getVelocityParameters(Issue, CustomField, FieldLayoutItem)

getConfigurationItemTypes

public java.util.List<FieldConfigItemType> getConfigurationItemTypes()
Description copied from interface: CustomFieldType
Returns a List of FieldConfigItemType objects. This opens up possibilties for configurable custom fields

Specified by:
getConfigurationItemTypes in interface CustomFieldType
Returns:
List of FieldConfigItemType

getRelatedIndexers

public java.util.List<FieldIndexer> getRelatedIndexers(CustomField customField)
Description copied from interface: CustomFieldType
Returns a list of indexers that will be used for the field.

Specified by:
getRelatedIndexers in interface CustomFieldType
Parameters:
customField - the custom field to get the related indexers of.
Returns:
List of instantiated and initialised FieldIndexer objects. Null if no related indexers.

isRenderable

public boolean isRenderable()
Description copied from interface: CustomFieldType
This is a mirror of the method from the RenderableField interface and is needed to bridge the gap between CustomFields and CustomFieldTypes.

Specified by:
isRenderable in interface CustomFieldType
Returns:
true if the field is configurable for use with the renderers, a text based field, false otherwise.

valuesEqual

public boolean valuesEqual(java.lang.Object v1,
                           java.lang.Object v2)
Description copied from interface: CustomFieldType
Used to compare 2 field values and work out whether a change item should be generated

Specified by:
valuesEqual in interface CustomFieldType
Parameters:
v1 - current value
v2 - new value
Returns:
true if teh change item should be generated, false otherwise

getChangelogString

public java.lang.String getChangelogString(CustomField field,
                                           java.lang.Object value)
Description copied from interface: CustomFieldType
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.

Specified by:
getChangelogString 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.

assertObjectImplementsType

protected void assertObjectImplementsType(java.lang.Class<?> clazz,
                                          java.lang.Object o)

availableForBulkEdit

public java.lang.String availableForBulkEdit(BulkEditBean bulkEditBean)
Description copied from interface: CustomFieldType
Allow the custom field type perform a specific check as to its availability for bulk editing.

Specified by:
availableForBulkEdit in interface CustomFieldType
Parameters:
bulkEditBean - BulkEditBean
Returns:
null if available for bulk edit or appropriate unavailable message

getI18nBean

protected I18nHelper getI18nBean()

accept

public java.lang.Object accept(AbstractCustomFieldType.VisitorBase visitor)


Copyright © 2002-2010 Atlassian. All Rights Reserved.