|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.beanutils.BeanUtilsBean org.apache.commons.beanutils.BeanUtilsBean2
public class BeanUtilsBean2
BeanUtilsBean
implementation that creates a
ConvertUtilsBean2
and delegates conversion to
ConvertUtilsBean.convert(Object, Class)
.
To configure this implementation for the current context ClassLoader invoke
BeanUtilsBean.setInstance(new BeanUtilsBean2());
BeanUtils 1.7.0 delegated all conversion to String to the converter
registered for the String.class
. One of the improvements in
BeanUtils 1.8.0 was to upgrade the Converter
implementations so
that they could handle conversion to String for their type (e.g.
IntegerConverter now handles conversion from an Integer to a String as
well as String to Integer).
In order to take advantage of these improvements BeanUtils needs to change
how it gets the appropriate Converter
. This functionality has been
implemented in the new ConvertUtilsBean.lookup(Class, Class)
and
ConvertUtilsBean.convert(Object, Class)
methods. However changing
BeanUtilsBean
to use these methods could create compatibility
issues for existing users. In order to avoid that, this new
BeanUtilsBean
implementation has been created (and the associated
ConvertUtilsBean2
).
ConvertUtilsBean2
Constructor Summary | |
---|---|
BeanUtilsBean2()
Constructs an instance using new property and conversion instances. |
Method Summary | |
---|---|
protected Object |
convert(Object value,
Class type)
Convert the value to an object of the specified class (if possible). |
Methods inherited from class org.apache.commons.beanutils.BeanUtilsBean |
---|
cloneBean, copyProperties, copyProperty, describe, getArrayProperty, getConvertUtils, getIndexedProperty, getIndexedProperty, getInstance, getMappedProperty, getMappedProperty, getNestedProperty, getProperty, getPropertyUtils, getSimpleProperty, initCause, populate, setInstance, setProperty |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BeanUtilsBean2()
Constructs an instance using new property and conversion instances.
Method Detail |
---|
protected Object convert(Object value, Class type)
Convert the value to an object of the specified class (if possible).
convert
in class BeanUtilsBean
value
- Value to be converted (may be null)type
- Class of the value to be converted to
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |