Plugin Help Detect child objects in YAML

Discussion in 'Plugin Help/Development/Requests' started by meowxiik, Oct 14, 2014.

Thread Status:
Not open for further replies.
  1. Offline


    Here is some quick one, I have YAML with this:

    Is here a way to detect ALL children of something?
    Something like conf.getChild(A)?
    (It could return string datatype of the children?)
  2. Offline


    meowxiik As far as I know the specified example is not in a correct YAML format, but still I may be able to help you. You first need to get the ConfigurationSection of the part you want all keys from, and then you can use the getKeys() method:
    1. ConfigurationSection section = config.getConfigurationSection("");
    2. section.getKeys(false); // returns only top-level keys
    3. section.getKeys(true); // returns all keys

    getKeys(false) would return +A and +B if called on the config itself, getKeys(true) would return a list of all of them.
  3. Offline


    Thanks a lot!!
Thread Status:
Not open for further replies.

Share This Page