Add JavaResourceGenerator, and refactor ResourceFactory to select the most specialized resource type when performing generation