Hi all,
just noticed you updated the doc, thanks!!! I got in the same trouble and
thanks to Alen I was able to fix my errors :P
Willi, I don't know if you're interested, but I open-sourced my
converters[1] and configuration utilities for Guice, I hope it can be useful
for you
Best regards,
Simo

[1] http://rocoto.googlecode.com/svn/site/2.0/converters.html

http://people.apache.org/~simonetripodi/


On Wed, Jan 20, 2010 at 11:45 PM, Alen Vrečko <[email protected]> wrote:

> In com.google.inject.spi.TypeConverterBinding javadoc
>
> Cheers
> Alen
>
> On 20 jan., 23:28, Sam Berlin <[email protected]> wrote:
> > This was brought up before -- I think a javadoc or wiki needed editing
> > (because it showed an example of using it with a class, not a
> > TypeLiteral), but forget where the incorrect example was.
> >
> > Sam
> >
> > On Wed, Jan 20, 2010 at 4:53 PM, Dhanji R. Prasanna <[email protected]>
> wrote:
> >
> >
> >
> > > You're matching a class but the method wants a type literal. More
> > > importantly Guice only supports type conversion for constants.
> >
> > > Dhanji.
> > > 2010/1/21 Willi Schönborn <[email protected]>
> >
> > >> Hi there,
> >
> > >> i tried to register a TypeConverter for Files (java.io.File):
> >
> > >> binder().convertToTypes(Matchers.subclassesOf(File.class), new
> > >> TypeConverter() {
> > >>                     @Override
> > >>           public File convert(String fileName, TypeLiteral<?> literal)
> {
> > >>               return new File(fileName);
> > >>           }
> > >>          });
> >
> > >> And received the following compiler error?
> >
> > >> The method convertToTypes(Matcher<? super TypeLiteral<?>>,
> TypeConverter)
> > >> in the type Binder is not applicable for the arguments
> (Matcher<Class>, new
> > >> TypeConverter(){})
> >
> > >> Any suggestions how to convince javac to eat it?
> >
> > >> --
> > >> 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]<google-guice%[email protected]>
> .
> > >> For more options, visit this group at
> > >>http://groups.google.com/group/google-guice?hl=en.
> >
> > > --
> > > 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]<google-guice%[email protected]>
> .
> > > For more options, visit this group at
> > >http://groups.google.com/group/google-guice?hl=en.
>
> --
> 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]<google-guice%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-guice?hl=en.
>
>
>
>
--
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