org.itracker.services.util
Class CustomFieldUtilities

java.lang.Object
  extended by org.itracker.services.util.CustomFieldUtilities

public class CustomFieldUtilities
extends Object


Field Summary
static String DATE_FORMAT_DATEONLY
           
static String DATE_FORMAT_FULL
           
static String DATE_FORMAT_TIMEONLY
           
static String DATE_FORMAT_UNKNOWN
           
 
Constructor Summary
CustomFieldUtilities()
           
 
Method Summary
static String getCustomFieldLabelKey(Integer fieldId)
          Returns the label key for a particular custom field.
static String getCustomFieldName(Integer fieldId)
          Returns the label for a custom field in the default locale.
static String getCustomFieldName(Integer fieldId, Locale locale)
          Returns the label for a custom field in the specified locale.
static CustomFieldValue getCustomFieldOptionByValue(List<CustomFieldValue> fields, String value)
           
static String getCustomFieldOptionLabelKey(Integer fieldId, Integer optionId)
          Returns the label key for a particular custom field option.
static String getCustomFieldOptionName(CustomField field, String value, Locale locale)
           
static String getCustomFieldOptionName(CustomFieldValue option, Locale locale)
           
static String getCustomFieldOptionName(Integer fieldId, Integer optionId)
          Returns the label for a custom field option in the default locale.
static String getCustomFieldOptionName(Integer fieldId, Integer optionId, Locale locale)
          Returns the label for a custom field option in the specified locale.
static String getCustomFieldOptionName(IssueField field, Locale locale)
           
static String getTypeString(CustomField.Type type)
          Returns the string representation of a field type.
static String getTypeString(CustomField.Type type, Locale locale)
          Returns the string representation of a field type.
static String getTypeString(int code, Locale locale)
          Returns the string representation of a field type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATE_FORMAT_UNKNOWN

public static final String DATE_FORMAT_UNKNOWN
See Also:
Constant Field Values

DATE_FORMAT_FULL

public static final String DATE_FORMAT_FULL
See Also:
Constant Field Values

DATE_FORMAT_DATEONLY

public static final String DATE_FORMAT_DATEONLY
See Also:
Constant Field Values

DATE_FORMAT_TIMEONLY

public static final String DATE_FORMAT_TIMEONLY
See Also:
Constant Field Values
Constructor Detail

CustomFieldUtilities

public CustomFieldUtilities()
Method Detail

getTypeString

public static String getTypeString(CustomField.Type type)
Returns the string representation of a field type.

Parameters:
type - the type to translate
Returns:
a string representation of the field type translated to the specified locale

getTypeString

public static String getTypeString(int code,
                                   Locale locale)
Returns the string representation of a field type

Parameters:
code - type code to translate
locale - the locale to translate the type into
Returns:
a string representation of the field type translated to the default locale

getTypeString

public static String getTypeString(CustomField.Type type,
                                   Locale locale)
Returns the string representation of a field type.

Parameters:
type - the type to translate
locale - the locale to translate the type into
Returns:
a string representation of the field type translated to the default locale

getCustomFieldLabelKey

public static String getCustomFieldLabelKey(Integer fieldId)
Returns the label key for a particular custom field. This is made up of a static part and the unique value of the custom field.

Parameters:
fieldId - the CustomField id to return the label key for
Returns:
the label key for the field

getCustomFieldOptionLabelKey

public static String getCustomFieldOptionLabelKey(Integer fieldId,
                                                  Integer optionId)
Returns the label key for a particular custom field option. This is made up of a static part and the unique value of the custom field option.

Parameters:
fieldId - the CustomField id to return the label key for
optionId - the CustomField option's id to return the label key for
Returns:
the label key for the field option

getCustomFieldName

public static String getCustomFieldName(Integer fieldId)
Returns the label for a custom field in the default locale.

Parameters:
fieldId - the id of the field to return the label for
Returns:
the label for the field translated to the default locale

getCustomFieldName

public static String getCustomFieldName(Integer fieldId,
                                        Locale locale)
Returns the label for a custom field in the specified locale.

Parameters:
fieldId - the id of the field to return the label for
locale - the locale to return the label for
Returns:
the label for the field translated to the specified locale

getCustomFieldOptionName

public static String getCustomFieldOptionName(Integer fieldId,
                                              Integer optionId)
Returns the label for a custom field option in the default locale.

Parameters:
fieldId - the id of the field to return the label for
optionId - the id of the field option to return the label for
Returns:
the label for the field option translated to the default locale

getCustomFieldOptionName

public static String getCustomFieldOptionName(Integer fieldId,
                                              Integer optionId,
                                              Locale locale)
Returns the label for a custom field option in the specified locale.

Parameters:
fieldId - the id of the field to return the label for
optionId - the id of the field option to return the label for
locale - the locale to return the label for
Returns:
the label for the field option translated to the default locale

getCustomFieldOptionName

public static final String getCustomFieldOptionName(CustomFieldValue option,
                                                    Locale locale)

getCustomFieldOptionByValue

public static final CustomFieldValue getCustomFieldOptionByValue(List<CustomFieldValue> fields,
                                                                 String value)

getCustomFieldOptionName

public static final String getCustomFieldOptionName(CustomField field,
                                                    String value,
                                                    Locale locale)

getCustomFieldOptionName

public static final String getCustomFieldOptionName(IssueField field,
                                                    Locale locale)


Copyright © 2002-2012 itracker. All Rights Reserved.