antlr / stringtemplate4

StringTemplate 4
http://www.stringtemplate.org
Other
956 stars 231 forks source link

Type safety of AttributeRenderer and ModelAdaptor #78

Closed JeffFaer closed 8 years ago

JeffFaer commented 10 years ago

Improved the type safety of AttributeRenderer and ModelAdaptor by converting them to generic interfaces.

Another goal behind this is to help dependency injection for AttributeRenderers and ModelAdaptors. If using a framework such as Guice, you can bind each AttributeRenderer<SomeType> to an implementation. If the interface is not generic you have to create a separate binding annotation for each AttributeRenderer, which requires a lot of boilerplate.

parrt commented 8 years ago

Hi. some nice stuff here but I'd like to avoid adding generics. Happy to add your other changes if you want to make a new PR. thanks!