package org.springframework.beans;
Default implementation of the
PropertyValues interface.
Allows simple manipulation of properties, and provides constructors
to support deep copy and construction from a Map.
- Author(s):
- Rod Johnson
- Juergen Hoeller
- Rob Harrop
- Since:
- 13 May 2001
List of PropertyValue objects
Creates a new empty MutablePropertyValues object.
Property values can be added with the
addPropertyValue methods.
Deep copy constructor. Guarantees PropertyValue references
are independent, although it can't deep copy objects currently
referenced by individual PropertyValue objects.
for (int i = 0; i < pvs.length; i++) { Construct a new MutablePropertyValues object from a Map.
Construct a new MutablePropertyValues object using the given List of
PropertyValue objects as-is.
This is a constructor for advanced usage scenarios.
It is not intended for typical programmatic use.
- Parameters:
propertyValueList List of PropertyValue objects
Return the underlying List of PropertyValue objects in its raw form.
The returned List can be modified directly, although this is not recommended.
This is an accessor for optimized access to all PropertyValue objects.
It is not intended for typical programmatic use.
Copy all given PropertyValues into this object. Guarantees PropertyValue
references are independent, although it can't deep copy objects currently
referenced by individual PropertyValue objects.
- Parameters:
other the PropertyValues to copy- Returns:
- this object to allow creating objects, adding multiple PropertyValues
in a single statement
for (int i = 0; i < pvs.length; i++) { Add all property values from the given Map.
- Parameters:
other Map with property values keyed by property name,
which must be a String- Returns:
- this object to allow creating objects, adding multiple
PropertyValues in a single statement
Add a PropertyValue object, replacing any existing one
for the corresponding property.
- Parameters:
pv PropertyValue object to add- Returns:
- this object to allow creating objects, adding multiple
PropertyValues in a single statement
Overloaded version of
addPropertyValue that takes
a property name and a property value.
Modify a PropertyValue object held in this object.
Indexed from 0.
Overloaded version of
removePropertyValue that takes a property name.
Remove the given PropertyValue, if contained.
- Parameters:
pv the PropertyValue to remove
Clear this holder, removing all PropertyValues.
Register the specified property as "processed" in the sense
of some processor calling the corresponding setter method
outside of the PropertyValue(s) mechanism.
This will lead to true being returned from
a contains(java.lang.String) call for the specified property.
- Parameters:
propertyName the name of the property.
else if (!pvOld.equals(newPv)) { Mark this holder as containing converted values only
(i.e. no runtime resolution needed anymore).
Return whether this holder contains converted values only (
true),
or whether the values still need to be converted (
false).