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
Creates a new empty MutablePropertyValues object.
Property values can be added with the add method.
Deep copy constructor. Guarantees PropertyValue references
are independent, although it can't deep copy objects currently
referenced by individual PropertyValue objects.
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.
Return the number of PropertyValue entries in the list.
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 in order to allow for adding multiple property values in a chain
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 in order to allow for adding multiple property values in a chain
Add a PropertyValue object, replacing any existing one for the
corresponding property or getting merged with it (if applicable).
- Parameters:
pv PropertyValue object to add- Returns:
- this in order to allow for adding multiple property values in a chain
Overloaded version of
addPropertyValue that takes
a property name and a property value.
Note: As of Spring 3.0, we recommend using the more concise
and chaining-capable variant add(java.lang.String,java.lang.Object).
Add a PropertyValue object, replacing any existing one for the
corresponding property or getting merged with it (if applicable).
- Parameters:
propertyName name of the propertypropertyValue value of the property- Returns:
- this in order to allow for adding multiple property values in a chain
Modify a PropertyValue object held in this object.
Indexed from 0.
Remove the given PropertyValue, if contained.
- Parameters:
pv the PropertyValue to remove
Overloaded version of
removePropertyValue that takes a property name.
else if (!pvOld.equals(newPv)) { 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.
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).