java.lang.Object | |
↳ | org.apache.commons.beanutils.locale.LocaleConvertUtilsBean |
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.
This class provides the implementations used by the static utility methods in
LocaleConvertUtils
.
The actual LocaleConverter
instance to be used
can be registered for each possible destination Class. Unless you override them, standard
LocaleConverter
instances are provided for all of the following
destination Classes:
For backwards compatibility, the standard locale converters
for primitive types (and the corresponding wrapper classes).
If you prefer to have another LocaleConverter
thrown instead, replace the standard LocaleConverter
instances
with ones created with the one of the appropriate constructors.
It's important that LocaleConverter
should be registered for
the specified locale and Class (or primitive type).
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Makes the state by default (deregisters all converters for all locales)
and then registers default locale converters.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Convert the specified value to an object of the specified class (if
possible) using the convertion pattern.
| |||||||||||
Convert an array of specified values to an array of objects of the
specified class (if possible) using the convertion pattern.
| |||||||||||
Convert the specified value to an object of the specified class (if
possible) using the convertion pattern.
| |||||||||||
Convert the specified locale-sensitive value into a String
using the conversion pattern.
| |||||||||||
Convert the specified locale-sensitive value into a String.
| |||||||||||
Convert the specified value to an object of the specified class (if
possible).
| |||||||||||
Convert an array of specified values to an array of objects of the
specified class (if possible) .
| |||||||||||
Convert an array of specified values to an array of objects of the
specified class (if possible) using the convertion pattern.
| |||||||||||
Convert the specified locale-sensitive value into a String
using the paticular convertion pattern.
| |||||||||||
Remove any registered
LocaleConverter for the specified locale and Class. | |||||||||||
Remove any registered
LocaleConverter for the specified locale | |||||||||||
Remove any registered
LocaleConverter . | |||||||||||
getter for applyLocalized
| |||||||||||
getter for defaultLocale.
| |||||||||||
Gets singleton instance.
| |||||||||||
Look up and return any registered
LocaleConverter for the specified
destination class and locale; if there is no registered Converter, return
null . | |||||||||||
Register a custom
LocaleConverter for the specified destination
Class , replacing any previously registered converter. | |||||||||||
setter for applyLocalized
| |||||||||||
setter for defaultLocale.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This method is deprecated.
This method will be modified to return a Map in the next release.
| |||||||||||
This method is deprecated.
This method will be modified to return a Map in the next release.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Makes the state by default (deregisters all converters for all locales) and then registers default locale converters.
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.
value | The String scalar value to be converted |
---|---|
clazz | The Data type to which this value should be converted. |
pattern | The convertion pattern |
ConversionException | if thrown by an underlying Converter |
---|
Convert an array of specified values to an array of objects of the specified class (if possible) using the convertion pattern.
values | Value to be converted (may be null) |
---|---|
clazz | Java array or element class to be converted to |
locale | The locale |
pattern | The convertion pattern |
ConversionException | if thrown by an underlying Converter |
---|
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.
value | The String scalar value to be converted |
---|---|
clazz | The Data type to which this value should be converted. |
locale | The locale |
pattern | The convertion pattern |
ConversionException | if thrown by an underlying Converter |
---|
Convert the specified locale-sensitive value into a String using the conversion pattern.
value | The Value to be converted |
---|---|
pattern | The convertion pattern |
ConversionException | if thrown by an underlying Converter |
---|
Convert the specified locale-sensitive value into a String.
value | The Value to be converted |
---|
ConversionException | if thrown by an underlying Converter |
---|
Convert the specified value to an object of the specified class (if possible). Otherwise, return a String representation of the value.
value | The String scalar value to be converted |
---|---|
clazz | The Data type to which this value should be converted. |
ConversionException | if thrown by an underlying Converter |
---|
Convert an array of specified values to an array of objects of the specified class (if possible) .
values | Value to be converted (may be null) |
---|---|
clazz | Java array or element class to be converted to |
ConversionException | if thrown by an underlying Converter |
---|
Convert an array of specified values to an array of objects of the specified class (if possible) using the convertion pattern.
values | Value to be converted (may be null) |
---|---|
clazz | Java array or element class to be converted to |
pattern | The convertion pattern |
ConversionException | if thrown by an underlying Converter |
---|
Convert the specified locale-sensitive value into a String using the paticular convertion pattern.
value | The Value to be converted |
---|---|
locale | The locale |
pattern | The convertion pattern |
ConversionException | if thrown by an underlying Converter |
---|
Remove any registered LocaleConverter
for the specified locale and Class.
clazz | Class for which to remove a registered Converter |
---|---|
locale | The locale |
Remove any registered LocaleConverter
for the specified locale
locale | The locale |
---|
getter for applyLocalized
true
if pattern is localized,
otherwise false
Gets singleton instance.
This is the same as the instance used by the default LocaleBeanUtilsBean
singleton.
Look up and return any registered LocaleConverter
for the specified
destination class and locale; if there is no registered Converter, return
null
.
clazz | Class for which to return a registered Converter |
---|---|
locale | The Locale |
Register a custom LocaleConverter
for the specified destination
Class
, replacing any previously registered converter.
converter | The LocaleConverter to be registered |
---|---|
clazz | The Destination class for conversions performed by this Converter |
locale | The locale |
setter for applyLocalized
newApplyLocalized | true if pattern is localized,
otherwise false
|
---|
setter for defaultLocale.
locale | the default locale |
---|
This method is deprecated.
This method will be modified to return a Map in the next release.
Create all LocaleConverter
types for specified locale.
locale | The Locale |
---|
LocaleConverter
types
for the specified locale.
This method is deprecated.
This method will be modified to return a Map in the next release.
Look up and return any registered FastHashMap instance for the specified locale;
if there is no registered one, return null
.
locale | The Locale |
---|
LocaleConverter
types for
the specified locale.