public class MockNavigableField extends Object implements NavigableField, Comparable
ORDER_ASCENDING, ORDER_DESCENDING, TEMPLATE_DIRECTORY_PATH
Constructor and Description |
---|
MockNavigableField(String id) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Object o) |
boolean |
equals(Object o) |
String |
getColumnCssClass() |
String |
getColumnHeadingKey() |
String |
getColumnViewHtml(FieldLayoutItem fieldLayoutItem,
Map displayParams,
Issue issue) |
String |
getDefaultSortOrder()
The order in which to sort the field when it is sorted for the first time.
|
String |
getHiddenFieldId()
Returns the id of the field to check for visibility.
|
String |
getId()
The unique id of the field
|
String |
getName()
Returns i18n'ed name of the field.
|
String |
getNameKey()
The i18n key that is used to lookup the field's name when it is displayed
|
org.apache.lucene.search.FieldComparatorSource |
getSortComparatorSource()
A sortComparatorSource object to be used for sorting columns in a table.
|
LuceneFieldSorter |
getSorter()
A sorter to be used when sorting columns in a table.
|
List<org.apache.lucene.search.SortField> |
getSortFields(boolean sortOrder)
Return a list of Lucene SortFields to be used for sorting search results.
|
int |
hashCode() |
String |
prettyPrintChangeHistory(String changeHistory) |
String |
prettyPrintChangeHistory(String changeHistory,
I18nHelper i18nHelper)
Used for email notification templates - allows changelog to be displayed in language of the recipient.
|
public MockNavigableField(String id)
public String getColumnHeadingKey()
getColumnHeadingKey
in interface NavigableField
public String getColumnCssClass()
getColumnCssClass
in interface NavigableField
public String getDefaultSortOrder()
NavigableField
getDefaultSortOrder
in interface NavigableField
NavigableField.ORDER_ASCENDING
or NavigableField.ORDER_DESCENDING
public org.apache.lucene.search.FieldComparatorSource getSortComparatorSource()
NavigableField
MappedSortComparator
using the NavigableField.getSorter()
method. However, fields can provide any sorting mechanism that they wish.
If a field can be sorted directly using terms in the Lucene index then the field should implement NavigableField.getSortFields(boolean sortOrder)
rather than this method.
In large installations custom sorting may incur a maor performance penalty.
getSortComparatorSource
in interface NavigableField
public List<org.apache.lucene.search.SortField> getSortFields(boolean sortOrder)
NavigableField
Using this method allows the field to specify the most performant way to perform a search. If a field can be sorted directly using the term in the index then this should just return a singleton list with the sort field.
return Collections.singletonList(new SortField(fieldName, sortOrder));
The default implementation builds this using the FieldComparatorSource returned by NavigableField.getSortComparatorSource()
If you implement this method there is no need to implement NavigableField.getSortComparatorSource()
.
getSortFields
in interface NavigableField
public LuceneFieldSorter getSorter()
NavigableField
getSorter
in interface NavigableField
NavigableField.getSortComparatorSource()
DocumentIssueImpl
,
MappedSortComparator
public String getColumnViewHtml(FieldLayoutItem fieldLayoutItem, Map displayParams, Issue issue)
getColumnViewHtml
in interface NavigableField
public String getHiddenFieldId()
NavigableField
getHiddenFieldId
in interface NavigableField
public String prettyPrintChangeHistory(String changeHistory)
prettyPrintChangeHistory
in interface NavigableField
public String prettyPrintChangeHistory(String changeHistory, I18nHelper i18nHelper)
NavigableField
prettyPrintChangeHistory
in interface NavigableField
public String getNameKey()
Field
getNameKey
in interface Field
public String getName()
Field
public int compareTo(Object o)
compareTo
in interface Comparable
Copyright © 2002-2017 Atlassian. All Rights Reserved.