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


Java PropertiesPersister类代码示例

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


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

示例1: SubsystemWithClassLoaderState

import org.springframework.util.PropertiesPersister; //导入依赖的package包/类
public SubsystemWithClassLoaderState(final ApplicationContext parentContext, final Properties globalProperties,
        final PropertiesPersister propertiesPersister, final String category, final String type, final String id,
        final String instancePath)
{
    ParameterCheck.mandatory("parentContext", parentContext);
    ParameterCheck.mandatory("globalProperties", globalProperties);
    ParameterCheck.mandatory("propertiesPersister", propertiesPersister);

    ParameterCheck.mandatoryString("category", category);
    ParameterCheck.mandatoryString("type", type);
    ParameterCheck.mandatoryString("id", id);
    ParameterCheck.mandatoryString("instancePath", instancePath);

    this.parentContext = parentContext;
    this.globalProperties = globalProperties;
    this.propertiesPersister = propertiesPersister;

    this.category = category;
    this.type = type;
    this.id = id;
    this.instancePath = instancePath;

    this.loadFixedConfigProperties();
}
 
开发者ID:Acosix,项目名称:alfresco-utility,代码行数:25,代码来源:SubsystemWithClassLoaderState.java

示例2: PropertyConfigurer

import org.springframework.util.PropertiesPersister; //导入依赖的package包/类
protected PropertyConfigurer(StringEncryptor encryptor) {
	this.propertyPlaceholderConfigurer = encryptor != null ? new EncryptablePropertyPlaceholderConfigurer(encryptor) : new PropertyPlaceholderConfigurer();

	// Ensure that system properties override the spring-set properties.
	propertyPlaceholderConfigurer.setSystemPropertiesMode(PropertyPlaceholderConfigurer.SYSTEM_PROPERTIES_MODE_OVERRIDE);

	PropertiesPersister savingPropertiesPersister = new DefaultPropertiesPersister() {

           @Override
           public void load(Properties props, InputStream is) throws IOException {
               props.put(HOSTNAME_KEY, HOSTNAME);
               CougarNodeId.initialiseNodeId(props);
               super.load(props, is);
               for (String propName: props.stringPropertyNames()) {
                   allLoadedProperties.put(propName, System.getProperty(propName, props.getProperty(propName)));
               }
           }};
       propertyPlaceholderConfigurer.setPropertiesPersister(savingPropertiesPersister);
}
 
开发者ID:betfair,项目名称:cougar,代码行数:20,代码来源:PropertyConfigurer.java

示例3: fillProperties

import org.springframework.util.PropertiesPersister; //导入依赖的package包/类
/**
 * Actually load properties from the given EncodedResource into the given Properties instance.
 * @param props the Properties instance to load into
 * @param resource the resource to load from
 * @param persister the PropertiesPersister to use
 * @throws IOException in case of I/O errors
 */
static void fillProperties(Properties props, EncodedResource resource, PropertiesPersister persister)
		throws IOException {

	InputStream stream = null;
	Reader reader = null;
	try {
		String filename = resource.getResource().getFilename();
		if (filename != null && filename.endsWith(XML_FILE_EXTENSION)) {
			stream = resource.getInputStream();
			persister.loadFromXml(props, stream);
		}
		else if (resource.requiresReader()) {
			reader = resource.getReader();
			persister.load(props, reader);
		}
		else {
			stream = resource.getInputStream();
			persister.load(props, stream);
		}
	}
	finally {
		if (stream != null) {
			stream.close();
		}
		if (reader != null) {
			reader.close();
		}
	}
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:37,代码来源:PropertiesLoaderUtils.java

示例4: getPersister

import org.springframework.util.PropertiesPersister; //导入依赖的package包/类
/**
 * @return the persister
 */
public PropertiesPersister getPersister() 
{
	return persister;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:8,代码来源:ChildApplicationContextFactory.java

示例5: setPersister

import org.springframework.util.PropertiesPersister; //导入依赖的package包/类
/**
 * @param persister the persister to set
 */
public void setPersister(PropertiesPersister persister) 
{
	this.persister = persister;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:8,代码来源:ChildApplicationContextFactory.java

示例6: getPropertiesPersister

import org.springframework.util.PropertiesPersister; //导入依赖的package包/类
/**
 * Return the PropertiesPersister to use for parsing properties files.
 */
public PropertiesPersister getPropertiesPersister() {
	return this.propertiesPersister;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:7,代码来源:PropertiesBeanDefinitionReader.java

示例7: setPersister

import org.springframework.util.PropertiesPersister; //导入依赖的package包/类
/**
 * @param persister
 *            the persister to set
 */
public void setPersister(final PropertiesPersister persister)
{
    ParameterCheck.mandatory("persister", persister);
    this.persister = persister;
}
 
开发者ID:Acosix,项目名称:alfresco-utility,代码行数:10,代码来源:SubsystemWithClassLoaderFactory.java

示例8: setPropertiesPersister

import org.springframework.util.PropertiesPersister; //导入依赖的package包/类
public void setPropertiesPersister(PropertiesPersister propertiesPersister) {
    this.propertiesPersister =
            (propertiesPersister != null ? propertiesPersister : new DefaultPropertiesPersister());
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:5,代码来源:SakaiProperties.java

示例9: setPropertiesPersister

import org.springframework.util.PropertiesPersister; //导入依赖的package包/类
/**
 * Set the PropertiesPersister to use for parsing properties files.
 * <p>The default is a DefaultPropertiesPersister.
 * @see org.springframework.util.DefaultPropertiesPersister
 */
public void setPropertiesPersister(PropertiesPersister propertiesPersister) {
	this.propertiesPersister =
			(propertiesPersister != null ? propertiesPersister : new DefaultPropertiesPersister());
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:ReloadableResourceBundleMessageSource.java

示例10: setPropertiesPersister

import org.springframework.util.PropertiesPersister; //导入依赖的package包/类
/**
 * Set the PropertiesPersister to use for parsing properties files.
 * The default is DefaultPropertiesPersister.
 * @see org.springframework.util.DefaultPropertiesPersister
 */
public void setPropertiesPersister(PropertiesPersister propertiesPersister) {
	this.propertiesPersister =
			(propertiesPersister != null ? propertiesPersister : new DefaultPropertiesPersister());
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:PropertiesBeanDefinitionReader.java

示例11: setPropertiesPersister

import org.springframework.util.PropertiesPersister; //导入依赖的package包/类
/**
 * Set the PropertiesPersister to use for parsing properties files.
 * <p>
 * The default is a DefaultPropertiesPersister.
 * 
 * @see org.springframework.util.DefaultPropertiesPersister
 */
public void setPropertiesPersister(PropertiesPersister propertiesPersister) {
    this.propertiesPersister = (propertiesPersister != null ? propertiesPersister : new DefaultPropertiesPersister());
}
 
开发者ID:bullhorn,项目名称:starter-kit-spring-maven,代码行数:11,代码来源:CustomReloadableResourceBundleMessageSource.java

示例12: setPropertiesPersister

import org.springframework.util.PropertiesPersister; //导入依赖的package包/类
/**
 * Set the PropertiesPersister to use for parsing properties files.
 * <p>The default is a DefaultPropertiesPersister.
 * @see org.springframework.util.DefaultPropertiesPersister
 */
public void setPropertiesPersister(PropertiesPersister propertiesPersister) {
    this.propertiesPersister =
            (propertiesPersister != null ? propertiesPersister : new DefaultPropertiesPersister());
}
 
开发者ID:mochalov,项目名称:grails-icu,代码行数:10,代码来源:ICUReloadableResourceBundleMessageSource.java

示例13: RecursivePropertiesPersister

import org.springframework.util.PropertiesPersister; //导入依赖的package包/类
/**
 * Initiates an object of type RecursivePropertiesPersister.
 * 
 * @param propertiesPersister
 */
public RecursivePropertiesPersister(PropertiesPersister propertiesPersister) {
    super();
    this.propertiesPersister = propertiesPersister;
}
 
开发者ID:opensource21,项目名称:fuwesta,代码行数:10,代码来源:RecursivePropertiesPersister.java


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