I’ve defined a new top rule for this in the Java grammar and released 1.1.0. You should now be able to do javaLanguage.configure({top: "ClassContent"}) to get a language that parses class content.
Ingenious! Thank you very much. Is your solution usable in general? Is is possible to write javaLanguage.configure({top: “MethodContent”}) for instance?