org.apache.commons.beanutils.locale

Class LocaleConvertUtils

public class LocaleConvertUtils extends Object

Utility methods for converting locale-sensitive String scalar values to objects of the specified Class, String arrays to arrays of the specified Class and object to locale-sensitive String scalar value.

The implementations for these method are provided by LocaleConvertUtilsBean. These static utility method use the default instance. More sophisticated can be provided by using a LocaleConvertUtilsBean instance.

Author: Yauheny Mikulski

Method Summary
static Stringconvert(Object value)

Convert the specified locale-sensitive value into a String.

For more details see LocaleConvertUtilsBean

static Stringconvert(Object value, String pattern)

Convert the specified locale-sensitive value into a String using the convertion pattern.

For more details see LocaleConvertUtilsBean

static Stringconvert(Object value, Locale locale, String pattern)

Convert the specified locale-sensitive value into a String using the paticular convertion pattern.

For more details see LocaleConvertUtilsBean

static Objectconvert(String value, Class clazz)

Convert the specified value to an object of the specified class (if possible).

static Objectconvert(String value, Class clazz, String pattern)

Convert the specified value to an object of the specified class (if possible) using the convertion pattern.

static Objectconvert(String value, Class clazz, Locale locale, String pattern)

Convert the specified value to an object of the specified class (if possible) using the convertion pattern.

static Objectconvert(String[] values, Class clazz, String pattern)

Convert an array of specified values to an array of objects of the specified class (if possible) using the convertion pattern.

For more details see LocaleConvertUtilsBean

static Objectconvert(String[] values, Class clazz)

Convert an array of specified values to an array of objects of the specified class (if possible).

For more details see LocaleConvertUtilsBean

static Objectconvert(String[] values, Class clazz, Locale locale, String pattern)

Convert an array of specified values to an array of objects of the specified class (if possible) using the convertion pattern.

For more details see LocaleConvertUtilsBean

protected static FastHashMapcreate(Locale locale)

Create all LocaleConverter types for specified locale.

For more details see LocaleConvertUtilsBean

static voidderegister()

Remove any registered LocaleConverter.

For more details see LocaleConvertUtilsBean

static voidderegister(Locale locale)

Remove any registered LocaleConverter for the specified locale.

For more details see LocaleConvertUtilsBean

static voidderegister(Class clazz, Locale locale)

Remove any registered LocaleConverter for the specified locale and Class.

For more details see LocaleConvertUtilsBean

static booleangetApplyLocalized()

Gets applyLocalized.

For more details see LocaleConvertUtilsBean

static LocalegetDefaultLocale()

Gets the Locale which will be used when no Locale is passed to a method.

For more details see LocaleConvertUtilsBean

static LocaleConverterlookup(Class clazz, Locale locale)

Look up and return any registered LocaleConverter for the specified destination class and locale; if there is no registered Converter, return null.

For more details see LocaleConvertUtilsBean

protected static FastHashMaplookup(Locale locale)

Look up and return any registered FastHashMap instance for the specified locale.

For more details see LocaleConvertUtilsBean

static voidregister(LocaleConverter converter, Class clazz, Locale locale)

Register a custom LocaleConverter for the specified destination Class, replacing any previously registered converter.

For more details see LocaleConvertUtilsBean

static voidsetApplyLocalized(boolean newApplyLocalized)

Sets applyLocalized.

For more details see LocaleConvertUtilsBean

static voidsetDefaultLocale(Locale locale)

Sets the Locale which will be used when no Locale is passed to a method.

For more details see LocaleConvertUtilsBean

Method Detail

convert

public static String convert(Object value)

Convert the specified locale-sensitive value into a String.

For more details see LocaleConvertUtilsBean

See Also: convert

convert

public static String convert(Object value, String pattern)

Convert the specified locale-sensitive value into a String using the convertion pattern.

For more details see LocaleConvertUtilsBean

See Also: LocaleConvertUtilsBean

convert

public static String convert(Object value, Locale locale, String pattern)

Convert the specified locale-sensitive value into a String using the paticular convertion pattern.

For more details see LocaleConvertUtilsBean

See Also: LocaleConvertUtilsBean

convert

public static Object convert(String value, Class clazz)

Convert the specified value to an object of the specified class (if possible). Otherwise, return a String representation of the value.

For more details see LocaleConvertUtilsBean

See Also: LocaleConvertUtilsBean

convert

public static Object convert(String value, Class clazz, String pattern)

Convert the specified value to an object of the specified class (if possible) using the convertion pattern. Otherwise, return a String representation of the value.

For more details see LocaleConvertUtilsBean

See Also: LocaleConvertUtilsBean

convert

public static Object convert(String value, Class clazz, Locale locale, String pattern)

Convert the specified value to an object of the specified class (if possible) using the convertion pattern. Otherwise, return a String representation of the value.

For more details see LocaleConvertUtilsBean

See Also: LocaleConvertUtilsBean

convert

public static Object convert(String[] values, Class clazz, String pattern)

Convert an array of specified values to an array of objects of the specified class (if possible) using the convertion pattern.

For more details see LocaleConvertUtilsBean

See Also: (String[], Class, String)

convert

public static Object convert(String[] values, Class clazz)

Convert an array of specified values to an array of objects of the specified class (if possible).

For more details see LocaleConvertUtilsBean

See Also: (String[], Class)

convert

public static Object convert(String[] values, Class clazz, Locale locale, String pattern)

Convert an array of specified values to an array of objects of the specified class (if possible) using the convertion pattern.

For more details see LocaleConvertUtilsBean

See Also: (String[], Class, Locale, String)

create

protected static FastHashMap create(Locale locale)

Create all LocaleConverter types for specified locale.

For more details see LocaleConvertUtilsBean

See Also: create

deregister

public static void deregister()

Remove any registered LocaleConverter.

For more details see LocaleConvertUtilsBean

See Also: deregister

deregister

public static void deregister(Locale locale)

Remove any registered LocaleConverter for the specified locale.

For more details see LocaleConvertUtilsBean

See Also: deregister

deregister

public static void deregister(Class clazz, Locale locale)

Remove any registered LocaleConverter for the specified locale and Class.

For more details see LocaleConvertUtilsBean

See Also: LocaleConvertUtilsBean

getApplyLocalized

public static boolean getApplyLocalized()

Gets applyLocalized.

For more details see LocaleConvertUtilsBean

See Also: getApplyLocalized

getDefaultLocale

public static Locale getDefaultLocale()

Gets the Locale which will be used when no Locale is passed to a method.

For more details see LocaleConvertUtilsBean

See Also: getDefaultLocale

lookup

public static LocaleConverter lookup(Class clazz, Locale locale)

Look up and return any registered LocaleConverter for the specified destination class and locale; if there is no registered Converter, return null.

For more details see LocaleConvertUtilsBean

See Also: LocaleConvertUtilsBean

lookup

protected static FastHashMap lookup(Locale locale)

Look up and return any registered FastHashMap instance for the specified locale.

For more details see LocaleConvertUtilsBean

See Also: lookup

register

public static void register(LocaleConverter converter, Class clazz, Locale locale)

Register a custom LocaleConverter for the specified destination Class, replacing any previously registered converter.

For more details see LocaleConvertUtilsBean

See Also: LocaleConvertUtilsBean

setApplyLocalized

public static void setApplyLocalized(boolean newApplyLocalized)

Sets applyLocalized.

For more details see LocaleConvertUtilsBean

See Also: LocaleConvertUtilsBean

setDefaultLocale

public static void setDefaultLocale(Locale locale)

Sets the Locale which will be used when no Locale is passed to a method.

For more details see LocaleConvertUtilsBean

See Also: setDefaultLocale

Copyright (c) 2001-2004 - Apache Software Foundation