當前位置: 首頁>>代碼示例>>Java>>正文


Java ConfigurationSection.getValues方法代碼示例

本文整理匯總了Java中org.bukkit.configuration.ConfigurationSection.getValues方法的典型用法代碼示例。如果您正苦於以下問題:Java ConfigurationSection.getValues方法的具體用法?Java ConfigurationSection.getValues怎麽用?Java ConfigurationSection.getValues使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.bukkit.configuration.ConfigurationSection的用法示例。


在下文中一共展示了ConfigurationSection.getValues方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: load

import org.bukkit.configuration.ConfigurationSection; //導入方法依賴的package包/類
public void load(File dataFolder, ConfigurationSection config) {
    Path localRepositoryDirectory = Paths.get(config.getString("local_repository_directory"));
    if (!localRepositoryDirectory.isAbsolute())
        localRepositoryDirectory = dataFolder.toPath().resolve(localRepositoryDirectory);
    setLocalRepositoryDirectory(localRepositoryDirectory.toFile());

    ConfigurationSection repositories = config.getConfigurationSection("repositories");
    if (repositories != null) {
        Map<String, Object> entries = repositories.getValues(false);
        List<RemoteRepository> resultRepositories = new ArrayList<>(entries.size());
        for (Map.Entry<String, Object> entry : entries.entrySet())
            resultRepositories.add(readRemoteRepository(entry.getKey(), (ConfigurationSection) entry.getValue()));
        setRepositories(resultRepositories);
    } else {
        setRepositories(Collections.emptyList());
    }
}
 
開發者ID:MCCityVille,項目名稱:libmanager,代碼行數:18,代碼來源:Config.java

示例2: fetchPlayerById

import org.bukkit.configuration.ConfigurationSection; //導入方法依賴的package包/類
@Override
public HashMap<String, Object> fetchPlayerById(UUID id) {
	ConfigurationSection section = config.getConfigurationSection("players." + id);
	if (section == null)
		return null;
	return (HashMap<String, Object>) section.getValues(true);
}
 
開發者ID:KevSlashNull,項目名稱:KevsPermissions,代碼行數:8,代碼來源:ConfigDataManger.java

示例3: fetchGroupByName

import org.bukkit.configuration.ConfigurationSection; //導入方法依賴的package包/類
@Override
public HashMap<String, Object> fetchGroupByName(String name) {
	ConfigurationSection section = config.getConfigurationSection("groups." + name);
	if (section == null)
		return null;
	return (HashMap<String, Object>) section.getValues(true);
}
 
開發者ID:KevSlashNull,項目名稱:KevsPermissions,代碼行數:8,代碼來源:ConfigDataManger.java

示例4: getGroupList

import org.bukkit.configuration.ConfigurationSection; //導入方法依賴的package包/類
@Override
public HashMap<String, Object> getGroupList() {
	ConfigurationSection section = config.getConfigurationSection("groups");
	if (section == null)
		return null;
	return (HashMap<String, Object>) section.getValues(false);
}
 
開發者ID:KevSlashNull,項目名稱:KevsPermissions,代碼行數:8,代碼來源:ConfigDataManger.java

示例5: removeUnusedValues

import org.bukkit.configuration.ConfigurationSection; //導入方法依賴的package包/類
private void removeUnusedValues(ConfigurationSection cs) {
	Map<String, Object> objs = cs.getValues(false);
	for (String key : objs.keySet()) {
		if (cs.isConfigurationSection(key)) {
			removeUnusedValues(cs.getConfigurationSection(key));
			if (cs.getConfigurationSection(key) == null || cs.getConfigurationSection(key).getValues(false).isEmpty()) {
				cs.set(key, null);
			}
		} else if (!defaultValues.containsKey(cs.getCurrentPath() + (cs.getCurrentPath().isEmpty() ? "" : ".") + key)) {
			cs.set(key, null);
		}
	}
}
 
開發者ID:RoboTricker,項目名稱:Transport-Pipes,代碼行數:14,代碼來源:Conf.java


注:本文中的org.bukkit.configuration.ConfigurationSection.getValues方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。