This may work better as an abstract class, given the JavaWriter constructor argument.