org.dspace.sort
Class AbstractTextFilterOFD

java.lang.Object
  extended by 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
protected  TextFilter[] filters
           
 
Constructor Summary
AbstractTextFilterOFD()
           
 
Method Summary
 String makeSortString(String value, String language)
          Prepare the appropriate sort string for the given value in the given language.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

filters

protected TextFilter[] filters
Constructor Detail

AbstractTextFilterOFD

public AbstractTextFilterOFD()
Method Detail

makeSortString

public String makeSortString(String value,
                             String language)
Prepare the appropriate sort string for the given value in the given language. Languate should be supplied with the ISO-6390-1 or ISO-639-2 standards. For example "en" or "eng".

Specified by:
makeSortString in interface OrderFormatDelegate
Parameters:
value - the string value
language - the language to interpret in


Copyright © 2010 DuraSpace. All Rights Reserved.