本文整理汇总了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();
}
示例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);
}
示例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();
}
}
}
示例4: getPersister
import org.springframework.util.PropertiesPersister; //导入依赖的package包/类
/**
* @return the persister
*/
public PropertiesPersister getPersister()
{
return persister;
}
示例5: setPersister
import org.springframework.util.PropertiesPersister; //导入依赖的package包/类
/**
* @param persister the persister to set
*/
public void setPersister(PropertiesPersister persister)
{
this.persister = persister;
}
示例6: getPropertiesPersister
import org.springframework.util.PropertiesPersister; //导入依赖的package包/类
/**
* Return the PropertiesPersister to use for parsing properties files.
*/
public PropertiesPersister getPropertiesPersister() {
return this.propertiesPersister;
}
示例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;
}
示例8: setPropertiesPersister
import org.springframework.util.PropertiesPersister; //导入依赖的package包/类
public void setPropertiesPersister(PropertiesPersister propertiesPersister) {
this.propertiesPersister =
(propertiesPersister != null ? propertiesPersister : new DefaultPropertiesPersister());
}
示例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());
}
示例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());
}
示例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());
}
示例13: RecursivePropertiesPersister
import org.springframework.util.PropertiesPersister; //导入依赖的package包/类
/**
* Initiates an object of type RecursivePropertiesPersister.
*
* @param propertiesPersister
*/
public RecursivePropertiesPersister(PropertiesPersister propertiesPersister) {
super();
this.propertiesPersister = propertiesPersister;
}