com.atlassian.jira.issue.search.searchers.util
Class DefaultIndexedInputHelper<T>

java.lang.Object
  extended by com.atlassian.jira.issue.search.searchers.util.DefaultIndexedInputHelper<T>
All Implemented Interfaces:
IndexedInputHelper
Direct Known Subclasses:
ComponentIndexedInputHelper, IssueConstantIndexedInputHelper, VersionIndexedInputHelper

@NonInjectableComponent
public class DefaultIndexedInputHelper<T>
extends java.lang.Object
implements IndexedInputHelper

The default implementation for the IndexedInputHelper.

This class should be constructed as needed and not injected, as the IndexInfoResolver is only relevant to specific field(s).

Since:
v4.0

Constructor Summary
DefaultIndexedInputHelper(IndexInfoResolver<T> indexInfoResolver, JqlOperandResolver operandResolver, FieldFlagOperandRegistry fieldFlagOperandRegistry, SearchContextVisibilityChecker searchContextVisibilityChecker)
           
 
Method Summary
protected  SingleValueOperand createSingleValueOperandFromId(java.lang.String stringValue)
          Resolve this string representation of a navigator value (known not to be a field flag) into an operand to be used in a clause.
 java.util.Set<java.lang.String> getAllIndexValuesForMatchingClauses(com.opensymphony.user.User searcher, ClauseNames jqlClauseNames, Query query, SearchContext searchContext)
          Retrieves the index values for the clauses in the SearchRequest.
 java.util.Set<java.lang.String> getAllNavigatorValuesForMatchingClauses(com.opensymphony.user.User searcher, ClauseNames jqlClauseNames, Query query, SearchContext searchContext)
          Retreives the navigator id values for the values in the clauses.
 Clause getClauseForNavigatorValues(java.lang.String clauseName, java.util.Set<java.lang.String> values)
          Converts a set of Navigator value strings into a Clause that will match at least one of the specified values for the given field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultIndexedInputHelper

public DefaultIndexedInputHelper(IndexInfoResolver<T> indexInfoResolver,
                                 JqlOperandResolver operandResolver,
                                 FieldFlagOperandRegistry fieldFlagOperandRegistry,
                                 SearchContextVisibilityChecker searchContextVisibilityChecker)
Method Detail

getAllIndexValuesForMatchingClauses

public java.util.Set<java.lang.String> getAllIndexValuesForMatchingClauses(com.opensymphony.user.User searcher,
                                                                           ClauseNames jqlClauseNames,
                                                                           Query query,
                                                                           SearchContext searchContext)
Description copied from interface: IndexedInputHelper
Retrieves the index values for the clauses in the SearchRequest. Function Operands are expanded to their values.

Specified by:
getAllIndexValuesForMatchingClauses in interface IndexedInputHelper
Parameters:
searcher - the user running the search
jqlClauseNames - the names of the clauses on which to retreive the values.
query - the search criteria used to populate the field values holder.
searchContext - the context under which the search is being performed
Returns:
a set of strings containing the index values of the clause values. Never null.

getAllNavigatorValuesForMatchingClauses

public java.util.Set<java.lang.String> getAllNavigatorValuesForMatchingClauses(com.opensymphony.user.User searcher,
                                                                               ClauseNames jqlClauseNames,
                                                                               Query query,
                                                                               SearchContext searchContext)
Description copied from interface: IndexedInputHelper
Retreives the navigator id values for the values in the clauses. If there is a flag associated with a function operand then that flag is returned, otherwise the function operand is expanded to its index values.

Specified by:
getAllNavigatorValuesForMatchingClauses in interface IndexedInputHelper
Parameters:
searcher - the user running the search
jqlClauseNames - the names of the clauses on which to retreive the values.
query - the search criteria used to populate the field values holder.
searchContext - the context under which the search is being performed
Returns:
a set of strings containing the navigator values of the clause values. Never Null.

getClauseForNavigatorValues

public Clause getClauseForNavigatorValues(java.lang.String clauseName,
                                          java.util.Set<java.lang.String> values)
Description copied from interface: IndexedInputHelper
Converts a set of Navigator value strings into a Clause that will match at least one of the specified values for the given field.

Note: where possible, the helper should try to create a clause, even when the value strings do not make sense in the given domain. That is, it is preferred that a non-validating clause gets created than no clause at all.

Specified by:
getClauseForNavigatorValues in interface IndexedInputHelper
Parameters:
clauseName - the name of the clause to generate
values - a set of Navigator value strings; may contain flag values. May not be null.
Returns:
a clause that will match any of the values specified; null if no values were specified.

createSingleValueOperandFromId

protected SingleValueOperand createSingleValueOperandFromId(java.lang.String stringValue)
Resolve this string representation of a navigator value (known not to be a field flag) into an operand to be used in a clause. Override this to provide domain-specific resolution (e.g. resolve version ids to names).

Parameters:
stringValue - the navigator value as a string e.g. 123
Returns:
the operand which best represents this navigator value - either a string name or the id or whatever.


Copyright © 2002-2011 Atlassian. All Rights Reserved.