I'm trying to do something like this:
public Object categories = new Object(
"Entertainment": new Object(
"Movie": null),
"Exercise": new Object(
"Upper Body": null,
"Lower Body": new Object(
"Squats": null
),
"Dance": null)
);
@Paŭlo Ebermann's answer at How to directly initialize a HashMap (in a literal way)? seemed close but it would be quite ugly and cumbersome to use that technique if the nesting went beyond 2 or 3 levels.
I need to be able to put this object in a for-each loop to dynamically create buttons for each node. I come from a javascript background where this sort of thing is trivial. Is there something similar in Java?