How to iterate over object nodes formed from YAML

742 views Asked by At

I have parsed a YAML file using snakeYAML in Java. The following is the code:

Yaml yaml = new Yaml();
String fileContent = readFile(folderPath+fileName, StandardCharsets.UTF_8);
Object obj = yaml.load(fileContent);
System.out.println(obj);

The object is printed as:

{meta={data_version=0.5, created=Tue Sep 08 05:30:00 IST 2009, revision=1}, info={city=London, dates=[Fri Sep 04 05:30:00 IST 2009], match_type=ODI, outcome={by={runs=4}, winner=Australia}, overs=50, player_of_match=[CJ Ferguson], teams=[England, Australia], toss={decision=field, winner=England}, umpires=[AL Hill, NJ Llong], venue=Kennington Oval}, innings=[{1st innings={team=Australia, deliveries=[{0.1={batsman=SR Watson, bowler=JM Anderson, extras={wides=1}, ...

How can I iterate over the nodes to get different values?

0

There are 0 answers