public class

MutablePropertyValues

extends Object
implements Serializable PropertyValues
java.lang.Object
   ↳ org.springframework.beans.MutablePropertyValues
Known Direct Subclasses

Class Overview

Default implementation of the PropertyValues interface. Allows simple manipulation of properties, and provides constructors to support deep copy and construction from a Map.

Summary

Public Constructors
MutablePropertyValues()
Creates a new empty MutablePropertyValues object.
MutablePropertyValues(PropertyValues original)
Deep copy constructor.
MutablePropertyValues(Map<?, ?> original)
Construct a new MutablePropertyValues object from a Map.
MutablePropertyValues(List<PropertyValue> propertyValueList)
Construct a new MutablePropertyValues object using the given List of PropertyValue objects as-is.
Public Methods
MutablePropertyValues add(String propertyName, Object propertyValue)
Add a PropertyValue object, replacing any existing one for the corresponding property or getting merged with it (if applicable).
MutablePropertyValues addPropertyValue(PropertyValue pv)
Add a PropertyValue object, replacing any existing one for the corresponding property or getting merged with it (if applicable).
void addPropertyValue(String propertyName, Object propertyValue)
Overloaded version of addPropertyValue that takes a property name and a property value.
MutablePropertyValues addPropertyValues(Map<?, ?> other)
Add all property values from the given Map.
MutablePropertyValues addPropertyValues(PropertyValues other)
Copy all given PropertyValues into this object.
PropertyValues changesSince(PropertyValues old)
Return the changes since the previous PropertyValues.
boolean contains(String propertyName)
Is there a property value (or other processing entry) for this property?
boolean equals(Object other)
PropertyValue getPropertyValue(String propertyName)
Return the property value with the given name, if any.
List<PropertyValue> getPropertyValueList()
Return the underlying List of PropertyValue objects in its raw form.
PropertyValue[] getPropertyValues()
Return an array of the PropertyValue objects held in this object.
int hashCode()
boolean isConverted()
Return whether this holder contains converted values only (true), or whether the values still need to be converted (false).
boolean isEmpty()
Does this holder not contain any PropertyValue objects at all?
void registerProcessedProperty(String propertyName)
Register the specified property as "processed" in the sense of some processor calling the corresponding setter method outside of the PropertyValue(s) mechanism.
void removePropertyValue(PropertyValue pv)
Remove the given PropertyValue, if contained.
void removePropertyValue(String propertyName)
Overloaded version of removePropertyValue that takes a property name.
void setConverted()
Mark this holder as containing converted values only (i.e.
void setPropertyValueAt(PropertyValue pv, int i)
Modify a PropertyValue object held in this object.
int size()
Return the number of PropertyValue entries in the list.
String toString()
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.beans.PropertyValues

Public Constructors

public MutablePropertyValues ()

Also: SpringBeans

Creates a new empty MutablePropertyValues object.

Property values can be added with the add method.

public MutablePropertyValues (PropertyValues original)

Also: SpringBeans

Deep copy constructor. Guarantees PropertyValue references are independent, although it can't deep copy objects currently referenced by individual PropertyValue objects.

Parameters
original the PropertyValues to copy

public MutablePropertyValues (Map<?, ?> original)

Also: SpringBeans

Construct a new MutablePropertyValues object from a Map.

Parameters
original Map with property values keyed by property name Strings

public MutablePropertyValues (List<PropertyValue> propertyValueList)

Also: SpringBeans

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

Public Methods

public MutablePropertyValues add (String propertyName, Object propertyValue)

Also: SpringBeans

Add a PropertyValue object, replacing any existing one for the corresponding property or getting merged with it (if applicable).

Parameters
propertyName name of the property
propertyValue value of the property
Returns
  • this in order to allow for adding multiple property values in a chain

public MutablePropertyValues addPropertyValue (PropertyValue pv)

Also: SpringBeans

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

public void addPropertyValue (String propertyName, Object propertyValue)

Also: SpringBeans

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(String, Object).

Parameters
propertyName name of the property
propertyValue value of the property

public MutablePropertyValues addPropertyValues (Map<?, ?> other)

Also: SpringBeans

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

public MutablePropertyValues addPropertyValues (PropertyValues other)

Also: SpringBeans

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

public PropertyValues changesSince (PropertyValues old)

Also: SpringBeans

Return the changes since the previous PropertyValues. Subclasses should also override equals.

Parameters
old old property values
Returns
  • PropertyValues updated or new properties. Return empty PropertyValues if there are no changes.

public boolean contains (String propertyName)

Also: SpringBeans

Is there a property value (or other processing entry) for this property?

Parameters
propertyName the name of the property we're interested in
Returns
  • whether there is a property value for this property

public boolean equals (Object other)

public PropertyValue getPropertyValue (String propertyName)

Also: SpringBeans

Return the property value with the given name, if any.

Parameters
propertyName the name to search for
Returns
  • the property value, or null

public List<PropertyValue> getPropertyValueList ()

Also: SpringBeans

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.

public PropertyValue[] getPropertyValues ()

Also: SpringBeans

Return an array of the PropertyValue objects held in this object.

public int hashCode ()

public boolean isConverted ()

Also: SpringBeans

Return whether this holder contains converted values only (true), or whether the values still need to be converted (false).

public boolean isEmpty ()

Also: SpringBeans

Does this holder not contain any PropertyValue objects at all?

public void registerProcessedProperty (String propertyName)

Also: SpringBeans

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(String) call for the specified property.

Parameters
propertyName the name of the property.

public void removePropertyValue (PropertyValue pv)

Also: SpringBeans

Remove the given PropertyValue, if contained.

Parameters
pv the PropertyValue to remove

public void removePropertyValue (String propertyName)

Also: SpringBeans

Overloaded version of removePropertyValue that takes a property name.

Parameters
propertyName name of the property

public void setConverted ()

Also: SpringBeans

Mark this holder as containing converted values only (i.e. no runtime resolution needed anymore).

public void setPropertyValueAt (PropertyValue pv, int i)

Also: SpringBeans

Modify a PropertyValue object held in this object. Indexed from 0.

public int size ()

Also: SpringBeans

Return the number of PropertyValue entries in the list.

public String toString ()