I'd like to enforce a restriction like Guice
4's requireAtInjectOnConstructors() but slightly weaker: any class with
less-than-public effective visibility may have a non-annotated,
no-arguments constructor. This is because I have a lot of package-private
implementation classes, and it's a pity to have to change
class ThingImpl implements Thing {
...
}
into
class ThingImpl implements Thing {
@Inject
ThingImpl() {
}
...
}
for all of them, with no real benefit. On the other hand, it is helpful to
be notified of public classes which accidentally have a public,
non-annotated constructor.
It seems this is almost possible with TypeListener, except it will also
trigger on requestInjection()/injectMembers(). Any ideas on how I could do
this?
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice.
For more options, visit https://groups.google.com/groups/opt_out.