m_sorter = context.getEngine().getPageSorter();
}
else if( order.equalsIgnoreCase( PARAM_SORTORDER_JAVA ) )
{
// use Java "natural" ordering
m_sorter = new PageSorter( JavaNaturalComparator.DEFAULT_JAVA_COMPARATOR );
}
else if( order.equalsIgnoreCase( PARAM_SORTORDER_LOCALE ) )
{
// use this locale's ordering
m_sorter = new PageSorter( LocaleComparator.DEFAULT_LOCALE_COMPARATOR );
}
else if( order.equalsIgnoreCase( PARAM_SORTORDER_HUMAN ) )
{
// use human ordering
m_sorter = new PageSorter( HumanComparator.DEFAULT_HUMAN_COMPARATOR );
}
else
try
{
Collator collator = new RuleBasedCollator( order );
collator.setStrength( Collator.PRIMARY );
m_sorter = new PageSorter( new CollatorComparator( collator ) );
}
catch( ParseException pe )
{
log.info( "Failed to parse requested collator - using default ordering", pe );
m_sorter = context.getEngine().getPageSorter();