On Thu, May 10, 2012 at 10:09 AM, Alen Vrečko <[email protected]> wrote:
> It is design decision of Guice not to support this kind of behavior.
> See http://code.google.com/p/google-guice/issues/detail?id=49.
>
> There is no reason not to bind all properties at start up. You can
> then fail early if you mistyped the property. Why fail late if you can
> fail early.
>
> You don't have to worry about binding as Strings. Strings gets
> converted to integer and similar automatically. You can install a
> custom type converter using #convertToTypes.

I'm loading properties from a HOCON configuration file [1]. Not all
properties in the file are meant to be injected, and some can't even
be read as a String (i.e. an exception is thrown). So being able to
read only properties that are needed would have seemed like a neat
solution, but alas...


[1] https://github.com/typesafehub/config/blob/master/HOCON.md

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en.

Reply via email to