diff --git a/org.springframework.aop/src/main/java/org/springframework/aop/config/AbstractInterceptorDrivenBeanDefinitionDecorator.java b/org.springframework.aop/src/main/java/org/springframework/aop/config/AbstractInterceptorDrivenBeanDefinitionDecorator.java
index 4e88557fe8b..0e584716553 100644
--- a/org.springframework.aop/src/main/java/org/springframework/aop/config/AbstractInterceptorDrivenBeanDefinitionDecorator.java
+++ b/org.springframework.aop/src/main/java/org/springframework/aop/config/AbstractInterceptorDrivenBeanDefinitionDecorator.java
@@ -83,11 +83,11 @@ public abstract class AbstractInterceptorDrivenBeanDefinitionDecorator implement
proxyDefinition.setPropertyValues(mpvs);
// set the target
- mpvs.addPropertyValue("target", existingDefinition);
+ mpvs.add("target", existingDefinition);
// create the interceptor names list
ManagedList interceptorList = new ManagedList();
- mpvs.addPropertyValue("interceptorNames", interceptorList);
+ mpvs.add("interceptorNames", interceptorList);
result = new BeanDefinitionHolder(proxyDefinition, existingBeanName);
}
diff --git a/org.springframework.aop/src/main/java/org/springframework/aop/config/AopConfigUtils.java b/org.springframework.aop/src/main/java/org/springframework/aop/config/AopConfigUtils.java
index 155c43253c9..2c84dc19b3b 100644
--- a/org.springframework.aop/src/main/java/org/springframework/aop/config/AopConfigUtils.java
+++ b/org.springframework.aop/src/main/java/org/springframework/aop/config/AopConfigUtils.java
@@ -93,7 +93,7 @@ public abstract class AopConfigUtils {
public static void forceAutoProxyCreatorToUseClassProxying(BeanDefinitionRegistry registry) {
if (registry.containsBeanDefinition(AUTO_PROXY_CREATOR_BEAN_NAME)) {
BeanDefinition definition = registry.getBeanDefinition(AUTO_PROXY_CREATOR_BEAN_NAME);
- definition.getPropertyValues().addPropertyValue("proxyTargetClass", Boolean.TRUE);
+ definition.getPropertyValues().add("proxyTargetClass", Boolean.TRUE);
}
}
@@ -113,7 +113,7 @@ public abstract class AopConfigUtils {
}
RootBeanDefinition beanDefinition = new RootBeanDefinition(cls);
beanDefinition.setSource(source);
- beanDefinition.getPropertyValues().addPropertyValue("order", Ordered.HIGHEST_PRECEDENCE);
+ beanDefinition.getPropertyValues().add("order", Ordered.HIGHEST_PRECEDENCE);
beanDefinition.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
registry.registerBeanDefinition(AUTO_PROXY_CREATOR_BEAN_NAME, beanDefinition);
return beanDefinition;
diff --git a/org.springframework.aop/src/main/java/org/springframework/aop/config/AspectJAutoProxyBeanDefinitionParser.java b/org.springframework.aop/src/main/java/org/springframework/aop/config/AspectJAutoProxyBeanDefinitionParser.java
index e3dbc6343d2..0aca37520ba 100644
--- a/org.springframework.aop/src/main/java/org/springframework/aop/config/AspectJAutoProxyBeanDefinitionParser.java
+++ b/org.springframework.aop/src/main/java/org/springframework/aop/config/AspectJAutoProxyBeanDefinitionParser.java
@@ -65,7 +65,7 @@ class AspectJAutoProxyBeanDefinitionParser implements BeanDefinitionParser {
}
if (!includePatterns.isEmpty()) {
includePatterns.setSource(parserContext.extractSource(element));
- beanDef.getPropertyValues().addPropertyValue("includePatterns", includePatterns);
+ beanDef.getPropertyValues().add("includePatterns", includePatterns);
}
}
diff --git a/org.springframework.aop/src/main/java/org/springframework/aop/config/ConfigBeanDefinitionParser.java b/org.springframework.aop/src/main/java/org/springframework/aop/config/ConfigBeanDefinitionParser.java
index a669b3b861f..e3df259fdc2 100644
--- a/org.springframework.aop/src/main/java/org/springframework/aop/config/ConfigBeanDefinitionParser.java
+++ b/org.springframework.aop/src/main/java/org/springframework/aop/config/ConfigBeanDefinitionParser.java
@@ -154,12 +154,12 @@ class ConfigBeanDefinitionParser implements BeanDefinitionParser {
Object pointcut = parsePointcutProperty(advisorElement, parserContext);
if (pointcut instanceof BeanDefinition) {
- advisorDef.getPropertyValues().addPropertyValue(POINTCUT, pointcut);
+ advisorDef.getPropertyValues().add(POINTCUT, pointcut);
parserContext.registerComponent(
new AdvisorComponentDefinition(advisorBeanName, advisorDef, (BeanDefinition) pointcut));
}
else if (pointcut instanceof String) {
- advisorDef.getPropertyValues().addPropertyValue(POINTCUT, new RuntimeBeanReference((String) pointcut));
+ advisorDef.getPropertyValues().add(POINTCUT, new RuntimeBeanReference((String) pointcut));
parserContext.registerComponent(
new AdvisorComponentDefinition(advisorBeanName, advisorDef));
}
@@ -183,12 +183,12 @@ class ConfigBeanDefinitionParser implements BeanDefinitionParser {
"'advice-ref' attribute contains empty value.", advisorElement, this.parseState.snapshot());
}
else {
- advisorDefinition.getPropertyValues().addPropertyValue(
+ advisorDefinition.getPropertyValues().add(
ADVICE_BEAN_NAME, new RuntimeBeanNameReference(adviceRef));
}
if (advisorElement.hasAttribute(ORDER_PROPERTY)) {
- advisorDefinition.getPropertyValues().addPropertyValue(
+ advisorDefinition.getPropertyValues().add(
ORDER_PROPERTY, advisorElement.getAttribute(ORDER_PROPERTY));
}
@@ -321,14 +321,14 @@ class ConfigBeanDefinitionParser implements BeanDefinitionParser {
// create the method factory bean
RootBeanDefinition methodDefinition = new RootBeanDefinition(MethodLocatingFactoryBean.class);
- methodDefinition.getPropertyValues().addPropertyValue("targetBeanName", aspectName);
- methodDefinition.getPropertyValues().addPropertyValue("methodName", adviceElement.getAttribute("method"));
+ methodDefinition.getPropertyValues().add("targetBeanName", aspectName);
+ methodDefinition.getPropertyValues().add("methodName", adviceElement.getAttribute("method"));
methodDefinition.setSynthetic(true);
// create instance factory definition
RootBeanDefinition aspectFactoryDef =
new RootBeanDefinition(SimpleBeanFactoryAwareAspectInstanceFactory.class);
- aspectFactoryDef.getPropertyValues().addPropertyValue("aspectBeanName", aspectName);
+ aspectFactoryDef.getPropertyValues().add("aspectBeanName", aspectName);
aspectFactoryDef.setSynthetic(true);
// register the pointcut
@@ -341,7 +341,7 @@ class ConfigBeanDefinitionParser implements BeanDefinitionParser {
advisorDefinition.setSource(parserContext.extractSource(adviceElement));
advisorDefinition.getConstructorArgumentValues().addGenericArgumentValue(adviceDef);
if (aspectElement.hasAttribute(ORDER_PROPERTY)) {
- advisorDefinition.getPropertyValues().addPropertyValue(
+ advisorDefinition.getPropertyValues().add(
ORDER_PROPERTY, aspectElement.getAttribute(ORDER_PROPERTY));
}
@@ -369,19 +369,19 @@ class ConfigBeanDefinitionParser implements BeanDefinitionParser {
RootBeanDefinition adviceDefinition = new RootBeanDefinition(getAdviceClass(adviceElement, parserContext));
adviceDefinition.setSource(parserContext.extractSource(adviceElement));
- adviceDefinition.getPropertyValues().addPropertyValue(ASPECT_NAME_PROPERTY, aspectName);
- adviceDefinition.getPropertyValues().addPropertyValue(DECLARATION_ORDER_PROPERTY, order);
+ adviceDefinition.getPropertyValues().add(ASPECT_NAME_PROPERTY, aspectName);
+ adviceDefinition.getPropertyValues().add(DECLARATION_ORDER_PROPERTY, order);
if (adviceElement.hasAttribute(RETURNING)) {
- adviceDefinition.getPropertyValues().addPropertyValue(
+ adviceDefinition.getPropertyValues().add(
RETURNING_PROPERTY, adviceElement.getAttribute(RETURNING));
}
if (adviceElement.hasAttribute(THROWING)) {
- adviceDefinition.getPropertyValues().addPropertyValue(
+ adviceDefinition.getPropertyValues().add(
THROWING_PROPERTY, adviceElement.getAttribute(THROWING));
}
if (adviceElement.hasAttribute(ARG_NAMES)) {
- adviceDefinition.getPropertyValues().addPropertyValue(
+ adviceDefinition.getPropertyValues().add(
ARG_NAMES_PROPERTY, adviceElement.getAttribute(ARG_NAMES));
}
@@ -507,7 +507,7 @@ class ConfigBeanDefinitionParser implements BeanDefinitionParser {
RootBeanDefinition beanDefinition = new RootBeanDefinition(AspectJExpressionPointcut.class);
beanDefinition.setScope(BeanDefinition.SCOPE_PROTOTYPE);
beanDefinition.setSynthetic(true);
- beanDefinition.getPropertyValues().addPropertyValue(EXPRESSION, expression);
+ beanDefinition.getPropertyValues().add(EXPRESSION, expression);
return beanDefinition;
}
diff --git a/org.springframework.aop/src/main/java/org/springframework/aop/scope/ScopedProxyUtils.java b/org.springframework.aop/src/main/java/org/springframework/aop/scope/ScopedProxyUtils.java
index 595f18a0834..7fa39588968 100644
--- a/org.springframework.aop/src/main/java/org/springframework/aop/scope/ScopedProxyUtils.java
+++ b/org.springframework.aop/src/main/java/org/springframework/aop/scope/ScopedProxyUtils.java
@@ -59,14 +59,14 @@ public abstract class ScopedProxyUtils {
scopedProxyDefinition.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
String targetBeanName = getTargetBeanName(originalBeanName);
- scopedProxyDefinition.getPropertyValues().addPropertyValue("targetBeanName", targetBeanName);
+ scopedProxyDefinition.getPropertyValues().add("targetBeanName", targetBeanName);
if (proxyTargetClass) {
targetDefinition.setAttribute(AutoProxyUtils.PRESERVE_TARGET_CLASS_ATTRIBUTE, Boolean.TRUE);
// ScopedFactoryBean's "proxyTargetClass" default is TRUE, so we don't need to set it explicitly here.
}
else {
- scopedProxyDefinition.getPropertyValues().addPropertyValue("proxyTargetClass", Boolean.FALSE);
+ scopedProxyDefinition.getPropertyValues().add("proxyTargetClass", Boolean.FALSE);
}
// Copy autowire settings from original bean definition.
diff --git a/org.springframework.aop/src/test/java/org/springframework/aop/target/PrototypeBasedTargetSourceTests.java b/org.springframework.aop/src/test/java/org/springframework/aop/target/PrototypeBasedTargetSourceTests.java
index fc4b5120601..43ba8a211a7 100644
--- a/org.springframework.aop/src/test/java/org/springframework/aop/target/PrototypeBasedTargetSourceTests.java
+++ b/org.springframework.aop/src/test/java/org/springframework/aop/target/PrototypeBasedTargetSourceTests.java
@@ -40,7 +40,7 @@ public final class PrototypeBasedTargetSourceTests {
@Test
public void testSerializability() throws Exception {
MutablePropertyValues tsPvs = new MutablePropertyValues();
- tsPvs.addPropertyValue("targetBeanName", "person");
+ tsPvs.add("targetBeanName", "person");
RootBeanDefinition tsBd = new RootBeanDefinition(TestTargetSource.class, tsPvs);
MutablePropertyValues pvs = new MutablePropertyValues();
diff --git a/org.springframework.beans/src/main/java/org/springframework/beans/MutablePropertyValues.java b/org.springframework.beans/src/main/java/org/springframework/beans/MutablePropertyValues.java
index 33c14976c2f..9b83f572a74 100644
--- a/org.springframework.beans/src/main/java/org/springframework/beans/MutablePropertyValues.java
+++ b/org.springframework.beans/src/main/java/org/springframework/beans/MutablePropertyValues.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -47,9 +47,8 @@ public class MutablePropertyValues implements PropertyValues, Serializable {
/**
* Creates a new empty MutablePropertyValues object.
- * Property values can be added with the addPropertyValue methods.
- * @see #addPropertyValue(PropertyValue)
- * @see #addPropertyValue(String, Object)
+ *
Property values can be added with the add method.
+ * @see #add(String, Object)
*/
public MutablePropertyValues() {
this.propertyValueList = new ArrayList();
@@ -119,13 +118,19 @@ public class MutablePropertyValues implements PropertyValues, Serializable {
return this.propertyValueList;
}
+ /**
+ * Return the number of PropertyValue entries in the list.
+ */
+ public int size() {
+ return this.propertyValueList.size();
+ }
+
/**
* 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.
* @param other the PropertyValues to copy
- * @return this object to allow creating objects, adding multiple PropertyValues
- * in a single statement
+ * @return this in order to allow for adding multiple property values in a chain
*/
public MutablePropertyValues addPropertyValues(PropertyValues other) {
if (other != null) {
@@ -141,8 +146,7 @@ public class MutablePropertyValues implements PropertyValues, Serializable {
* Add all property values from the given Map.
* @param other Map with property values keyed by property name,
* which must be a String
- * @return this object to allow creating objects, adding multiple
- * PropertyValues in a single statement
+ * @return this in order to allow for adding multiple property values in a chain
*/
public MutablePropertyValues addPropertyValues(Map, ?> other) {
if (other != null) {
@@ -154,11 +158,10 @@ public class MutablePropertyValues implements PropertyValues, Serializable {
}
/**
- * Add a PropertyValue object, replacing any existing one
- * for the corresponding property.
+ * Add a PropertyValue object, replacing any existing one for the
+ * corresponding property or getting merged with it (if applicable).
* @param pv PropertyValue object to add
- * @return this object to allow creating objects, adding multiple
- * PropertyValues in a single statement
+ * @return this in order to allow for adding multiple property values in a chain
*/
public MutablePropertyValues addPropertyValue(PropertyValue pv) {
for (int i = 0; i < this.propertyValueList.size(); i++) {
@@ -179,11 +182,25 @@ public class MutablePropertyValues implements PropertyValues, Serializable {
* @param propertyName name of the property
* @param propertyValue value of the property
* @see #addPropertyValue(PropertyValue)
+ * @deprecated as of Spring 3.0, in favor of the chaining-capable {@link #add}
*/
+ @Deprecated
public void addPropertyValue(String propertyName, Object propertyValue) {
addPropertyValue(new PropertyValue(propertyName, propertyValue));
}
+ /**
+ * Add a PropertyValue object, replacing any existing one for the
+ * corresponding property or getting merged with it (if applicable).
+ * @param propertyName name of the property
+ * @param propertyValue value of the property
+ * @return this in order to allow for adding multiple property values in a chain
+ */
+ public MutablePropertyValues add(String propertyName, Object propertyValue) {
+ addPropertyValue(new PropertyValue(propertyName, propertyValue));
+ return this;
+ }
+
/**
* Modify a PropertyValue object held in this object.
* Indexed from 0.
@@ -209,15 +226,6 @@ public class MutablePropertyValues implements PropertyValues, Serializable {
return newPv;
}
- /**
- * Overloaded version of removePropertyValue that takes a property name.
- * @param propertyName name of the property
- * @see #removePropertyValue(PropertyValue)
- */
- public void removePropertyValue(String propertyName) {
- removePropertyValue(getPropertyValue(propertyName));
- }
-
/**
* Remove the given PropertyValue, if contained.
* @param pv the PropertyValue to remove
@@ -227,10 +235,12 @@ public class MutablePropertyValues implements PropertyValues, Serializable {
}
/**
- * Clear this holder, removing all PropertyValues.
+ * Overloaded version of removePropertyValue that takes a property name.
+ * @param propertyName name of the property
+ * @see #removePropertyValue(PropertyValue)
*/
- public void clear() {
- this.propertyValueList.clear();
+ public void removePropertyValue(String propertyName) {
+ this.propertyValueList.remove(getPropertyValue(propertyName));
}
@@ -247,34 +257,6 @@ public class MutablePropertyValues implements PropertyValues, Serializable {
return null;
}
- /**
- * 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 {@link #contains} call for the specified property.
- * @param propertyName the name of the property.
- */
- public void registerProcessedProperty(String propertyName) {
- if (this.processedProperties == null) {
- this.processedProperties = new HashSet();
- }
- this.processedProperties.add(propertyName);
- }
-
- public boolean contains(String propertyName) {
- return (getPropertyValue(propertyName) != null ||
- (this.processedProperties != null && this.processedProperties.contains(propertyName)));
- }
-
- public boolean isEmpty() {
- return this.propertyValueList.isEmpty();
- }
-
- public int size() {
- return this.propertyValueList.size();
- }
-
public PropertyValues changesSince(PropertyValues old) {
MutablePropertyValues changes = new MutablePropertyValues();
if (old == this) {
@@ -296,6 +278,30 @@ public class MutablePropertyValues implements PropertyValues, Serializable {
return changes;
}
+ public boolean contains(String propertyName) {
+ return (getPropertyValue(propertyName) != null ||
+ (this.processedProperties != null && this.processedProperties.contains(propertyName)));
+ }
+
+ public boolean isEmpty() {
+ return this.propertyValueList.isEmpty();
+ }
+
+
+ /**
+ * 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 {@link #contains} call for the specified property.
+ * @param propertyName the name of the property.
+ */
+ public void registerProcessedProperty(String propertyName) {
+ if (this.processedProperties == null) {
+ this.processedProperties = new HashSet();
+ }
+ this.processedProperties.add(propertyName);
+ }
/**
* Mark this holder as containing converted values only
diff --git a/org.springframework.beans/src/main/java/org/springframework/beans/PropertyValues.java b/org.springframework.beans/src/main/java/org/springframework/beans/PropertyValues.java
index 2a5657a35fb..e2180a077e7 100644
--- a/org.springframework.beans/src/main/java/org/springframework/beans/PropertyValues.java
+++ b/org.springframework.beans/src/main/java/org/springframework/beans/PropertyValues.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -39,6 +39,16 @@ public interface PropertyValues {
*/
PropertyValue getPropertyValue(String propertyName);
+ /**
+ * Return the changes since the previous PropertyValues.
+ * Subclasses should also override equals.
+ * @param old old property values
+ * @return PropertyValues updated or new properties.
+ * Return empty PropertyValues if there are no changes.
+ * @see java.lang.Object#equals
+ */
+ PropertyValues changesSince(PropertyValues old);
+
/**
* Is there a property value (or other processing entry) for this property?
* @param propertyName the name of the property we're interested in
@@ -51,14 +61,4 @@ public interface PropertyValues {
*/
boolean isEmpty();
- /**
- * Return the changes since the previous PropertyValues.
- * Subclasses should also override equals.
- * @param old old property values
- * @return PropertyValues updated or new properties.
- * Return empty PropertyValues if there are no changes.
- * @see java.lang.Object#equals
- */
- PropertyValues changesSince(PropertyValues old);
-
}
diff --git a/org.springframework.beans/src/main/java/org/springframework/beans/factory/config/BeanDefinitionVisitor.java b/org.springframework.beans/src/main/java/org/springframework/beans/factory/config/BeanDefinitionVisitor.java
index ee9b5b5bcd4..d5b5617ccaa 100644
--- a/org.springframework.beans/src/main/java/org/springframework/beans/factory/config/BeanDefinitionVisitor.java
+++ b/org.springframework.beans/src/main/java/org/springframework/beans/factory/config/BeanDefinitionVisitor.java
@@ -139,7 +139,7 @@ public class BeanDefinitionVisitor {
for (PropertyValue pv : pvArray) {
Object newVal = resolveValue(pv.getValue());
if (!ObjectUtils.nullSafeEquals(newVal, pv.getValue())) {
- pvs.addPropertyValue(pv.getName(), newVal);
+ pvs.add(pv.getName(), newVal);
}
}
}
diff --git a/org.springframework.beans/src/main/java/org/springframework/beans/factory/config/ConfigurableBeanFactory.java b/org.springframework.beans/src/main/java/org/springframework/beans/factory/config/ConfigurableBeanFactory.java
index da252ee217e..a755ea124a7 100644
--- a/org.springframework.beans/src/main/java/org/springframework/beans/factory/config/ConfigurableBeanFactory.java
+++ b/org.springframework.beans/src/main/java/org/springframework/beans/factory/config/ConfigurableBeanFactory.java
@@ -99,12 +99,14 @@ public interface ConfigurableBeanFactory extends HierarchicalBeanFactory, Single
* load-time weaving is involved, to make sure that actual bean
* classes are loaded as lazily as possible. The temporary loader is
* then removed once the BeanFactory completes its bootstrap phase.
+ * @since 2.5
*/
void setTempClassLoader(ClassLoader tempClassLoader);
/**
* Return the temporary ClassLoader to use for type matching purposes,
* if any.
+ * @since 2.5
*/
ClassLoader getTempClassLoader();
@@ -128,22 +130,26 @@ public interface ConfigurableBeanFactory extends HierarchicalBeanFactory, Single
*
There is no expression support active in a BeanFactory by default.
* An ApplicationContext will typically set a standard expression strategy
* here, supporting "#{...}" expressions in a Unified EL compatible style.
+ * @since 3.0
*/
void setBeanExpressionResolver(BeanExpressionResolver resolver);
/**
* Return the resolution strategy for expressions in bean definition values.
+ * @since 3.0
*/
BeanExpressionResolver getBeanExpressionResolver();
/**
* Specify a Spring 3.0 ConversionService to use for converting
* property values, as an alternative to JavaBeans PropertyEditors.
+ * @since 3.0
*/
void setConversionService(ConversionService conversionService);
/**
* Return the associated ConversionService, if any.
+ * @since 3.0
*/
ConversionService getConversionService();
@@ -183,6 +189,7 @@ public interface ConfigurableBeanFactory extends HierarchicalBeanFactory, Single
* any custom editors or custom editor registrars irrelevant.
* @see #addPropertyEditorRegistrar
* @see #registerCustomEditor
+ * @since 2.5
*/
void setTypeConverter(TypeConverter typeConverter);
@@ -191,12 +198,14 @@ public interface ConfigurableBeanFactory extends HierarchicalBeanFactory, Single
* instance for each call, since TypeConverters are usually not thread-safe.
*
If the default PropertyEditor mechanism is active, the returned
* TypeConverter will be aware of all custom editors that have been registered.
+ * @since 2.5
*/
TypeConverter getTypeConverter();
/**
* Add a String resolver for embedded values such as annotation attributes.
* @param valueResolver the String resolver to apply to embedded values
+ * @since 3.0
*/
void addEmbeddedValueResolver(StringValueResolver valueResolver);
@@ -204,6 +213,7 @@ public interface ConfigurableBeanFactory extends HierarchicalBeanFactory, Single
* Resolve the given embedded value, e.g. an annotation attribute.
* @param value the value to resolve
* @return the resolved value (may be the original value as-is)
+ * @since 3.0
*/
String resolveEmbeddedValue(String value);
@@ -253,6 +263,7 @@ public interface ConfigurableBeanFactory extends HierarchicalBeanFactory, Single
/**
* Provides a security access control context relevant to this factory.
* @return the applicable AccessControlContext (never null)
+ * @since 3.0
*/
AccessControlContext getAccessControlContext();
@@ -284,6 +295,7 @@ public interface ConfigurableBeanFactory extends HierarchicalBeanFactory, Single
*
The value resolver may for example resolve placeholders
* in target bean names and even in alias names.
* @param valueResolver the StringValueResolver to apply
+ * @since 2.5
*/
void resolveAliases(StringValueResolver valueResolver);
@@ -294,6 +306,7 @@ public interface ConfigurableBeanFactory extends HierarchicalBeanFactory, Single
* @param beanName the name of the bean to retrieve the merged definition for
* @return a (potentially merged) BeanDefinition for the given bean
* @throws NoSuchBeanDefinitionException if there is no bean definition with the given name
+ * @since 2.5
*/
BeanDefinition getMergedBeanDefinition(String beanName) throws NoSuchBeanDefinitionException;
@@ -303,6 +316,7 @@ public interface ConfigurableBeanFactory extends HierarchicalBeanFactory, Single
* @return whether the bean is a FactoryBean
* (false means the bean exists but is not a FactoryBean)
* @throws NoSuchBeanDefinitionException if there is no bean with the given name
+ * @since 2.5
*/
boolean isFactoryBean(String name) throws NoSuchBeanDefinitionException;
@@ -310,6 +324,7 @@ public interface ConfigurableBeanFactory extends HierarchicalBeanFactory, Single
* Determine whether the specified bean is currently in creation.
* @param beanName the name of the bean
* @return whether the bean is currently in creation
+ * @since 2.5
*/
boolean isCurrentlyInCreation(String beanName);
@@ -318,6 +333,7 @@ public interface ConfigurableBeanFactory extends HierarchicalBeanFactory, Single
* to be destroyed before the given bean is destroyed.
* @param beanName the name of the bean
* @param dependentBeanName the name of the dependent bean
+ * @since 2.5
*/
void registerDependentBean(String beanName, String dependentBeanName);
@@ -325,6 +341,7 @@ public interface ConfigurableBeanFactory extends HierarchicalBeanFactory, Single
* Return the names of all beans which depend on the specified bean, if any.
* @param beanName the name of the bean
* @return the array of dependent bean names, or an empty array if none
+ * @since 2.5
*/
String[] getDependentBeans(String beanName);
@@ -333,6 +350,7 @@ public interface ConfigurableBeanFactory extends HierarchicalBeanFactory, Single
* @param beanName the name of the bean
* @return the array of names of beans which the bean depends on,
* or an empty array if none
+ * @since 2.5
*/
String[] getDependenciesForBean(String beanName);
diff --git a/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java b/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java
index e45ad9526e5..324e6a13835 100644
--- a/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java
+++ b/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java
@@ -1083,7 +1083,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
for (String propertyName : propertyNames) {
if (containsBean(propertyName)) {
Object bean = getBean(propertyName);
- pvs.addPropertyValue(propertyName, bean);
+ pvs.add(propertyName, bean);
registerDependentBean(propertyName, beanName);
if (logger.isDebugEnabled()) {
logger.debug(
@@ -1131,7 +1131,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
Object autowiredArgument = resolveDependency(desc, beanName, autowiredBeanNames, converter);
if (autowiredArgument != null) {
- pvs.addPropertyValue(propertyName, autowiredArgument);
+ pvs.add(propertyName, autowiredArgument);
}
for (String autowiredBeanName : autowiredBeanNames) {
registerDependentBean(autowiredBeanName, beanName);
diff --git a/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionBuilder.java b/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionBuilder.java
index 8edd245ccaf..a734e493605 100644
--- a/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionBuilder.java
+++ b/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionBuilder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,7 +16,6 @@
package org.springframework.beans.factory.support;
-import org.springframework.beans.PropertyValue;
import org.springframework.beans.factory.config.RuntimeBeanReference;
import org.springframework.util.ObjectUtils;
@@ -194,7 +193,8 @@ public class BeanDefinitionBuilder {
* and all additions are at the present point.
*/
public BeanDefinitionBuilder addConstructorArgValue(Object value) {
- this.beanDefinition.getConstructorArgumentValues().addIndexedArgumentValue(this.constructorArgIndex++, value);
+ this.beanDefinition.getConstructorArgumentValues().addIndexedArgumentValue(
+ this.constructorArgIndex++, value);
return this;
}
@@ -203,14 +203,16 @@ public class BeanDefinitionBuilder {
* @see #addConstructorArgValue(Object)
*/
public BeanDefinitionBuilder addConstructorArgReference(String beanName) {
- return addConstructorArgValue(new RuntimeBeanReference(beanName));
+ this.beanDefinition.getConstructorArgumentValues().addIndexedArgumentValue(
+ this.constructorArgIndex++, new RuntimeBeanReference(beanName));
+ return this;
}
/**
* Add the supplied property value under the given name.
*/
public BeanDefinitionBuilder addPropertyValue(String name, Object value) {
- this.beanDefinition.getPropertyValues().addPropertyValue(new PropertyValue(name, value));
+ this.beanDefinition.getPropertyValues().add(name, value);
return this;
}
@@ -220,7 +222,8 @@ public class BeanDefinitionBuilder {
* @param beanName the name of the bean being referenced
*/
public BeanDefinitionBuilder addPropertyReference(String name, String beanName) {
- return addPropertyValue(name, new RuntimeBeanReference(beanName));
+ this.beanDefinition.getPropertyValues().add(name, new RuntimeBeanReference(beanName));
+ return this;
}
/**
diff --git a/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/PropertiesBeanDefinitionReader.java b/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/PropertiesBeanDefinitionReader.java
index 21316df7e3b..71b673c8d8e 100644
--- a/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/PropertiesBeanDefinitionReader.java
+++ b/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/PropertiesBeanDefinitionReader.java
@@ -459,11 +459,11 @@ public class PropertiesBeanDefinitionReader extends AbstractBeanDefinitionReader
// It doesn't matter if the referenced bean hasn't yet been registered:
// this will ensure that the reference is resolved at runtime.
Object val = new RuntimeBeanReference(ref);
- pvs.addPropertyValue(property, val);
+ pvs.add(property, val);
}
else {
// It's a normal bean property.
- pvs.addPropertyValue(property, readValue(entry));
+ pvs.add(property, readValue(entry));
}
}
}
diff --git a/org.springframework.beans/src/main/java/org/springframework/beans/factory/xml/ParserContext.java b/org.springframework.beans/src/main/java/org/springframework/beans/factory/xml/ParserContext.java
index 7d982d5dd9b..c36314c0d14 100644
--- a/org.springframework.beans/src/main/java/org/springframework/beans/factory/xml/ParserContext.java
+++ b/org.springframework.beans/src/main/java/org/springframework/beans/factory/xml/ParserContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -44,7 +44,7 @@ public final class ParserContext {
private BeanDefinition containingBeanDefinition;
- private final Stack containingComponents = new Stack();
+ private final Stack containingComponents = new Stack();
public ParserContext(XmlReaderContext readerContext, BeanDefinitionParserDelegate delegate) {
diff --git a/org.springframework.beans/src/main/java/org/springframework/beans/factory/xml/SimplePropertyNamespaceHandler.java b/org.springframework.beans/src/main/java/org/springframework/beans/factory/xml/SimplePropertyNamespaceHandler.java
index dad2032796a..ee8101b46e5 100644
--- a/org.springframework.beans/src/main/java/org/springframework/beans/factory/xml/SimplePropertyNamespaceHandler.java
+++ b/org.springframework.beans/src/main/java/org/springframework/beans/factory/xml/SimplePropertyNamespaceHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -44,6 +44,7 @@ import org.springframework.core.Conventions;
* be injected into that property.
*
* @author Rob Harrop
+ * @author Juergen Hoeller
* @since 2.0
*/
public class SimplePropertyNamespaceHandler implements NamespaceHandler {
@@ -72,11 +73,10 @@ public class SimplePropertyNamespaceHandler implements NamespaceHandler {
}
if (propertyName.endsWith(REF_SUFFIX)) {
propertyName = propertyName.substring(0, propertyName.length() - REF_SUFFIX.length());
- pvs.addPropertyValue(
- Conventions.attributeNameToPropertyName(propertyName), new RuntimeBeanReference(propertyValue));
+ pvs.add(Conventions.attributeNameToPropertyName(propertyName), new RuntimeBeanReference(propertyValue));
}
else {
- pvs.addPropertyValue(Conventions.attributeNameToPropertyName(propertyName), propertyValue);
+ pvs.add(Conventions.attributeNameToPropertyName(propertyName), propertyValue);
}
}
return definition;
diff --git a/org.springframework.beans/src/test/java/org/springframework/beans/BeanWrapperTests.java b/org.springframework.beans/src/test/java/org/springframework/beans/BeanWrapperTests.java
index 802a9e8e501..3ba479a1aa8 100644
--- a/org.springframework.beans/src/test/java/org/springframework/beans/BeanWrapperTests.java
+++ b/org.springframework.beans/src/test/java/org/springframework/beans/BeanWrapperTests.java
@@ -36,7 +36,6 @@ import java.util.SortedMap;
import java.util.SortedSet;
import java.util.TreeMap;
import java.util.TreeSet;
-import java.util.Map.Entry;
import org.apache.commons.logging.LogFactory;
import org.junit.Test;
@@ -252,7 +251,7 @@ public final class BeanWrapperTests {
@Test
public void testIgnoringIndexedProperty() {
MutablePropertyValues values = new MutablePropertyValues();
- values.addPropertyValue("toBeIgnored[0]", new Integer(42));
+ values.add("toBeIgnored[0]", new Integer(42));
BeanWrapper bw = new BeanWrapperImpl(new Object());
bw.setPropertyValues(values, true);
}
@@ -260,7 +259,7 @@ public final class BeanWrapperTests {
@Test
public void testConvertPrimitiveToString() {
MutablePropertyValues values = new MutablePropertyValues();
- values.addPropertyValue("name", new Integer(42));
+ values.add("name", new Integer(42));
TestBean tb = new TestBean();
BeanWrapper bw = new BeanWrapperImpl(tb);
bw.setPropertyValues(values);
@@ -270,7 +269,7 @@ public final class BeanWrapperTests {
@Test
public void testConvertClassToString() {
MutablePropertyValues values = new MutablePropertyValues();
- values.addPropertyValue("name", Integer.class);
+ values.add("name", Integer.class);
TestBean tb = new TestBean();
BeanWrapper bw = new BeanWrapperImpl(tb);
bw.registerCustomEditor(String.class, new PropertyEditorSupport() {
@@ -874,16 +873,16 @@ public final class BeanWrapperTests {
assertEquals("nameY", bw.getPropertyValue("map[key4][1].name"));
MutablePropertyValues pvs = new MutablePropertyValues();
- pvs.addPropertyValue("array[0].name", "name5");
- pvs.addPropertyValue("array[1].name", "name4");
- pvs.addPropertyValue("list[0].name", "name3");
- pvs.addPropertyValue("list[1].name", "name2");
- pvs.addPropertyValue("set[0].name", "name8");
- pvs.addPropertyValue("set[1].name", "name9");
- pvs.addPropertyValue("map[key1].name", "name1");
- pvs.addPropertyValue("map['key.3'].name", "name0");
- pvs.addPropertyValue("map[key4][0].name", "nameA");
- pvs.addPropertyValue("map[key4][1].name", "nameB");
+ pvs.add("array[0].name", "name5");
+ pvs.add("array[1].name", "name4");
+ pvs.add("list[0].name", "name3");
+ pvs.add("list[1].name", "name2");
+ pvs.add("set[0].name", "name8");
+ pvs.add("set[1].name", "name9");
+ pvs.add("map[key1].name", "name1");
+ pvs.add("map['key.3'].name", "name0");
+ pvs.add("map[key4][0].name", "nameA");
+ pvs.add("map[key4][1].name", "nameB");
bw.setPropertyValues(pvs);
assertEquals("name5", tb0.getName());
assertEquals("name4", tb1.getName());
@@ -927,16 +926,16 @@ public final class BeanWrapperTests {
assertEquals(tb5, bw.getPropertyValue("map[\"key2\"]"));
MutablePropertyValues pvs = new MutablePropertyValues();
- pvs.addPropertyValue("array[0]", tb5);
- pvs.addPropertyValue("array[1]", tb4);
- pvs.addPropertyValue("list[0]", tb3);
- pvs.addPropertyValue("list[1]", tb2);
- pvs.addPropertyValue("list[2]", tb0);
- pvs.addPropertyValue("list[4]", tb1);
- pvs.addPropertyValue("map[key1]", tb1);
- pvs.addPropertyValue("map['key2']", tb0);
- pvs.addPropertyValue("map[key5]", tb4);
- pvs.addPropertyValue("map['key9']", tb5);
+ pvs.add("array[0]", tb5);
+ pvs.add("array[1]", tb4);
+ pvs.add("list[0]", tb3);
+ pvs.add("list[1]", tb2);
+ pvs.add("list[2]", tb0);
+ pvs.add("list[4]", tb1);
+ pvs.add("map[key1]", tb1);
+ pvs.add("map['key2']", tb0);
+ pvs.add("map[key5]", tb4);
+ pvs.add("map['key9']", tb5);
bw.setPropertyValues(pvs);
assertEquals(tb5, bean.getArray()[0]);
assertEquals(tb4, bean.getArray()[1]);
@@ -976,15 +975,15 @@ public final class BeanWrapperTests {
});
MutablePropertyValues pvs = new MutablePropertyValues();
- pvs.addPropertyValue("map[key1]", "rod");
- pvs.addPropertyValue("map[key2]", "rob");
+ pvs.add("map[key1]", "rod");
+ pvs.add("map[key2]", "rob");
bw.setPropertyValues(pvs);
assertEquals("rod", ((TestBean) bean.getMap().get("key1")).getName());
assertEquals("rob", ((TestBean) bean.getMap().get("key2")).getName());
pvs = new MutablePropertyValues();
- pvs.addPropertyValue("map[key1]", "rod");
- pvs.addPropertyValue("map[key2]", "");
+ pvs.add("map[key1]", "rod");
+ pvs.add("map[key2]", "");
try {
bw.setPropertyValues(pvs);
fail("Should have thrown TypeMismatchException");
@@ -1012,7 +1011,7 @@ public final class BeanWrapperTests {
inputMap.put(new Integer(1), "rod");
inputMap.put(new Integer(2), "rob");
MutablePropertyValues pvs = new MutablePropertyValues();
- pvs.addPropertyValue("map", Collections.unmodifiableMap(inputMap));
+ pvs.add("map", Collections.unmodifiableMap(inputMap));
bw.setPropertyValues(pvs);
assertEquals("rod", ((TestBean) bean.getMap().get(new Integer(1))).getName());
assertEquals("rob", ((TestBean) bean.getMap().get(new Integer(2))).getName());
@@ -1035,7 +1034,7 @@ public final class BeanWrapperTests {
inputMap.put(new Integer(1), "rod");
inputMap.put(new Integer(2), "rob");
MutablePropertyValues pvs = new MutablePropertyValues();
- pvs.addPropertyValue("map", new ReadOnlyMap(inputMap));
+ pvs.add("map", new ReadOnlyMap(inputMap));
bw.setPropertyValues(pvs);
assertEquals("rod", ((TestBean) bean.getMap().get(new Integer(1))).getName());
assertEquals("rob", ((TestBean) bean.getMap().get(new Integer(2))).getName());
@@ -1051,7 +1050,7 @@ public final class BeanWrapperTests {
inputMap.put(new Integer(2), "rob");
ReadOnlyMap readOnlyMap = new ReadOnlyMap(inputMap);
MutablePropertyValues pvs = new MutablePropertyValues();
- pvs.addPropertyValue("map", readOnlyMap);
+ pvs.add("map", readOnlyMap);
bw.setPropertyValues(pvs);
assertSame(readOnlyMap, bean.getMap());
assertFalse(readOnlyMap.isAccessed());
diff --git a/org.springframework.beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java b/org.springframework.beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java
index f4c896afba9..8569ebb2432 100644
--- a/org.springframework.beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java
+++ b/org.springframework.beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java
@@ -550,7 +550,7 @@ public final class DefaultListableBeanFactoryTests {
public void testSelfReference() {
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
MutablePropertyValues pvs = new MutablePropertyValues();
- pvs.addPropertyValue("spouse", new RuntimeBeanReference("self"));
+ pvs.add("spouse", new RuntimeBeanReference("self"));
lbf.registerBeanDefinition("self", new RootBeanDefinition(TestBean.class, pvs));
TestBean self = (TestBean) lbf.getBean("self");
assertEquals(self, self.getSpouse());
@@ -561,7 +561,7 @@ public final class DefaultListableBeanFactoryTests {
try {
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
MutablePropertyValues pvs = new MutablePropertyValues();
- pvs.addPropertyValue("ag", "foobar");
+ pvs.add("ag", "foobar");
lbf.registerBeanDefinition("tb", new RootBeanDefinition(TestBean.class, pvs));
lbf.getBean("tb");
fail("Should throw exception on invalid property");
@@ -685,8 +685,8 @@ public final class DefaultListableBeanFactoryTests {
RootBeanDefinition parentDefinition = new RootBeanDefinition(TestBean.class);
parentDefinition.setAbstract(true);
- parentDefinition.getPropertyValues().addPropertyValue("name", EXPECTED_NAME);
- parentDefinition.getPropertyValues().addPropertyValue("age", new Integer(EXPECTED_AGE));
+ parentDefinition.getPropertyValues().add("name", EXPECTED_NAME);
+ parentDefinition.getPropertyValues().add("age", new Integer(EXPECTED_AGE));
ChildBeanDefinition childDefinition = new ChildBeanDefinition("alias");
@@ -832,7 +832,7 @@ public final class DefaultListableBeanFactoryTests {
}
});
MutablePropertyValues pvs = new MutablePropertyValues();
- pvs.addPropertyValue("myFloat", "1,1");
+ pvs.add("myFloat", "1,1");
lbf.registerBeanDefinition("testBean", new RootBeanDefinition(TestBean.class, pvs));
TestBean testBean = (TestBean) lbf.getBean("testBean");
assertTrue(testBean.getMyFloat().floatValue() == 1.1f);
@@ -855,7 +855,7 @@ public final class DefaultListableBeanFactoryTests {
});
lbf.setConversionService(conversionService);
MutablePropertyValues pvs = new MutablePropertyValues();
- pvs.addPropertyValue("myFloat", "1,1");
+ pvs.add("myFloat", "1,1");
lbf.registerBeanDefinition("testBean", new RootBeanDefinition(TestBean.class, pvs));
TestBean testBean = (TestBean) lbf.getBean("testBean");
assertTrue(testBean.getMyFloat().floatValue() == 1.1f);
@@ -871,7 +871,7 @@ public final class DefaultListableBeanFactoryTests {
}
});
MutablePropertyValues pvs = new MutablePropertyValues();
- pvs.addPropertyValue("myFloat", new RuntimeBeanReference("myFloat"));
+ pvs.add("myFloat", new RuntimeBeanReference("myFloat"));
lbf.registerBeanDefinition("testBean", new RootBeanDefinition(TestBean.class, pvs));
lbf.registerSingleton("myFloat", "1,1");
TestBean testBean = (TestBean) lbf.getBean("testBean");
@@ -884,7 +884,7 @@ public final class DefaultListableBeanFactoryTests {
NumberFormat nf = NumberFormat.getInstance(Locale.GERMAN);
lbf.setTypeConverter(new CustomTypeConverter(nf));
MutablePropertyValues pvs = new MutablePropertyValues();
- pvs.addPropertyValue("myFloat", "1,1");
+ pvs.add("myFloat", "1,1");
ConstructorArgumentValues cav = new ConstructorArgumentValues();
cav.addIndexedArgumentValue(0, "myName");
cav.addIndexedArgumentValue(1, "myAge");
@@ -901,7 +901,7 @@ public final class DefaultListableBeanFactoryTests {
NumberFormat nf = NumberFormat.getInstance(Locale.GERMAN);
lbf.setTypeConverter(new CustomTypeConverter(nf));
MutablePropertyValues pvs = new MutablePropertyValues();
- pvs.addPropertyValue("myFloat", new RuntimeBeanReference("myFloat"));
+ pvs.add("myFloat", new RuntimeBeanReference("myFloat"));
ConstructorArgumentValues cav = new ConstructorArgumentValues();
cav.addIndexedArgumentValue(0, "myName");
cav.addIndexedArgumentValue(1, "myAge");
@@ -973,8 +973,8 @@ public final class DefaultListableBeanFactoryTests {
public void testRegisterExistingSingletonWithAutowire() {
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
MutablePropertyValues pvs = new MutablePropertyValues();
- pvs.addPropertyValue("name", "Tony");
- pvs.addPropertyValue("age", "48");
+ pvs.add("name", "Tony");
+ pvs.add("age", "48");
RootBeanDefinition bd = new RootBeanDefinition(DependenciesBean.class, pvs);
bd.setDependencyCheck(RootBeanDefinition.DEPENDENCY_CHECK_OBJECTS);
bd.setAutowireMode(RootBeanDefinition.AUTOWIRE_BY_TYPE);
@@ -1115,7 +1115,7 @@ public final class DefaultListableBeanFactoryTests {
public void testAutowireWithSatisfiedJavaBeanDependency() {
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
MutablePropertyValues pvs = new MutablePropertyValues();
- pvs.addPropertyValue("name", "Rod");
+ pvs.add("name", "Rod");
RootBeanDefinition bd = new RootBeanDefinition(TestBean.class, pvs);
lbf.registerBeanDefinition("rod", bd);
assertEquals(1, lbf.getBeanDefinitionCount());
@@ -1131,7 +1131,7 @@ public final class DefaultListableBeanFactoryTests {
public void testAutowireWithSatisfiedConstructorDependency() {
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
MutablePropertyValues pvs = new MutablePropertyValues();
- pvs.addPropertyValue("name", "Rod");
+ pvs.add("name", "Rod");
RootBeanDefinition bd = new RootBeanDefinition(TestBean.class, pvs);
lbf.registerBeanDefinition("rod", bd);
assertEquals(1, lbf.getBeanDefinitionCount());
@@ -1392,7 +1392,7 @@ public final class DefaultListableBeanFactoryTests {
public void testApplyBeanPropertyValues() {
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
MutablePropertyValues pvs = new MutablePropertyValues();
- pvs.addPropertyValue("age", "99");
+ pvs.add("age", "99");
lbf.registerBeanDefinition("test", new RootBeanDefinition(TestBean.class, pvs));
TestBean tb = new TestBean();
assertEquals(0, tb.getAge());
@@ -1404,7 +1404,7 @@ public final class DefaultListableBeanFactoryTests {
public void testApplyBeanPropertyValuesWithIncompleteDefinition() {
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
MutablePropertyValues pvs = new MutablePropertyValues();
- pvs.addPropertyValue("age", "99");
+ pvs.add("age", "99");
lbf.registerBeanDefinition("test", new RootBeanDefinition(null, pvs));
TestBean tb = new TestBean();
assertEquals(0, tb.getAge());
@@ -1418,7 +1418,7 @@ public final class DefaultListableBeanFactoryTests {
public void testConfigureBean() {
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
MutablePropertyValues pvs = new MutablePropertyValues();
- pvs.addPropertyValue("age", "99");
+ pvs.add("age", "99");
lbf.registerBeanDefinition("test", new RootBeanDefinition(TestBean.class, pvs));
TestBean tb = new TestBean();
assertEquals(0, tb.getAge());
@@ -1434,7 +1434,7 @@ public final class DefaultListableBeanFactoryTests {
RootBeanDefinition bd = new RootBeanDefinition(TestBean.class, new MutablePropertyValues());
lbf.registerBeanDefinition("spouse", bd);
MutablePropertyValues pvs = new MutablePropertyValues();
- pvs.addPropertyValue("age", "99");
+ pvs.add("age", "99");
lbf.registerBeanDefinition("test", new RootBeanDefinition(TestBean.class, RootBeanDefinition.AUTOWIRE_BY_NAME));
TestBean tb = new TestBean();
lbf.configureBean(tb, "test");
@@ -1753,8 +1753,8 @@ public final class DefaultListableBeanFactoryTests {
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
RootBeanDefinition rbd = new RootBeanDefinition(TestBean.class);
rbd.setScope(RootBeanDefinition.SCOPE_PROTOTYPE);
- rbd.getPropertyValues().addPropertyValue("name", "juergen");
- rbd.getPropertyValues().addPropertyValue("age", "99");
+ rbd.getPropertyValues().add("name", "juergen");
+ rbd.getPropertyValues().add("age", "99");
lbf.registerBeanDefinition("test", rbd);
StopWatch sw = new StopWatch();
sw.start("prototype");
@@ -1802,7 +1802,7 @@ public final class DefaultListableBeanFactoryTests {
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
RootBeanDefinition rbd = new RootBeanDefinition(TestBean.class);
rbd.setScope(RootBeanDefinition.SCOPE_PROTOTYPE);
- rbd.getPropertyValues().addPropertyValue("spouse", new RuntimeBeanReference("spouse"));
+ rbd.getPropertyValues().add("spouse", new RuntimeBeanReference("spouse"));
lbf.registerBeanDefinition("test", rbd);
lbf.registerBeanDefinition("spouse", new RootBeanDefinition(TestBean.class));
TestBean spouse = (TestBean) lbf.getBean("spouse");
@@ -1882,7 +1882,7 @@ public final class DefaultListableBeanFactoryTests {
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
RootBeanDefinition instanceFactoryDefinition = new RootBeanDefinition(BeanWithFactoryMethod.class);
MutablePropertyValues pvs = new MutablePropertyValues();
- pvs.addPropertyValue("name", expectedNameFromProperties);
+ pvs.add("name", expectedNameFromProperties);
instanceFactoryDefinition.setPropertyValues(pvs);
lbf.registerBeanDefinition("factoryBeanInstance", instanceFactoryDefinition);
diff --git a/org.springframework.beans/src/test/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessorTests.java b/org.springframework.beans/src/test/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessorTests.java
index 6ab3a0b99cf..0e9d4424b85 100644
--- a/org.springframework.beans/src/test/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessorTests.java
+++ b/org.springframework.beans/src/test/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessorTests.java
@@ -129,7 +129,7 @@ public final class AutowiredAnnotationBeanPostProcessorTests {
bf.addBeanPostProcessor(bpp);
RootBeanDefinition annotatedBd = new RootBeanDefinition(TypedExtendedResourceInjectionBean.class);
TestBean tb2 = new TestBean();
- annotatedBd.getPropertyValues().addPropertyValue("testBean2", tb2);
+ annotatedBd.getPropertyValues().add("testBean2", tb2);
bf.registerBeanDefinition("annotatedBean", annotatedBd);
TestBean tb = new TestBean();
bf.registerSingleton("testBean", tb);
diff --git a/org.springframework.beans/src/test/java/org/springframework/beans/factory/annotation/InjectAnnotationBeanPostProcessorTests.java b/org.springframework.beans/src/test/java/org/springframework/beans/factory/annotation/InjectAnnotationBeanPostProcessorTests.java
index 0bf98607551..0621e87415f 100644
--- a/org.springframework.beans/src/test/java/org/springframework/beans/factory/annotation/InjectAnnotationBeanPostProcessorTests.java
+++ b/org.springframework.beans/src/test/java/org/springframework/beans/factory/annotation/InjectAnnotationBeanPostProcessorTests.java
@@ -126,7 +126,7 @@ public class InjectAnnotationBeanPostProcessorTests {
bf.addBeanPostProcessor(bpp);
RootBeanDefinition annotatedBd = new RootBeanDefinition(TypedExtendedResourceInjectionBean.class);
TestBean tb2 = new TestBean();
- annotatedBd.getPropertyValues().addPropertyValue("testBean2", tb2);
+ annotatedBd.getPropertyValues().add("testBean2", tb2);
bf.registerBeanDefinition("annotatedBean", annotatedBd);
TestBean tb = new TestBean();
bf.registerSingleton("testBean", tb);
diff --git a/org.springframework.beans/src/test/java/org/springframework/beans/factory/config/CustomEditorConfigurerTests.java b/org.springframework.beans/src/test/java/org/springframework/beans/factory/config/CustomEditorConfigurerTests.java
index 3f9b8227708..c7870b3236b 100644
--- a/org.springframework.beans/src/test/java/org/springframework/beans/factory/config/CustomEditorConfigurerTests.java
+++ b/org.springframework.beans/src/test/java/org/springframework/beans/factory/config/CustomEditorConfigurerTests.java
@@ -60,10 +60,10 @@ public final class CustomEditorConfigurerTests {
cec.postProcessBeanFactory(bf);
MutablePropertyValues pvs = new MutablePropertyValues();
- pvs.addPropertyValue("date", "2.12.1975");
+ pvs.add("date", "2.12.1975");
bf.registerBeanDefinition("tb1", new RootBeanDefinition(TestBean.class, pvs));
pvs = new MutablePropertyValues();
- pvs.addPropertyValue("someMap[myKey]", new TypedStringValue("2.12.1975", Date.class));
+ pvs.add("someMap[myKey]", new TypedStringValue("2.12.1975", Date.class));
bf.registerBeanDefinition("tb2", new RootBeanDefinition(TestBean.class, pvs));
TestBean tb1 = (TestBean) bf.getBean("tb1");
@@ -83,10 +83,10 @@ public final class CustomEditorConfigurerTests {
cec.postProcessBeanFactory(bf);
MutablePropertyValues pvs = new MutablePropertyValues();
- pvs.addPropertyValue("date", "2.12.1975");
+ pvs.add("date", "2.12.1975");
bf.registerBeanDefinition("tb1", new RootBeanDefinition(TestBean.class, pvs));
pvs = new MutablePropertyValues();
- pvs.addPropertyValue("someMap[myKey]", new TypedStringValue("2.12.1975", Date.class));
+ pvs.add("someMap[myKey]", new TypedStringValue("2.12.1975", Date.class));
bf.registerBeanDefinition("tb2", new RootBeanDefinition(TestBean.class, pvs));
TestBean tb1 = (TestBean) bf.getBean("tb1");
@@ -105,7 +105,7 @@ public final class CustomEditorConfigurerTests {
cec.postProcessBeanFactory(bf);
MutablePropertyValues pvs = new MutablePropertyValues();
- pvs.addPropertyValue("date", "2.12.1975");
+ pvs.add("date", "2.12.1975");
bf.registerBeanDefinition("tb", new RootBeanDefinition(TestBean.class, pvs));
TestBean tb = (TestBean) bf.getBean("tb");
@@ -123,7 +123,7 @@ public final class CustomEditorConfigurerTests {
cec.postProcessBeanFactory(bf);
MutablePropertyValues pvs = new MutablePropertyValues();
- pvs.addPropertyValue("date", "2.12.1975");
+ pvs.add("date", "2.12.1975");
bf.registerBeanDefinition("tb", new RootBeanDefinition(TestBean.class, pvs));
TestBean tb = (TestBean) bf.getBean("tb");
@@ -141,7 +141,7 @@ public final class CustomEditorConfigurerTests {
cec.postProcessBeanFactory(bf);
MutablePropertyValues pvs = new MutablePropertyValues();
- pvs.addPropertyValue("stringArray", "xxx");
+ pvs.add("stringArray", "xxx");
bf.registerBeanDefinition("tb", new RootBeanDefinition(TestBean.class, pvs));
TestBean tb = (TestBean) bf.getBean("tb");
diff --git a/org.springframework.beans/src/test/java/org/springframework/beans/factory/config/PropertyResourceConfigurerTests.java b/org.springframework.beans/src/test/java/org/springframework/beans/factory/config/PropertyResourceConfigurerTests.java
index f2289852037..a47c0c8c13e 100644
--- a/org.springframework.beans/src/test/java/org/springframework/beans/factory/config/PropertyResourceConfigurerTests.java
+++ b/org.springframework.beans/src/test/java/org/springframework/beans/factory/config/PropertyResourceConfigurerTests.java
@@ -351,11 +351,11 @@ public final class PropertyResourceConfigurerTests {
Map singletonMap = Collections.singletonMap("myKey", "myValue");
if (parentChildSeparation) {
MutablePropertyValues pvs1 = new MutablePropertyValues();
- pvs1.addPropertyValue("age", "${age}");
+ pvs1.add("age", "${age}");
MutablePropertyValues pvs2 = new MutablePropertyValues();
- pvs2.addPropertyValue("name", "name${var}${var}${");
- pvs2.addPropertyValue("spouse", new RuntimeBeanReference("${ref}"));
- pvs2.addPropertyValue("someMap", singletonMap);
+ pvs2.add("name", "name${var}${var}${");
+ pvs2.add("spouse", new RuntimeBeanReference("${ref}"));
+ pvs2.add("someMap", singletonMap);
RootBeanDefinition parent = new RootBeanDefinition(TestBean.class, pvs1);
ChildBeanDefinition bd = new ChildBeanDefinition("${parent}", pvs2);
factory.registerBeanDefinition("parent1", parent);
@@ -363,10 +363,10 @@ public final class PropertyResourceConfigurerTests {
}
else {
MutablePropertyValues pvs = new MutablePropertyValues();
- pvs.addPropertyValue("age", "${age}");
- pvs.addPropertyValue("name", "name${var}${var}${");
- pvs.addPropertyValue("spouse", new RuntimeBeanReference("${ref}"));
- pvs.addPropertyValue("someMap", singletonMap);
+ pvs.add("age", "${age}");
+ pvs.add("name", "name${var}${var}${");
+ pvs.add("spouse", new RuntimeBeanReference("${ref}"));
+ pvs.add("someMap", singletonMap);
RootBeanDefinition bd = new RootBeanDefinition(TestBean.class, pvs);
factory.registerBeanDefinition("tb1", bd);
}
@@ -379,13 +379,13 @@ public final class PropertyResourceConfigurerTests {
List