当前位置: 首页>>代码示例>>Java>>正文


Java PropertyUtils类代码示例

本文整理汇总了Java中org.kuali.common.util.PropertyUtils的典型用法代码示例。如果您正苦于以下问题:Java PropertyUtils类的具体用法?Java PropertyUtils怎么用?Java PropertyUtils使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PropertyUtils类属于org.kuali.common.util包,在下文中一共展示了PropertyUtils类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getRootConfig

import org.kuali.common.util.PropertyUtils; //导入依赖的package包/类
/**
    * Gets the {@link Config} from both the current configuration and the ones in {@code loaded}, at {@code location},
    * and in the {@code servletContext}.
    *
    * @param loaded the loaded properties
    * @param location the location of additional properties
    * @param servletContext the servlet context in which to add more properties
    *
    * @return the final configuration
    */
public static Config getRootConfig(Properties loaded, String location, ServletContext servletContext) {
	// Get the Rice config object the listener created
	Config config = ConfigContext.getCurrentContextConfig();
	Preconditions.checkNotNull(config, "'config' cannot be null");
	Properties listenerProperties = getProperties(config);

	// Parse config from the location indicated, using listener properties in the process of doing so
	JAXBConfigImpl parsed = parseConfig(location, listenerProperties);

	// Add and override loaded properties with parsed properties
	addAndOverride(loaded, parsed.getRawProperties());

	// Priority is servlet -> env -> system
	// Override anything we've loaded with servlet, env, and system properties
	Properties servlet = PropertySources.convert(servletContext);
	Properties global = PropertyUtils.getGlobalProperties(servlet);
	addAndOverride(loaded, global);
	logger.info("Using {} distinct properties", Integer.valueOf(loaded.size()));

	// Use JAXBConfigImpl in order to perform Rice's custom placeholder resolution logic now that everything is loaded
	return new JAXBConfigImpl(loaded);

}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:34,代码来源:RiceConfigUtils.java


注:本文中的org.kuali.common.util.PropertyUtils类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。