當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。