Get children in YML config

Discussion in 'Plugin Development' started by JazzaG, Jun 10, 2012.

  1. Online

    JazzaG

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    If it looks like this:

    Code:
    root:
        parent:
            child:
                thing1:
                thing2:
    
    .. how can I get down to thing1. The only thing I know is that the top-level is called root.

    I have this:
    Code:java
    1.  
    2. config.getConfigurationSection("root");
    3.  


    but how could I get the children of that to be in a String[], so String[0] would be parent, then I could repeat the process to get down to thing1 and 2?

    Hope I'm making some sense :p
    Thanks

    This post has been edited 1 time. It was last edited by JazzaG Jun 10, 2012.
  2. Offline

    Digi

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    I belive that method has a 2nd argument that you can set to true to get sub-values of each sub-value =)
  3. Online

    JazzaG

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    The only argument I can give getConfigurationSection is the path...? Do you know the exact method I can use for this? Thanks for reply :)
  4. Offline

    ferrybig

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    ConfigurationSection.getkeys()?
  5. Online

    JazzaG

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)

Share This Page