calculate
protected static LocaleBeanUtils.Descriptor calculate(Object bean,
String name)
throws IllegalAccessException,
InvocationTargetException
moved into LocaleBeanUtilsBean
Resolve any nested expression to get the actual target bean.
bean
- The beanname
- The property name
- The property's descriptor
convert
protected static Object convert(Class type,
int index,
Object value)
Convert the specified value to the required type.
For more details see
LocaleBeanUtilsBean
type
- The Java type of target propertyindex
- The indexed subscript value (if any)value
- The value to be converted
convert
protected static Object convert(Class type,
int index,
Object value,
String pattern)
Convert the specified value to the required type using the
specified conversion pattern.
For more details see
LocaleBeanUtilsBean
type
- The Java type of target propertyindex
- The indexed subscript value (if any)value
- The value to be convertedpattern
- The conversion pattern
definePropertyType
protected static Class definePropertyType(Object target,
String name,
String propName)
throws IllegalAccessException,
InvocationTargetException
Calculate the property type.
For more details see
LocaleBeanUtilsBean
target
- The beanname
- The property namepropName
- The Simple name of target property
getApplyLocalized
public static boolean getApplyLocalized()
Gets whether the pattern is localized or not.
For more details see
LocaleBeanUtilsBean
true
if pattern is localized,
otherwise false
getDefaultLocale
public static Locale getDefaultLocale()
Gets the locale used when no locale is passed.
For more details see
LocaleBeanUtilsBean
getIndexedProperty
public static String getIndexedProperty(Object bean,
String name)
throws IllegalAccessException,
InvocationTargetException,
NoSuchMethodException
Return the value of the specified locale-sensitive indexed property
of the specified bean, as a String using the default conversion pattern of
the corresponding
LocaleConverter
.
For more details see
LocaleBeanUtilsBean
- getIndexedProperty in interface BeanUtils
bean
- Bean whose property is to be extractedname
- propertyname[index]
of the property value
to be extracted
- The indexed property's value, converted to a String
getIndexedProperty
public static String getIndexedProperty(Object bean,
String name,
String pattern)
throws IllegalAccessException,
InvocationTargetException,
NoSuchMethodException
Return the value of the specified locale-sensitive indexed property
of the specified bean, as a String.
For more details see
LocaleBeanUtilsBean
bean
- Bean whose property is to be extractedname
- propertyname[index]
of the property value
to be extractedpattern
- The conversion pattern
- The indexed property's value, converted to a String
getIndexedProperty
public static String getIndexedProperty(Object bean,
String name,
int index)
throws IllegalAccessException,
InvocationTargetException,
NoSuchMethodException
Return the value of the specified locale-sensetive indexed property
of the specified bean, as a String using the default conversion pattern of
the corresponding
LocaleConverter
.
For more details see
LocaleBeanUtilsBean
- getIndexedProperty in interface BeanUtils
bean
- Bean whose property is to be extractedname
- Simple property name of the property value to be extractedindex
- Index of the property value to be extracted
- The indexed property's value, converted to a String
getIndexedProperty
public static String getIndexedProperty(Object bean,
String name,
int index,
String pattern)
throws IllegalAccessException,
InvocationTargetException,
NoSuchMethodException
Return the value of the specified locale-sensetive indexed property
of the specified bean, as a String using the specified conversion pattern.
For more details see
LocaleBeanUtilsBean
bean
- Bean whose property is to be extractedname
- Simple property name of the property value to be extractedindex
- Index of the property value to be extractedpattern
- The conversion pattern
- The indexed property's value, converted to a String
getMappedProperty
public static String getMappedProperty(Object bean,
String name)
throws IllegalAccessException,
InvocationTargetException,
NoSuchMethodException
Return the value of the specified locale-sensitive mapped property
of the specified bean, as a String using the default
conversion pattern of the corresponding
LocaleConverter
.
For more details see
LocaleBeanUtilsBean
- getMappedProperty in interface BeanUtils
bean
- Bean whose property is to be extractedname
- propertyname(index)
of the property value
to be extracted
- The mapped property's value, converted to a String
getMappedProperty
public static String getMappedProperty(Object bean,
String name,
String key)
throws IllegalAccessException,
InvocationTargetException,
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.
For more details see
LocaleBeanUtilsBean
- getMappedProperty in interface BeanUtils
bean
- Bean whose property is to be extractedname
- Simple property name of the property value to be extractedkey
- Lookup key of the property value to be extracted
- The mapped property's value, converted to a String
getMappedProperty
public static String getMappedProperty(Object bean,
String name,
String key,
String pattern)
throws IllegalAccessException,
InvocationTargetException,
NoSuchMethodException
Return the value of the specified mapped locale-sensitive property
of the specified bean, as a String using the specified conversion pattern.
For more details see
LocaleBeanUtilsBean
bean
- Bean whose property is to be extractedname
- Simple property name of the property value to be extractedkey
- Lookup key of the property value to be extractedpattern
- The conversion pattern
- The mapped property's value, converted to a String
getMappedPropertyLocale
public static String getMappedPropertyLocale(Object bean,
String name,
String pattern)
throws IllegalAccessException,
InvocationTargetException,
NoSuchMethodException
Return the value of the specified locale-sensitive mapped property
of the specified bean, as a String using the specified pattern.
For more details see
LocaleBeanUtilsBean
bean
- Bean whose property is to be extractedname
- propertyname(index)
of the property value
to be extractedpattern
- The conversion pattern
- The mapped property's value, converted to a String
getNestedProperty
public static String getNestedProperty(Object bean,
String name)
throws IllegalAccessException,
InvocationTargetException,
NoSuchMethodException
Return the value of the (possibly nested) locale-sensitive property
of the specified name.
For more details see
LocaleBeanUtilsBean
- getNestedProperty in interface BeanUtils
bean
- Bean whose property is to be extractedname
- Possibly nested name of the property to be extracted
- The nested property's value, converted to a String
getNestedProperty
public static String getNestedProperty(Object bean,
String name,
String pattern)
throws IllegalAccessException,
InvocationTargetException,
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.
For more details see
LocaleBeanUtilsBean
bean
- Bean whose property is to be extractedname
- Possibly nested name of the property to be extractedpattern
- The conversion pattern
- The nested property's value, converted to a String
getProperty
public static String getProperty(Object bean,
String name)
throws IllegalAccessException,
InvocationTargetException,
NoSuchMethodException
Return the value of the specified locale-sensitive property
of the specified bean.
For more details see
LocaleBeanUtilsBean
- getProperty in interface BeanUtils
bean
- Bean whose property is to be extractedname
- Possibly indexed and/or nested name of the property
to be extracted
- The property's value, converted to a String
getProperty
public static String getProperty(Object bean,
String name,
String pattern)
throws IllegalAccessException,
InvocationTargetException,
NoSuchMethodException
Return the value of the specified locale-sensitive property
of the specified bean.
For more details see
LocaleBeanUtilsBean
bean
- Bean whose property is to be extractedname
- Possibly indexed and/or nested name of the property
to be extractedpattern
- The conversion pattern
- The nested property's value, converted to a String
getSimpleProperty
public static String getSimpleProperty(Object bean,
String name)
throws IllegalAccessException,
InvocationTargetException,
NoSuchMethodException
Return the value of the specified simple locale-sensitive property
of the specified bean, converted to a String using the default
conversion pattern of the corresponding
LocaleConverter
.
For more details see
LocaleBeanUtilsBean
- getSimpleProperty in interface BeanUtils
bean
- Bean whose property is to be extractedname
- Name of the property to be extracted
- The property's value, converted to a String
getSimpleProperty
public static String getSimpleProperty(Object bean,
String name,
String pattern)
throws IllegalAccessException,
InvocationTargetException,
NoSuchMethodException
Return the value of the specified simple locale-sensitive property
of the specified bean, converted to a String using the specified
conversion pattern.
For more details see
LocaleBeanUtilsBean
bean
- Bean whose property is to be extractedname
- Name of the property to be extractedpattern
- The conversion pattern
- The property's value, converted to a String
invokeSetter
protected static void invokeSetter(Object target,
String propName,
String key,
int index,
Object newValue)
throws IllegalAccessException,
InvocationTargetException
Invoke the setter method.
For more details see
LocaleBeanUtilsBean
target
- The beanpropName
- The Simple name of target propertykey
- The Mapped key value (if any)index
- The indexed subscript value (if any)newValue
- The value to be set
setApplyLocalized
public static void setApplyLocalized(boolean newApplyLocalized)
Sets whether the pattern is localized or not.
For more details see
LocaleBeanUtilsBean
newApplyLocalized
- true
if pattern is localized,
otherwise false
setDefaultLocale
public static void setDefaultLocale(Locale locale)
Sets the locale used when no locale is passed.
For more details see
LocaleBeanUtilsBean
locale
- the default locale
setProperty
public static void setProperty(Object bean,
String name,
Object value)
throws IllegalAccessException,
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 conversion pattern of the corresponding
LocaleConverter
.
For more details see
LocaleBeanUtilsBean
- setProperty in interface BeanUtils
bean
- Bean on which setting is to be performedname
- Property name (can be nested/indexed/mapped/combo)value
- Value to be set
setProperty
public static void setProperty(Object bean,
String name,
Object value,
String pattern)
throws IllegalAccessException,
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 conversion pattern.
For more details see
LocaleBeanUtilsBean
bean
- Bean on which setting is to be performedname
- Property name (can be nested/indexed/mapped/combo)value
- Value to be setpattern
- The conversion pattern