I am attempting to use snakeYAML to load a YAML file into an object in an Android Java Class. How do I access the members of the resulting object?
Yaml yaml = new Yaml();
Object data = yaml.load(questionsStream);
Log.v(TAG2,data.toString());
The output is:
03-07 18:15:55.637: VERBOSE/Q_Engine Load Questions(615): [{Answer=Sun Jun 25 01:00:00 GMT+01:00 1950, ID=8, Meta Info={Main Topics=[Korean War]}, Obscurity=1, Question=When did the Korean War begin?}, etc...
I want to iterate through the list of Maps and access their members by their keywords.
Replace the second line with:
The
Objects from inside theMapcan be cast toMapsorListsand iterated through the same way, depending on the yaml file structure.