Read any depth

29 views
Skip to first unread message

Gabriele Vailati

unread,
Feb 7, 2017, 2:27:20 PM2/7/17
to yamlbeans-users
Hello everyone,

I am new to yamlbeans and I am wondering a thing.

Assume You have a yaml document as follow:

A:
    B:
        BA: value
        BB: value
        BC: value
    C:
        CA: value
        CB: value
    D:
        DA: value
        DB: value
        DC:
            DCA: value
            DCB: value

Is there a way to rapidly read values at any depth like:

String dca_value = map.get("A").get("D").get("DC").get("DCB");

Instead of doing this:

Map map_A = (Map) reader.read();
Map map_D = (Map) map_a.get("D");
Map map_DC = (Map) map_d.get("DC");
String dca_value = (String) map_dc.get("DCA");

Your support is appreciated. Thank You.

Regards.
Reply all
Reply to author
Forward
0 new messages