Overrides default values in one or more object definitions.
For a list of all members of this type, see PropertyOverrideConfigurer Members .
Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.
Instances of this class override already existing values, and is thus best suited to replacing defaults. If you need to replace placeholder values, consider using the
In contrast to the PropertyPlaceholderConfigurer class, the original object definition can have default values or no values at all for such object properties. If an overriding configuration file does not have an entry for a certain object property, the default object value is left as is. Also note that it is not immediately obvious to discern which object definitions will be mutated by one or more PropertyOverrideConfigurers simply by looking at the object configuration.
Each line in a referenced configuration file is expected to take the following form...
<add key="name.property" value="the override" />
name.property key refers to the object name and the property that is to be overridden; and the value is the overridding value that will be inserted into the appropriate object definition's named property.
Please note that in the case of multiple PropertyOverrideConfigurers that define different values for the same object definition value, the last overridden value will win (due to the fact that the values supplied by previous PropertyOverrideConfigurers will be overridden).
The following XML context definition defines an object that has a number of properties, all of which have default values...
<object id="connStringProvider" type="MyNamespace.OracleConnectionStringProvider, MyAssembly"> <property name="dataSource" value="MyOracleDB" /> <property name="userId" value="sa" /> <property name="password" value="g0ly4dk1n" /> <property name="integratedSecurity" value="true" /> </object>
What follows is a .NET config file snippet for the above example (assuming the need to override one of the default values)...
<name-values> <add key="database.userid" value="test" /> <add key="database.password" value="0bl0m0v" /> </name-values>
Assembly: Spring.Core (in Spring.Core.dll)