|
|||||||||
| Home >> All >> org >> apache >> commons >> beanutils >> [ locale overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.commons.beanutils.locale
Class LocaleBeanUtilsBean

java.lang.Objectorg.apache.commons.beanutils.BeanUtilsBean
org.apache.commons.beanutils.locale.LocaleBeanUtilsBean
- public class LocaleBeanUtilsBean
- extends org.apache.commons.beanutils.BeanUtilsBean
Utility methods for populating JavaBeans properties via reflection in a locale-dependent manner.
- Since:
- 1.7
| Nested Class Summary | |
protected class |
LocaleBeanUtilsBean.Descriptor
|
| Field Summary | |
private static org.apache.commons.beanutils.ContextClassLoaderLocal |
localeBeansByClassLoader
Contains LocaleBeanUtilsBean instances indexed by context classloader. |
private LocaleConvertUtilsBean |
localeConvertUtils
Convertor used by this class |
private static org.apache.commons.logging.Log |
log
All logging goes through this logger |
| Fields inherited from class org.apache.commons.beanutils.BeanUtilsBean |
|
| Constructor Summary | |
LocaleBeanUtilsBean()
Construct instance with standard conversion bean |
|
LocaleBeanUtilsBean(LocaleConvertUtilsBean localeConvertUtils)
Construct instance that uses given locale conversion |
|
LocaleBeanUtilsBean(LocaleConvertUtilsBean localeConvertUtils,
org.apache.commons.beanutils.ConvertUtilsBean convertUtilsBean,
org.apache.commons.beanutils.PropertyUtilsBean propertyUtilsBean)
Construct instance that uses given locale conversion |
|
| Method Summary | |
protected LocaleBeanUtilsBean.Descriptor |
calculate(java.lang.Object bean,
java.lang.String name)
Resolve any nested expression to get the actual target bean. |
protected java.lang.Object |
convert(java.lang.Class type,
int index,
java.lang.Object value)
Convert the specified value to the required type. |
protected java.lang.Object |
convert(java.lang.Class type,
int index,
java.lang.Object value,
java.lang.String pattern)
Convert the specified value to the required type using the specified convertion pattern. |
protected java.lang.Class |
definePropertyType(java.lang.Object target,
java.lang.String name,
java.lang.String propName)
Calculate the property type. |
boolean |
getApplyLocalized()
Is the pattern to be applied localized (Indicate whether the pattern is localized or not) |
java.util.Locale |
getDefaultLocale()
Gets the default Locale |
java.lang.String |
getIndexedProperty(java.lang.Object bean,
java.lang.String name)
Return the value of the specified locale-sensitive indexed property of the specified bean, as a String using the default convertion pattern of the corresponding LocaleConverter. |
java.lang.String |
getIndexedProperty(java.lang.Object bean,
java.lang.String name,
int index)
Return the value of the specified locale-sensetive indexed property of the specified bean, as a String using the default convertion pattern of the corresponding LocaleConverter. |
java.lang.String |
getIndexedProperty(java.lang.Object bean,
java.lang.String name,
int index,
java.lang.String pattern)
Return the value of the specified locale-sensetive indexed property of the specified bean, as a String using the specified convertion pattern. |
java.lang.String |
getIndexedProperty(java.lang.Object bean,
java.lang.String name,
java.lang.String pattern)
Return the value of the specified locale-sensitive indexed property of the specified bean, as a String. |
static LocaleBeanUtilsBean |
getLocaleBeanUtilsInstance()
Gets singleton instance |
LocaleConvertUtilsBean |
getLocaleConvertUtils()
Gets the bean instance used for conversions |
java.lang.String |
getMappedProperty(java.lang.Object bean,
java.lang.String name)
Return the value of the specified locale-sensitive mapped property of the specified bean, as a String using the default convertion pattern of the corresponding LocaleConverter. |
java.lang.String |
getMappedProperty(java.lang.Object bean,
java.lang.String name,
java.lang.String key)
Return the value of the specified mapped locale-sensitive property of the specified bean, as a String The key is specified as a method parameter and must *not* be included in the property name expression |
java.lang.String |
getMappedProperty(java.lang.Object bean,
java.lang.String name,
java.lang.String key,
java.lang.String pattern)
Return the value of the specified mapped locale-sensitive property of the specified bean, as a String using the specified convertion pattern. |
java.lang.String |
getMappedPropertyLocale(java.lang.Object bean,
java.lang.String name,
java.lang.String pattern)
Return the value of the specified locale-sensitive mapped property of the specified bean, as a String using the specified pattern. |
java.lang.String |
getNestedProperty(java.lang.Object bean,
java.lang.String name)
Return the value of the (possibly nested) locale-sensitive property of the specified name, for the specified bean, as a String using the default convertion pattern of the corresponding LocaleConverter. |
java.lang.String |
getNestedProperty(java.lang.Object bean,
java.lang.String name,
java.lang.String pattern)
Return the value of the (possibly nested) locale-sensitive property of the specified name, for the specified bean, as a String using the specified pattern. |
java.lang.String |
getProperty(java.lang.Object bean,
java.lang.String name)
Return the value of the specified locale-sensitive property of the specified bean, no matter which property reference format is used, as a String using the default convertion pattern of the corresponding LocaleConverter. |
java.lang.String |
getProperty(java.lang.Object bean,
java.lang.String name,
java.lang.String pattern)
Return the value of the specified locale-sensitive property of the specified bean, no matter which property reference format is used, as a String using the specified convertion pattern. |
java.lang.String |
getSimpleProperty(java.lang.Object bean,
java.lang.String name)
Return the value of the specified simple locale-sensitive property of the specified bean, converted to a String using the default convertion pattern of the corresponding LocaleConverter. |
java.lang.String |
getSimpleProperty(java.lang.Object bean,
java.lang.String name,
java.lang.String pattern)
Return the value of the specified simple locale-sensitive property of the specified bean, converted to a String using the specified convertion pattern. |
protected void |
invokeSetter(java.lang.Object target,
java.lang.String propName,
java.lang.String key,
int index,
java.lang.Object newValue)
Invoke the setter method. |
void |
setApplyLocalized(boolean newApplyLocalized)
Sets whether the pattern is applied localized (Indicate whether the pattern is localized or not) |
void |
setDefaultLocale(java.util.Locale locale)
Sets the default Locale |
static void |
setInstance(LocaleBeanUtilsBean newInstance)
Sets the instance which provides the functionality for LocaleBeanUtils. |
void |
setProperty(java.lang.Object bean,
java.lang.String name,
java.lang.Object value)
Set the specified locale-sensitive property value, performing type conversions as required to conform to the type of the destination property using the default convertion pattern of the corresponding LocaleConverter. |
void |
setProperty(java.lang.Object bean,
java.lang.String name,
java.lang.Object value,
java.lang.String pattern)
Set the specified locale-sensitive property value, performing type conversions as required to conform to the type of the destination property using the specified convertion pattern. |
| Methods inherited from class org.apache.commons.beanutils.BeanUtilsBean |
cloneBean, copyProperties, copyProperty, describe, getArrayProperty, getConvertUtils, getInstance, getPropertyUtils, populate, setInstance |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
localeBeansByClassLoader
private static final org.apache.commons.beanutils.ContextClassLoaderLocal localeBeansByClassLoader
- Contains
LocaleBeanUtilsBeaninstances indexed by context classloader.
log
private static org.apache.commons.logging.Log log
- All logging goes through this logger
localeConvertUtils
private LocaleConvertUtilsBean localeConvertUtils
- Convertor used by this class
| Constructor Detail |
LocaleBeanUtilsBean
public LocaleBeanUtilsBean()
- Construct instance with standard conversion bean
LocaleBeanUtilsBean
public LocaleBeanUtilsBean(LocaleConvertUtilsBean localeConvertUtils, org.apache.commons.beanutils.ConvertUtilsBean convertUtilsBean, org.apache.commons.beanutils.PropertyUtilsBean propertyUtilsBean)
- Construct instance that uses given locale conversion
LocaleBeanUtilsBean
public LocaleBeanUtilsBean(LocaleConvertUtilsBean localeConvertUtils)
- Construct instance that uses given locale conversion
| Method Detail |
getLocaleBeanUtilsInstance
public static LocaleBeanUtilsBean getLocaleBeanUtilsInstance()
- Gets singleton instance
setInstance
public static void setInstance(LocaleBeanUtilsBean newInstance)
- Sets the instance which provides the functionality for LocaleBeanUtils.
This is a pseudo-singleton - an single instance is provided per (thread) context classloader.
This mechanism provides isolation for web apps deployed in the same container.
getLocaleConvertUtils
public LocaleConvertUtilsBean getLocaleConvertUtils()
- Gets the bean instance used for conversions
getDefaultLocale
public java.util.Locale getDefaultLocale()
- Gets the default Locale
setDefaultLocale
public void setDefaultLocale(java.util.Locale locale)
- Sets the default Locale
getApplyLocalized
public boolean getApplyLocalized()
- Is the pattern to be applied localized
(Indicate whether the pattern is localized or not)
setApplyLocalized
public void setApplyLocalized(boolean newApplyLocalized)
- Sets whether the pattern is applied localized
(Indicate whether the pattern is localized or not)
getIndexedProperty
public java.lang.String getIndexedProperty(java.lang.Object bean, java.lang.String name, java.lang.String pattern) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
- Return the value of the specified locale-sensitive indexed property
of the specified bean, as a String. The zero-relative index of the
required value must be included (in square brackets) as a suffix to
the property name, or
IllegalArgumentExceptionwill be thrown.
getIndexedProperty
public java.lang.String getIndexedProperty(java.lang.Object bean, java.lang.String name) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
- Return the value of the specified locale-sensitive indexed property
of the specified bean, as a String using the default convertion pattern of
the corresponding LocaleConverter. The zero-relative index
of the required value must be included (in square brackets) as a suffix
to the property name, or
IllegalArgumentExceptionwill be thrown.
getIndexedProperty
public java.lang.String getIndexedProperty(java.lang.Object bean, java.lang.String name, int index, java.lang.String pattern) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
- Return the value of the specified locale-sensetive indexed property
of the specified bean, as a String using the specified convertion pattern.
The index is specified as a method parameter and
must *not* be included in the property name expression
getIndexedProperty
public java.lang.String getIndexedProperty(java.lang.Object bean, java.lang.String name, int index) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
- Return the value of the specified locale-sensetive indexed property
of the specified bean, as a String using the default convertion pattern of
the corresponding LocaleConverter.
The index is specified as a method parameter and
must *not* be included in the property name expression
getSimpleProperty
public java.lang.String getSimpleProperty(java.lang.Object bean, java.lang.String name, java.lang.String pattern) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
- Return the value of the specified simple locale-sensitive property
of the specified bean, converted to a String using the specified
convertion pattern.
getSimpleProperty
public java.lang.String getSimpleProperty(java.lang.Object bean, java.lang.String name) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
- Return the value of the specified simple locale-sensitive property
of the specified bean, converted to a String using the default
convertion pattern of the corresponding LocaleConverter.
getMappedProperty
public java.lang.String getMappedProperty(java.lang.Object bean, java.lang.String name, java.lang.String key, java.lang.String pattern) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
- Return the value of the specified mapped locale-sensitive property
of the specified bean, as a String using the specified convertion pattern.
The key is specified as a method parameter and must *not* be included in
the property name expression.
getMappedProperty
public java.lang.String getMappedProperty(java.lang.Object bean, java.lang.String name, java.lang.String key) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
- Return the value of the specified mapped locale-sensitive property
of the specified bean, as a String
The key is specified as a method parameter and must *not* be included
in the property name expression
getMappedPropertyLocale
public java.lang.String getMappedPropertyLocale(java.lang.Object bean, java.lang.String name, java.lang.String pattern) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
- Return the value of the specified locale-sensitive mapped property
of the specified bean, as a String using the specified pattern.
The String-valued key of the required value
must be included (in parentheses) as a suffix to
the property name, or
IllegalArgumentExceptionwill be thrown.
getMappedProperty
public java.lang.String getMappedProperty(java.lang.Object bean, java.lang.String name) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
- Return the value of the specified locale-sensitive mapped property
of the specified bean, as a String using the default
convertion pattern of the corresponding LocaleConverter.
The String-valued key of the required value
must be included (in parentheses) as a suffix to
the property name, or
IllegalArgumentExceptionwill be thrown.
getNestedProperty
public java.lang.String getNestedProperty(java.lang.Object bean, java.lang.String name, java.lang.String pattern) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
- Return the value of the (possibly nested) locale-sensitive property
of the specified name, for the specified bean,
as a String using the specified pattern.
getNestedProperty
public java.lang.String getNestedProperty(java.lang.Object bean, java.lang.String name) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
- Return the value of the (possibly nested) locale-sensitive property
of the specified name, for the specified bean, as a String using the default
convertion pattern of the corresponding LocaleConverter.
getProperty
public java.lang.String getProperty(java.lang.Object bean, java.lang.String name, java.lang.String pattern) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
- Return the value of the specified locale-sensitive property
of the specified bean, no matter which property reference
format is used, as a String using the specified convertion pattern.
getProperty
public java.lang.String getProperty(java.lang.Object bean, java.lang.String name) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
- Return the value of the specified locale-sensitive property
of the specified bean, no matter which property reference
format is used, as a String using the default
convertion pattern of the corresponding LocaleConverter.
setProperty
public void setProperty(java.lang.Object bean, java.lang.String name, java.lang.Object value) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
- Set the specified locale-sensitive property value, performing type
conversions as required to conform to the type of the destination property
using the default convertion pattern of the corresponding LocaleConverter.
setProperty
public void setProperty(java.lang.Object bean, java.lang.String name, java.lang.Object value, java.lang.String pattern) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
- Set the specified locale-sensitive property value, performing type
conversions as required to conform to the type of the destination
property using the specified convertion pattern.
definePropertyType
protected java.lang.Class definePropertyType(java.lang.Object target, java.lang.String name, java.lang.String propName) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
- Calculate the property type.
convert
protected java.lang.Object convert(java.lang.Class type, int index, java.lang.Object value, java.lang.String pattern)
- Convert the specified value to the required type using the
specified convertion pattern.
convert
protected java.lang.Object convert(java.lang.Class type, int index, java.lang.Object value)
- Convert the specified value to the required type.
invokeSetter
protected void invokeSetter(java.lang.Object target, java.lang.String propName, java.lang.String key, int index, java.lang.Object newValue) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
- Invoke the setter method.
calculate
protected LocaleBeanUtilsBean.Descriptor calculate(java.lang.Object bean, java.lang.String name) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
- Resolve any nested expression to get the actual target bean.
|
|||||||||
| Home >> All >> org >> apache >> commons >> beanutils >> [ locale overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC