1 16 19 20 package org.apache.xalan.xsltc.dom; 21 22 import java.text.Collator ; 23 import java.util.Locale ; 24 25 import org.apache.xalan.xsltc.CollatorFactory; 26 27 30 public class CollatorFactoryBase implements CollatorFactory { 31 32 public static final Locale DEFAULT_LOCALE = Locale.getDefault(); 33 public static final Collator DEFAULT_COLLATOR = Collator.getInstance(); 34 35 public CollatorFactoryBase() { 36 } 37 38 public Collator getCollator(String lang, String country) { 39 return Collator.getInstance(new Locale (lang, country)); 40 } 41 42 public Collator getCollator(Locale locale) { 43 if (locale == DEFAULT_LOCALE) 44 return DEFAULT_COLLATOR; 45 else 46 return Collator.getInstance(locale); 47 } 48 } 49 | Popular Tags |