1 16 17 package org.apache.commons.beanutils.locale; 18 19 import org.apache.commons.collections.FastHashMap; 20 21 import java.util.Locale ; 22 23 34 public class LocaleConvertUtils { 35 36 38 46 public static Locale getDefaultLocale() { 47 48 return LocaleConvertUtilsBean.getInstance().getDefaultLocale(); 49 } 50 51 59 public static void setDefaultLocale(Locale locale) { 60 61 LocaleConvertUtilsBean.getInstance().setDefaultLocale(locale); 62 } 63 64 71 public static boolean getApplyLocalized() { 72 return LocaleConvertUtilsBean.getInstance().getApplyLocalized(); 73 } 74 75 82 public static void setApplyLocalized(boolean newApplyLocalized) { 83 LocaleConvertUtilsBean.getInstance().setApplyLocalized(newApplyLocalized); 84 } 85 86 88 95 public static String convert(Object value) { 96 return LocaleConvertUtilsBean.getInstance().convert(value); 97 } 98 99 107 public static String convert(Object value, String pattern) { 108 return LocaleConvertUtilsBean.getInstance().convert(value, pattern); 109 } 110 111 119 public static String convert(Object value, Locale locale, String pattern) { 120 121 return LocaleConvertUtilsBean.getInstance().convert(value, locale, pattern); 122 } 123 124 132 public static Object convert(String value, Class clazz) { 133 134 return LocaleConvertUtilsBean.getInstance().convert(value, clazz); 135 } 136 137 146 public static Object convert(String value, Class clazz, String pattern) { 147 148 return LocaleConvertUtilsBean.getInstance().convert(value, clazz, pattern); 149 } 150 151 160 public static Object convert(String value, Class clazz, Locale locale, String pattern) { 161 162 return LocaleConvertUtilsBean.getInstance().convert(value, clazz, locale, pattern); 163 } 164 165 173 public static Object convert(String values[], Class clazz, String pattern) { 174 175 return LocaleConvertUtilsBean.getInstance().convert(values, clazz, pattern); 176 } 177 178 186 public static Object convert(String values[], Class clazz) { 187 188 return LocaleConvertUtilsBean.getInstance().convert(values, clazz); 189 } 190 191 199 public static Object convert(String values[], Class clazz, Locale locale, String pattern) { 200 201 return LocaleConvertUtilsBean.getInstance().convert(values, clazz, locale, pattern); 202 } 203 204 212 public static void register(LocaleConverter converter, Class clazz, Locale locale) { 213 214 LocaleConvertUtilsBean.getInstance().register(converter, clazz, locale); 215 } 216 217 224 public static void deregister() { 225 226 LocaleConvertUtilsBean.getInstance().deregister(); 227 } 228 229 230 237 public static void deregister(Locale locale) { 238 239 LocaleConvertUtilsBean.getInstance().deregister(locale); 240 } 241 242 243 250 public static void deregister(Class clazz, Locale locale) { 251 252 LocaleConvertUtilsBean.getInstance().deregister(clazz, locale); 253 } 254 255 264 public static LocaleConverter lookup(Class clazz, Locale locale) { 265 266 return LocaleConvertUtilsBean.getInstance().lookup(clazz, locale); 267 } 268 269 276 protected static FastHashMap lookup(Locale locale) { 277 return LocaleConvertUtilsBean.getInstance().lookup(locale); 278 } 279 280 287 protected static FastHashMap create(Locale locale) { 288 289 return LocaleConvertUtilsBean.getInstance().create(locale); 290 } 291 } 292 | Popular Tags |