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


Java PropertiesConfiguration.addProperty方法代码示例

本文整理汇总了Java中org.apache.commons.configuration.PropertiesConfiguration.addProperty方法的典型用法代码示例。如果您正苦于以下问题:Java PropertiesConfiguration.addProperty方法的具体用法?Java PropertiesConfiguration.addProperty怎么用?Java PropertiesConfiguration.addProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.commons.configuration.PropertiesConfiguration的用法示例。


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

示例1: saveRecord

import org.apache.commons.configuration.PropertiesConfiguration; //导入方法依赖的package包/类
public void saveRecord() throws Exception {
	if (file.exists()) {
		// file.renameTo(new File(Configs.recordFileName+".bak"));
		file.delete();
	}
	file.createNewFile();
	PropertiesConfiguration record = new PropertiesConfiguration(
			Configs.recordFileName);

	record.addProperty("verifiedUsers", Records.verifiedUsers.toArray());

	// record.addProperty("records", Records.records);

	Object[] usrEntries = Records.records.keySet().toArray();
	record.addProperty("usrEntries", usrEntries);
	for (Object usr : usrEntries) {
		record.addProperty((String) usr, Records.records.get(usr).toArray());
	}
	record.save();

}
 
开发者ID:D0048,项目名称:irc-helper,代码行数:22,代码来源:MyRecord.java

示例2: loadProperties

import org.apache.commons.configuration.PropertiesConfiguration; //导入方法依赖的package包/类
/**
 * Creates a properties config with all the properties set
 *
 * @return
 */
private PropertiesConfiguration loadProperties() {
    PropertiesConfiguration properties = new PropertiesConfiguration();

    properties.addProperty(AdapterConfig.ADAPTER_CLASS, "adapterClass");
    properties.addProperty(AdapterConfig.ADAPTER_DIR, "adapterDir");
    properties.addProperty(AdapterConfig.AUTH_ENDPOINT, "authEndpoint");
    properties.addProperty(AdapterConfig.COLLECT_THREADS, "1");
    properties.addProperty(AdapterConfig.PROVIDER_ID, "providerId");
    properties.addProperty(AdapterConfig.PROVIDER_NAME, "providerName");
    properties.addProperty(AdapterConfig.PROVIDER_TYPE, "providerType");
    properties.addProperty(AdapterConfig.SCHEDULING_INTERVAL, "2");

    properties.addProperty(AdapterConfig.FILE_PATH, "filePath");
    return properties;
}
 
开发者ID:HewlettPackard,项目名称:loom,代码行数:21,代码来源:AdapterConfigTest.java

示例3: createDefault

import org.apache.commons.configuration.PropertiesConfiguration; //导入方法依赖的package包/类
public void createDefault() throws Exception {
	if (file.exists()) {
		// file.renameTo(new File(Configs.recordFileName+".bak"));
		file.delete();
	}
	file.createNewFile();
	PropertiesConfiguration record = new PropertiesConfiguration(
			Configs.recordFileName);

	Records.mutedUsers.add("foo_-_");
	Records.records.put("foo_-_", new HashSet<String>() {
		{
			this.add("test");
		}
	});
	Records.verifiedUsers.add("d0048");

	record.addProperty("verifiedUsers", Records.verifiedUsers.toArray());

	// record.addProperty("records", Records.records);

	Object[] usrEntries = Records.records.keySet().toArray();
	record.addProperty("usrEntries", usrEntries);
	for (Object usr : usrEntries) {
		record.addProperty((String) usr, Records.records.get(usr).toArray());
	}
	record.save();
}
 
开发者ID:D0048,项目名称:irc-helper,代码行数:29,代码来源:MyRecord.java


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