BeanUtils
, but has been separated because of the volume of code involved. In general, the objects that are examined and modified using these methods are expected to conform to the property getter and setter method naming conventions described in the JavaBeans Specification (Version 1.0.1). No data type conversions are performed, and there are no usage of any PropertyEditor
classes that have been registered, although a convenient way to access the registered classes themselves is included.
For the purposes of this class, five formats for referencing a particular property value of a bean are defined, with the default layout of an identifying String in parentheses. However the notation for these formats and how they are resolved is now (since BeanUtils 1.8.0) controlled by the configured {@link Resolver} implementation:
name
) - The specified name
identifies an individual property of a particular JavaBean. The name of the actual getter or setter method to be used is determined using standard JavaBeans instrospection, so that (unless overridden by a BeanInfo
class, a property named "xyz" will have a getter method named getXyz()
or (for boolean properties only) isXyz()
, and a setter method named setXyz()
.name1.name2.name3
) The first name element is used to select a property getter, as for simple references above. The object returned for this property is then consulted, using the same approach, for a property getter for a property named name2
, and so on. The property value that is ultimately retrieved or modified is the one identified by the last name element.name[index]
) - The underlying property value is assumed to be an array, or this JavaBean is assumed to have indexed property getter and setter methods. The appropriate (zero-relative) entry in the array is selected. List
objects are now also supported for read/write. You simply need to define a getter that returns the List
name(key)
) - The JavaBean is assumed to have an property getter and setter methods with an additional attribute of type java.lang.String
.name1.name2[index].name3(key)
) - Combining mapped, nested, and indexed references is also supported.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|