Examples of ConfigurationNode


Examples of com.bergerkiller.bukkit.common.config.ConfigurationNode

    }
    statementShortcuts.clear().load(config.getNode("statementShortcuts"));
   
    //parser shortcuts
    config.setHeader("itemShortcuts", "\nSeveral shortcuts you can use on signs to set the items");
    ConfigurationNode itemshort = config.getNode("itemShortcuts");
    parsers.clear();

    // ================= Defaults ===============
    if (!itemshort.contains("fuel")) {
      itemshort.set("fuel", MaterialUtil.ISFUEL.toString());
    }
    if (!itemshort.contains("heatable")) {
      itemshort.set("heatable", MaterialUtil.ISHEATABLE.toString());
    }
    if (!itemshort.contains("armor")) {
      itemshort.set("armor", MaterialUtil.ISARMOR.toString());
    }
    if (!itemshort.contains("sword")) {
      itemshort.set("sword", MaterialUtil.ISSWORD.toString());
    }
    if (!itemshort.contains("boots")) {
      itemshort.set("boots", MaterialUtil.ISBOOTS.toString());
    }
    if (!itemshort.contains("leggings")) {
      itemshort.set("leggins", MaterialUtil.ISLEGGINGS.toString());
    }
    if (!itemshort.contains("chestplate")) {
      itemshort.set("chestplate", MaterialUtil.ISCHESTPLATE.toString());
    }
    if (!itemshort.contains("helmet")) {
      itemshort.set("helmet", MaterialUtil.ISHELMET.toString());
    }
    // ===========================================

    for (Map.Entry<String, String> entry : itemshort.getValues(String.class).entrySet()) {
      putParsers(entry.getKey(), Util.getParsers(entry.getValue()));
      itemshort.setRead(entry.getKey());
    }

    config.trim();
    config.save();
  }
View Full Code Here

Examples of com.bergerkiller.bukkit.common.config.ConfigurationNode

    }
    if (this.trainCollision != CollisionMode.LINK) {
      node.set("collision.train", this.trainCollision);
    }
    if (!this.isEmpty()) {
      ConfigurationNode carts = node.getNode("carts");
      for (CartProperties prop : this) {
        ConfigurationNode cart = carts.getNode(prop.getUUID().toString());
        prop.save(cart);
        if (cart.getKeys().isEmpty()) carts.remove(cart.getName());
      }
    }
  }
View Full Code Here

Examples of com.bergerkiller.bukkit.common.config.ConfigurationNode

  public static void loadDefaults() {
    defconfig = new FileConfiguration(TrainCarts.plugin, defaultPropertiesFile);
    defconfig.load();
    boolean changed = false;
    if (!defconfig.contains("default")) {
      ConfigurationNode node = defconfig.getNode("default");
      TrainProperties.EMPTY.saveAsDefault(node);
      changed = true;
    }
    if (!defconfig.contains("admin")) {
      ConfigurationNode node = defconfig.getNode("admin");
      for (Entry<String, Object> entry : defconfig.getNode("default").getValues().entrySet()) {
        node.set(entry.getKey(), entry.getValue());
      }
      changed = true;
    }
    if (!defconfig.contains("spawner")) {
      ConfigurationNode node = defconfig.getNode("spawner");
      for (Entry<String, Object> entry : defconfig.getNode("default").getValues().entrySet()) {
        node.set(entry.getKey(), entry.getValue());
      }
      changed = true;
    }
    if (fixDeprecation(defconfig)) {
      changed = true;
View Full Code Here

Examples of com.ensifera.animosity.craftirc.libs.com.sk89q.util.config.ConfigurationNode

        }
    }

    public String cColorGameFromIrc(String irc) {
        irc = this.cColorIrcNormalize(irc);
        ConfigurationNode color;
        final Iterator<ConfigurationNode> it = this.colormap.iterator();
        while (it.hasNext()) {
            color = it.next();
            //Enforce two digit comparisons.
            if (color.getString("irc", "").equals(irc) || "0".concat(color.getString("irc", "")).equals(irc)) {
                return color.getString("game", this.cColorGameFromName("foreground"));
            }
        }
        return this.cColorGameFromName("foreground");
    }
View Full Code Here

Examples of com.sk89q.util.config.ConfigurationNode

    }

    private ConfigurationNode getChanNode(int bot, String channel) {
        ArrayList<ConfigurationNode> botChans = channodes.get(bot);
        for (Iterator<ConfigurationNode> it = botChans.iterator(); it.hasNext();) {
            ConfigurationNode chan = it.next();
            if (chan.getString("name").equalsIgnoreCase(channel))
                return chan;
        }
        return Configuration.getEmptyNode();
    }
View Full Code Here

Examples of org.apache.cayenne.configuration.ConfigurationNode

            /**
             * Converts TreePath to Object
             */
            private ConfigurationNode createProjectPath(TreePath treePath) {
                Object[] path = treePath.getPath();
                ConfigurationNode projectPath = (ConfigurationNode) ((DefaultMutableTreeNode) path[path.length - 1])
                        .getUserObject();

                return projectPath;
            }
        };
View Full Code Here

Examples of org.apache.commons.configuration.tree.ConfigurationNode

    /**
     * Tests nodeKey() for an attribute node.
     */
    public void testNodeKeyAttribute()
    {
        ConfigurationNode node = new DefaultConfigurationNode("attr");
        node.setAttribute(true);
        assertEquals("Wrong attribute key", "node/@attr", engine.nodeKey(node,
                "node"));
    }
View Full Code Here

Examples of org.apache.commons.configuration.tree.ConfigurationNode

    /**
     * Tests node key() for direct children of the root node.
     */
    public void testNodeKeyForRootChild()
    {
        ConfigurationNode node = new DefaultConfigurationNode("child");
        assertEquals("Wrong key for root child node", "child", engine.nodeKey(
                node, ""));
        node.setAttribute(true);
        assertEquals("Wrong key for root attribute", "@child", engine.nodeKey(
                node, ""));
    }
View Full Code Here

Examples of org.apache.commons.configuration.tree.ConfigurationNode

     * @param conf the parent config
     * @return the root node for the subnode config
     */
    protected ConfigurationNode getSubnodeRoot(HierarchicalConfiguration conf)
    {
        ConfigurationNode root = conf.getRoot();
        return root.getChild(0).getChild(0);
    }
View Full Code Here

Examples of org.apache.commons.configuration.tree.ConfigurationNode

    public void testInitCopy() throws ConfigurationException
    {
        XMLConfiguration copy = new XMLConfiguration(conf);
        assertEquals("value", copy.getProperty("element"));
        assertNull("Document was copied, too", copy.getDocument());
        ConfigurationNode root = copy.getRootNode();
        for (ConfigurationNode node : root.getChildren())
        {
            assertNull("Reference was not cleared", node.getReference());
        }

        removeTestFile();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.