Refactor Environment and PropertySource

* Environment now extends PropertyResolver
* Environment no longer exposes resolver and sources
* PropertySource is String,Object instead of String,String
* PropertySource no longer assumes enumerability of property names
* Introduced EnumerablePropertySource for those that do have enumerable property names
This commit is contained in:
Chris Beams
2011-01-05 22:24:14 +00:00
parent 7c4582b4b3
commit 2b99cf6d29
39 changed files with 392 additions and 316 deletions

View File

@@ -20,6 +20,7 @@ import java.util.Enumeration;
import javax.servlet.ServletConfig;
import org.springframework.core.env.EnumerablePropertySource;
import org.springframework.core.env.PropertySource;
import org.springframework.util.CollectionUtils;
@@ -30,7 +31,7 @@ import org.springframework.util.CollectionUtils;
* @since 3.1
* @see ServletContextPropertySource
*/
public class ServletConfigPropertySource extends PropertySource<ServletConfig> {
public class ServletConfigPropertySource extends EnumerablePropertySource<ServletConfig> {
public ServletConfigPropertySource(String name, ServletConfig servletConfig) {
super(name, servletConfig);

View File

@@ -20,6 +20,7 @@ import java.util.Enumeration;
import javax.servlet.ServletContext;
import org.springframework.core.env.EnumerablePropertySource;
import org.springframework.core.env.PropertySource;
import org.springframework.util.CollectionUtils;
@@ -30,7 +31,7 @@ import org.springframework.util.CollectionUtils;
* @since 3.1
* @see ServletConfigPropertySource
*/
public class ServletContextPropertySource extends PropertySource<ServletContext> {
public class ServletContextPropertySource extends EnumerablePropertySource<ServletContext> {
public ServletContextPropertySource(String name, ServletContext servletContext) {
super(name, servletContext);

View File

@@ -27,7 +27,6 @@ import javax.servlet.ServletException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeansException;
import org.springframework.beans.MutablePropertyValues;