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:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user