You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
source-code-hunter/docs/Spring/clazz/PropertySource/Spring-ServletContextProper...

922 B

Spring ServletContextPropertySource

  • Author: HuiFer

  • 源码阅读仓库: SourceHot-spring

  • 类全路径: org.springframework.web.context.support.ServletContextPropertySource

  • 内部数据结构是 ServletContext 接口

  • 整体代码如下.


public class ServletContextPropertySource extends EnumerablePropertySource<ServletContext> {

	public ServletContextPropertySource(String name, ServletContext servletContext) {
		super(name, servletContext);
	}

	@Override
	public String[] getPropertyNames() {
		// javax.servlet.ServletContext.getInitParameterNames 方法调用
		return StringUtils.toStringArray(this.source.getInitParameterNames());
	}

	@Override
	@Nullable
	public String getProperty(String name) {
		// javax.servlet.ServletContext.getInitParameter
		return this.source.getInitParameter(name);
	}

}