com.atlassian.jira.issue.customfields.searchers
Class BaseCustomFieldSearcher

java.lang.Object
  extended by com.atlassian.jira.issue.customfields.searchers.BaseCustomFieldSearcher
All Implemented Interfaces:
CustomFieldSearcher, Field, IssueSearcher, Comparable
Direct Known Subclasses:
AbstractCustomFieldSearcher

public abstract class BaseCustomFieldSearcher
extends Object
implements CustomFieldSearcher

This is the recommended extension point for CustomFieldSearcher since JIRA 3.3. It offers basic functionality typical to custom field searchers.

Since:
JIRA 3.3

Field Summary
protected  JiraAuthenticationContext authenticationContext
           
protected  CustomField customField
           
protected  CustomFieldSearcherModuleDescriptor descriptor
           
protected static org.apache.log4j.Logger log
           
 
Fields inherited from interface com.atlassian.jira.issue.search.searchers.IssueSearcher
I18N_BUNDLE
 
Constructor Summary
BaseCustomFieldSearcher(FieldVisibilityBean fieldVisibilityBean)
           
 
Method Summary
 int compareTo(Object o)
           
 CustomFieldSearcherModuleDescriptor getDescriptor()
           
 String getId()
          The unique id of the field
 String getName()
          Returns i18n'ed name of the field for system fields or the name of a custom field.
 String getNameKey()
          The i18n key that is used to lookup the field's name when it is displayed
 Object getStringValue(CustomField customField, FieldValuesHolder fieldValuesHolder)
           
 Object getValue(CustomField customField, FieldValuesHolder fieldValuesHolder)
           
 void init(CustomFieldSearcherModuleDescriptor customFieldSearcherModuleDescriptor)
           
 void init(SearchableField field)
          Initialises the searcher with a given field.
 boolean isShown(SearchContext searchContext)
          Checks if the searcher should be shown in this context
 void register(SearcherRegistry registry)
          Registers the searcher in the registry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.jira.issue.search.searchers.IssueSearcher
getEditHtml, getQuerySnippet, getRelatedIndexers, getViewHtml, isRevelentForSeachRequest, populateFromParams, populateFromSearchRequest, populateSearchRequest, validateParams
 

Field Detail

log

protected static final org.apache.log4j.Logger log

descriptor

protected CustomFieldSearcherModuleDescriptor descriptor

customField

protected CustomField customField

authenticationContext

protected final JiraAuthenticationContext authenticationContext
Constructor Detail

BaseCustomFieldSearcher

public BaseCustomFieldSearcher(FieldVisibilityBean fieldVisibilityBean)
Method Detail

init

public void init(CustomFieldSearcherModuleDescriptor customFieldSearcherModuleDescriptor)
Specified by:
init in interface CustomFieldSearcher

getDescriptor

public CustomFieldSearcherModuleDescriptor getDescriptor()
Specified by:
getDescriptor in interface CustomFieldSearcher

getStringValue

public Object getStringValue(CustomField customField,
                             FieldValuesHolder fieldValuesHolder)
Specified by:
getStringValue in interface CustomFieldSearcher

getValue

public Object getValue(CustomField customField,
                       FieldValuesHolder fieldValuesHolder)
Specified by:
getValue in interface CustomFieldSearcher

getId

public String getId()
Description copied from interface: Field
The unique id of the field

Specified by:
getId in interface Field

getNameKey

public String getNameKey()
Description copied from interface: Field
The i18n key that is used to lookup the field's name when it is displayed

Specified by:
getNameKey in interface Field

getName

public String getName()
Description copied from interface: Field
Returns i18n'ed name of the field for system fields or the name of a custom field.

Specified by:
getName in interface Field

register

public void register(SearcherRegistry registry)
Description copied from interface: IssueSearcher
Registers the searcher in the registry. This enables the searcher to have customised behaviours for duplicate duplicate searchers. e.g. the Query searchers could register multiple fields to just one searcher instance, whereas other searchers would simply have multiple instances of the same field.

Specified by:
register in interface IssueSearcher
Parameters:
registry - The Searcher registry

init

public void init(SearchableField field)
Description copied from interface: IssueSearcher
Initialises the searcher with a given field.

Specified by:
init in interface IssueSearcher
Parameters:
field - the field object. This may be null. (So you can have searchers on non-fields)

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable

isShown

public boolean isShown(SearchContext searchContext)
Description copied from interface: IssueSearcher
Checks if the searcher should be shown in this context

Specified by:
isShown in interface IssueSearcher
Parameters:
searchContext - the context of the search (i.e. projects and issue types selected)
Returns:
true if the searcher will appear in the issue navigator


Copyright © 2002-2007 Atlassian. All Rights Reserved.