Update of /cvsroot/springframework/spring/src/org/springframework/core/io/support
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22459/src/org/springframework/core/io/support
Modified Files:
PropertiesLoaderSupport.java
Log Message:
added "propertiesArray" bean property, for merging multiple local Properties instances
Index: PropertiesLoaderSupport.java
===================================================================
RCS file: /cvsroot/springframework/spring/src/org/springframework/core/io/support/PropertiesLoaderSupport.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** PropertiesLoaderSupport.java 2 Oct 2005 19:42:41 -0000 1.4
--- PropertiesLoaderSupport.java 19 Apr 2006 19:43:57 -0000 1.5
***************
*** 1,4 ****
/*
! * Copyright 2002-2005 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
--- 1,4 ----
/*
! * Copyright 2002-2006 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
***************
*** 46,50 ****
protected final Log logger = LogFactory.getLog(getClass());
! private Properties properties;
private Resource[] locations;
--- 46,50 ----
protected final Log logger = LogFactory.getLog(getClass());
! private Properties[] localProperties;
private Resource[] locations;
***************
*** 65,69 ****
*/
public void setProperties(Properties properties) {
! this.properties = properties;
}
--- 65,77 ----
*/
public void setProperties(Properties properties) {
! this.localProperties = new Properties[] {properties};
! }
!
! /**
! * Set local properties, e.g. via the "props" tag in XML bean definitions,
! * allowing for merging multiple properties sets into one.
! */
! public void setPropertiesArray(Properties[] propertiesArray) {
! this.localProperties = propertiesArray;
}
***************
*** 139,147 ****
}
! if (this.properties != null) {
! // Use propertyNames enumeration to also catch default properties.
! for (Enumeration en = this.properties.propertyNames(); en.hasMoreElements();) {
! String key = (String) en.nextElement();
! result.setProperty(key, this.properties.getProperty(key));
}
}
--- 147,158 ----
}
! if (this.localProperties != null) {
! for (int i = 0; i < this.localProperties.length; i++) {
! Properties props = this.localProperties[i];
! // Use propertyNames enumeration to also catch default properties.
! for (Enumeration en = props.propertyNames(); en.hasMoreElements();) {
! String key = (String) en.nextElement();
! result.setProperty(key, props.getProperty(key));
! }
}
}
|