当前位置: 首页>>代码示例>>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;未经允许,请勿转载。