Get children in YML config

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

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

    JazzaG

    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
     
  2. Offline

    Digi

    I belive that method has a 2nd argument that you can set to true to get sub-values of each sub-value =)
     
  3. Offline

    JazzaG

    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

    ConfigurationSection.getkeys()?
     
  5. Offline

    JazzaG

  6. Offline

    ZekeMo

    @JazzaG
    What you're talking about is called recursion. If you've found your answer you should mark this post as solved.
     
Thread Status:
Not open for further replies.

Share This Page