com.atlassian.jira.issue.search
Class SearchHandler

java.lang.Object
  extended by com.atlassian.jira.issue.search.SearchHandler

@PublicApi
public final class SearchHandler
extends Object

Object used by the field to indicate how it can be searched and indexed.

The field controls how JIRA indexes an issue by specifying a list of FieldIndexers.

Each JQL clause in JIRA is represented by a SearchHandler.ClauseRegistration. It consists of a set of JQL names and the ClauseHandler that can be used to process those JQL names in a query.

Each field *may* have one IssueSearcher that uses a list of JQL clauses to create a JQL search. This is specified in the SearchHandler.SearcherRegistration on the SearchHandler. JIRA will keep the association between the IssueSearcher and JQL clauses (ClasuseHandler) to perform the mapping from JQL to the GUI version of Issue Navigator. Listing ClauseHandlers in the SearcherRegistration that are not related to the IssueSearcher may result JIRA falsely determining that a JQL query cannot be represented on the navigator GUI. Note that the JQL clauses listed in the SearcherRegistration will also be available directly in JQL.

The field may also have another set of JQL clauses that can be used against the field but are not associated with any IssueSearcher. The clauses are held in the list of ClauseRegistrations on the ClauseHandler itself. These JQL clauses cannot be represented on navigtor as they have no IssueSearcher.

The same ClauseHandler should not be listed in both the SearcherRegistration and the SearchHandler directly. Doing so could result in doing JIRA performing the same search twice.

Since:
v4.0

Nested Class Summary
static class SearchHandler.ClauseRegistration
          Represents a JQL clause and how to process it.
static class SearchHandler.SearcherRegistration
          Holds the link between an IssueSearcher and the JQL clauses (as SearchHandler.ClauseRegistrations) that it uses in the background to implement searching.
 
Constructor Summary
SearchHandler(List<FieldIndexer> fieldIndexers, SearchHandler.SearcherRegistration searcherRegistration)
          Create a new handler with the passed FieldIndexers and SearchHandler.SearcherRegistration.
SearchHandler(List<FieldIndexer> fieldIndexers, SearchHandler.SearcherRegistration searcherRegistration, List<SearchHandler.ClauseRegistration> clauseRegistrations)
          Create a new handler.
 
Method Summary
 boolean equals(Object o)
           
 List<SearchHandler.ClauseRegistration> getClauseRegistrations()
          The list of JQL clauses provided for searching.
 List<FieldIndexer> getIndexers()
          The list of indexers that will JIRA will use to index the field.
 SearchHandler.SearcherRegistration getSearcherRegistration()
          The SearchHandler.SearcherRegistration provided for searching.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SearchHandler

public SearchHandler(List<FieldIndexer> fieldIndexers,
                     SearchHandler.SearcherRegistration searcherRegistration,
                     List<SearchHandler.ClauseRegistration> clauseRegistrations)
Create a new handler.

Parameters:
fieldIndexers - the indexers to associate with the handler. May not be null.
searcherRegistration - the registration to associate with the handler. May be null.
clauseRegistrations - the JQL clauses to associate with the chanler. May not be null.

SearchHandler

public SearchHandler(List<FieldIndexer> fieldIndexers,
                     SearchHandler.SearcherRegistration searcherRegistration)
Create a new handler with the passed FieldIndexers and SearchHandler.SearcherRegistration. Same as calling this(fieldIndexers, searcherRegistration,Collections.<ClauseRegistration>emptyList());

Parameters:
fieldIndexers - the indexers to associate with the handler.
searcherRegistration - the searcher (and its associated clauses) to associate with the handler. May be null.
Method Detail

getIndexers

public List<FieldIndexer> getIndexers()
The list of indexers that will JIRA will use to index the field.

Returns:
the list of indexers that will process this field.

getClauseRegistrations

public List<SearchHandler.ClauseRegistration> getClauseRegistrations()
The list of JQL clauses provided for searching. These JQL clauses are not associated with any IssueSearcher and as such cannot be represented on the GUI version of the Issue Navigator.

Returns:
the list of JQL clauses provided for searching. Cannot be null.

getSearcherRegistration

public SearchHandler.SearcherRegistration getSearcherRegistration()
The SearchHandler.SearcherRegistration provided for searching.

Returns:
The SearchHandler.SearcherRegistration provided for searching. Null may be returned to indicate that there is no IssueSearcher associated with this handler.

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2002-2012 Atlassian. All Rights Reserved.