com.atlassian.jira.jql.util
Class JqlSelectOptionsUtil

java.lang.Object
  extended by com.atlassian.jira.jql.util.JqlSelectOptionsUtil

@InjectableComponent
public class JqlSelectOptionsUtil
extends java.lang.Object

Contains utility methods for processing select option clauses

Since:
v4.0

Constructor Summary
JqlSelectOptionsUtil(OptionsManager optionsManager, FieldConfigSchemeManager fieldConfigSchemeManager, FieldConfigSchemeClauseContextUtil fieldConfigSchemeClauseContextUtil)
           
 
Method Summary
 Option getOptionById(java.lang.Long optionId)
           
 java.util.List<Option> getOptions(CustomField customField, QueryContext queryContext, QueryLiteral literal, boolean checkOptionIds)
          Returns the options that are represented by the QueryLiteral that are visible in the QueryContext for a particular CustomField.
 java.util.List<Option> getOptions(CustomField customField, QueryLiteral literal, boolean checkOptionIds)
          Returns all the options possible represented by the QueryLiteral for a particular CustomField.
 java.util.List<Option> getOptions(CustomField customField, com.opensymphony.user.User user, QueryLiteral literal, boolean checkOptionIds)
          Returns the options that are represented by the QueryLiteral that are visible to the User on the CustomField.
 java.util.List<Option> getOptionsForScheme(FieldConfigScheme fieldConfigScheme)
          Retreives all the options for the FieldConfigScheme.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JqlSelectOptionsUtil

public JqlSelectOptionsUtil(OptionsManager optionsManager,
                            FieldConfigSchemeManager fieldConfigSchemeManager,
                            FieldConfigSchemeClauseContextUtil fieldConfigSchemeClauseContextUtil)
Method Detail

getOptions

public java.util.List<Option> getOptions(CustomField customField,
                                         QueryContext queryContext,
                                         QueryLiteral literal,
                                         boolean checkOptionIds)
Returns the options that are represented by the QueryLiteral that are visible in the QueryContext for a particular CustomField.

Parameters:
customField - the customField to retreive options from
queryContext - the context to check if the Options are visible in
literal - the literal to search for Options for
checkOptionIds - If true, the method tries to resolve long literals to option Ids before option values, and vice versa for string literals. If false, literals are only resolved to option values.
Returns:
the list of found options, empty literals are ignored; never null.

getOptions

public java.util.List<Option> getOptions(CustomField customField,
                                         com.opensymphony.user.User user,
                                         QueryLiteral literal,
                                         boolean checkOptionIds)
Returns the options that are represented by the QueryLiteral that are visible to the User on the CustomField.

Parameters:
customField - the customField to retreive options from
user - the User to check if the option is visible to
literal - the literal to search for Options for
checkOptionIds - If true, the method tries to resolve long literals to option Ids before option values, and vice versa for string literals. If false, literals are only resolved to option values.
Returns:
the list of found options, empty literals are ignored; never null.

getOptionById

public Option getOptionById(java.lang.Long optionId)
Parameters:
optionId - the id of the option
Returns:
the Option found or null.

getOptions

public java.util.List<Option> getOptions(CustomField customField,
                                         QueryLiteral literal,
                                         boolean checkOptionIds)
Returns all the options possible represented by the QueryLiteral for a particular CustomField.

Parameters:
customField - the customField to retreive options from
literal - the literal to find options for
checkOptionIds - If true, the method tries to resolve long literals to option Ids before option values, and vice versa for string literals. If false, literals are only resolved to option values.
Returns:
the list of found options, it will contain only a single null if the literal is empty.

getOptionsForScheme

public java.util.List<Option> getOptionsForScheme(FieldConfigScheme fieldConfigScheme)
Retreives all the options for the FieldConfigScheme.

Parameters:
fieldConfigScheme - the config scheme to retrieve the options from.
Returns:
the options for the FieldConfigScheme in a mutable List; never null.


Copyright © 2002-2010 Atlassian. All Rights Reserved.