Package org.dspace.sort
Class AbstractTextFilterOFD
- java.lang.Object
-
- org.dspace.sort.AbstractTextFilterOFD
-
- All Implemented Interfaces:
OrderFormatDelegate
- Direct Known Subclasses:
OrderFormatAuthor,OrderFormatText,OrderFormatTitle,OrderFormatTitleMarc21
public abstract class AbstractTextFilterOFD extends Object implements OrderFormatDelegate
Helper class for creating order delegates. To configure the filters create a subclass and, in an object initializer, create an array of classes that implement TextFilter: class MyLocaleDelegate extends AbstractTextFilterOFD { { filters = new TextFilter[] { new LocaleOrderingFilter(); } } } The order they are in the array, is the order that they are executed. (this may be important for some filters - read their documentation!) Example configurations that could be used: { new DecomposeDiactritics(), new StripDiacritics(), new LowerCaseAndTrim() } - Decompose and then strip the diacritics, lowercase and trim the string. { new MARC21InitialArticleWord(), new DecomposeDiactritics(), new LowerCaseTrim() } - Parse the initial article words based on the Library of Congress list of definite/indefinite article words, decompose diacritics, and lowercase/trim. { new LowerCaseTrim(), new LocaleOrderingFilter() } - Lowercase the string, then make a locale dependent sort text (note that the sort text is not human readable)- Author:
- Graham Triggs
-
-
Field Summary
Fields Modifier and Type Field Description protected TextFilter[]filters
-
Constructor Summary
Constructors Constructor Description AbstractTextFilterOFD()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringmakeSortString(String value, String language)Prepare the appropriate sort string for the given value in the given language.
-
-
-
Field Detail
-
filters
protected TextFilter[] filters
-
-
Method Detail
-
makeSortString
public String makeSortString(String value, String language)
Prepare the appropriate sort string for the given value in the given language. Language should be supplied with the ISO-6390-1 or ISO-639-2 standards. For example "en" or "eng".- Specified by:
makeSortStringin interfaceOrderFormatDelegate- Parameters:
value- the string valuelanguage- the language to interpret in- Returns:
- the sort string
-
-