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

java.lang.Object
  extended bycom.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType
      extended bycom.atlassian.jira.issue.customfields.impl.AbstractSingleFieldType
          extended bycom.atlassian.jira.issue.customfields.impl.StringCFType
              extended bycom.atlassian.jira.issue.customfields.impl.TextCFType
                  extended bycom.atlassian.jira.issue.customfields.impl.AbstractMultiCFType
                      extended bycom.atlassian.jira.issue.customfields.impl.MultiGroupCFType
All Implemented Interfaces:
CustomFieldType, GroupSelectorField, SortableCustomField

public class MultiGroupCFType
extends AbstractMultiCFType
implements GroupSelectorField

Multiple User Group Select Type

Transport Object Type
Collection of Groups


Field Summary
protected  MultiGroupConverter multiGroupConverter
           
 
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
MultiGroupCFType(CustomFieldValuePersister customFieldValuePersister, StringConverter stringConverter, GenericConfigManager genericConfigManager, MultiGroupConverter multiGroupConverter, PermissionManager permissionManager, JiraAuthenticationContext authenticationContext)
           
 
Method Summary
protected  Object convertStringToType(String string)
          Converts a given String to underlying type
protected  String convertTypeToString(Object value)
          Converts a given underlying type to String.
 List getRelatedIndexers(CustomField customField)
          Returns a list of indexers that will be used for the field.
 Object getSingularObjectFromString(String s)
          Returns a Singular Object, given the string value as passed by the presentation tier.
 String getStringFromSingularObject(Object o)
          Returns the String representation of a single value within the CustomFieldType.
 Object getStringValueFromCustomFieldParams(CustomFieldParams parameters)
          Return the String value object from the CustomFieldParams.
protected  Comparator getTypeComparator()
          Returns a comparator for underlying type of this custom field.
 Object getValueFromCustomFieldParams(CustomFieldParams parameters)
          Retrieves the Object representing the CustomField value instance from the CustomFieldParams of Strings.
 Map 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).
protected  boolean isMultiple()
           
 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.AbstractMultiCFType
convertStringsToTypes, convertTypesToStrings, createValue, getChangelogValue, getDefaultValue, getValueFromIssue, setDefaultValue, updateValue
 
Methods inherited from class com.atlassian.jira.issue.customfields.impl.TextCFType
compare, getDatabaseType
 
Methods inherited from class com.atlassian.jira.issue.customfields.impl.StringCFType
getDbValueFromObject, getObjectFromDbValue, makeSearchParameter
 
Methods inherited from class com.atlassian.jira.issue.customfields.impl.AbstractSingleFieldType
remove
 
Methods inherited from class com.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType
assertObjectImplementsType, availableForBulkEdit, getChangelogString, getConfigurationItemTypes, getDescription, getDescriptor, getI18nBean, getKey, getName, getVelocityParameters, init, isRenderable, valuesEqual
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

multiGroupConverter

protected final MultiGroupConverter multiGroupConverter
Constructor Detail

MultiGroupCFType

public MultiGroupCFType(CustomFieldValuePersister customFieldValuePersister,
                        StringConverter stringConverter,
                        GenericConfigManager genericConfigManager,
                        MultiGroupConverter multiGroupConverter,
                        PermissionManager permissionManager,
                        JiraAuthenticationContext authenticationContext)
Method Detail

getTypeComparator

protected Comparator getTypeComparator()
Description copied from class: AbstractMultiCFType
Returns a comparator for underlying type of this custom field.

Specified by:
getTypeComparator in class AbstractMultiCFType
Returns:
a comparator

getValueFromCustomFieldParams

public Object getValueFromCustomFieldParams(CustomFieldParams parameters)
                                     throws FieldValidationException
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, com.atlassian.jira.issue.Issue, java.lang.Object), CustomFieldType.updateValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, java.lang.Object)) and Object returned from CustomFieldType.getValueFromIssue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue).

Specified by:
getValueFromCustomFieldParams in interface CustomFieldType
Overrides:
getValueFromCustomFieldParams in class AbstractSingleFieldType
Throws:
FieldValidationException

getStringValueFromCustomFieldParams

public Object getStringValueFromCustomFieldParams(CustomFieldParams parameters)
Description copied from interface: CustomFieldType
Return the String value object from the CustomFieldParams. The object may be a single String (e.g. TextCFType, List of Strings (e.g. MultiSelectCFType) or CustomFieldParams of Strings (e.g. CascadingSelectCFType)

Specified by:
getStringValueFromCustomFieldParams in interface CustomFieldType
Overrides:
getStringValueFromCustomFieldParams in class AbstractSingleFieldType

validateFromParams

public void validateFromParams(CustomFieldParams relevantParams,
                               ErrorCollection errorCollectionToAddTo,
                               FieldConfig config)
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
Overrides:
validateFromParams in class AbstractSingleFieldType

getStringFromSingularObject

public String getStringFromSingularObject(Object o)
Description copied from interface: CustomFieldType
Returns the String representation of a single value within the CustomFieldType. This is the value that will 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 CustomFieldParams

Specified by:
getStringFromSingularObject in interface CustomFieldType
Overrides:
getStringFromSingularObject in class TextCFType

getSingularObjectFromString

public Object getSingularObjectFromString(String s)
                                   throws FieldValidationException
Description copied from interface: CustomFieldType
Returns a Singular Object, given the string value as passed by the presentation tier. Throws FieldValidationException if the string is an invalid representation of the Object.

Specified by:
getSingularObjectFromString in interface CustomFieldType
Overrides:
getSingularObjectFromString in class TextCFType
Throws:
FieldValidationException

getRelatedIndexers

public List getRelatedIndexers(CustomField customField)
Description copied from interface: CustomFieldType
Returns a list of indexers that will be used for the field. This will over-ride the anonymous searcher specified by AbstractCustomFieldSearcher.getRelatedIndexers() and AbstractCustomFieldSearcher.index(Document, CustomField, Object)

Specified by:
getRelatedIndexers in interface CustomFieldType
Overrides:
getRelatedIndexers in class AbstractCustomFieldType

getVelocityParameters

public Map 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
Overrides:
getVelocityParameters in class AbstractCustomFieldType

convertTypeToString

protected String convertTypeToString(Object value)
Description copied from class: AbstractMultiCFType
Converts a given underlying type to String.

Specified by:
convertTypeToString in class AbstractMultiCFType
Parameters:
value - underlying type
Returns:
string representation of underlying type

convertStringToType

protected Object convertStringToType(String string)
Description copied from class: AbstractMultiCFType
Converts a given String to underlying type

Specified by:
convertStringToType in class AbstractMultiCFType
Parameters:
string - string representation of underlying type
Returns:
underlying type

isMultiple

protected boolean isMultiple()


Copyright © 2002-2006 Atlassian. All Rights Reserved.