Search in sources :

Example 1 with PermissionNodesGatherer

use of tools.docs.permissions.PermissionNodesGatherer in project AuthMeReloaded by AuthMe.

the class GeneratePluginYml method generatePermissions.

private Map<String, Object> generatePermissions() {
    PermissionNodesGatherer gatherer = new PermissionNodesGatherer();
    Map<String, String> permissionDescriptions = gatherer.gatherNodesWithJavaDoc();
    permissionNodes = gatherer.getPermissionClasses().stream().map(clz -> clz.getEnumConstants()).flatMap((PermissionNode[] nodes) -> Arrays.stream(nodes)).collect(Collectors.toList());
    Map<String, Object> descriptions = new TreeMap<>();
    for (PermissionNode node : permissionNodes) {
        descriptions.put(node.getNode(), buildPermissionEntry(node, permissionDescriptions.get(node.getNode())));
    }
    addWildcardPermissions(descriptions);
    return descriptions;
}
Also used : PermissionNode(fr.xephi.authme.permission.PermissionNode) PermissionNodesGatherer(tools.docs.permissions.PermissionNodesGatherer) Arrays(java.util.Arrays) ImmutableMap(com.google.common.collect.ImmutableMap) DefaultPermission(fr.xephi.authme.permission.DefaultPermission) CommandUtils(fr.xephi.authme.command.CommandUtils) Collection(java.util.Collection) ToolsConstants(tools.utils.ToolsConstants) FileIoUtils(tools.utils.FileIoUtils) Collectors(java.util.stream.Collectors) CommandInitializer(fr.xephi.authme.command.CommandInitializer) CommandDescription(fr.xephi.authme.command.CommandDescription) LinkedHashMap(java.util.LinkedHashMap) FileConfiguration(org.bukkit.configuration.file.FileConfiguration) List(java.util.List) AutoToolTask(tools.utils.AutoToolTask) StringReader(java.io.StringReader) TreeMap(java.util.TreeMap) Paths(java.nio.file.Paths) YamlConfiguration(org.bukkit.configuration.file.YamlConfiguration) Map(java.util.Map) PermissionNodesGatherer(tools.docs.permissions.PermissionNodesGatherer) TreeMap(java.util.TreeMap) PermissionNode(fr.xephi.authme.permission.PermissionNode)

Aggregations

ImmutableMap (com.google.common.collect.ImmutableMap)1 CommandDescription (fr.xephi.authme.command.CommandDescription)1 CommandInitializer (fr.xephi.authme.command.CommandInitializer)1 CommandUtils (fr.xephi.authme.command.CommandUtils)1 DefaultPermission (fr.xephi.authme.permission.DefaultPermission)1 PermissionNode (fr.xephi.authme.permission.PermissionNode)1 StringReader (java.io.StringReader)1 Paths (java.nio.file.Paths)1 Arrays (java.util.Arrays)1 Collection (java.util.Collection)1 LinkedHashMap (java.util.LinkedHashMap)1 List (java.util.List)1 Map (java.util.Map)1 TreeMap (java.util.TreeMap)1 Collectors (java.util.stream.Collectors)1 FileConfiguration (org.bukkit.configuration.file.FileConfiguration)1 YamlConfiguration (org.bukkit.configuration.file.YamlConfiguration)1 PermissionNodesGatherer (tools.docs.permissions.PermissionNodesGatherer)1 AutoToolTask (tools.utils.AutoToolTask)1 FileIoUtils (tools.utils.FileIoUtils)1