I have the next interface...

interface Filler<From, To>{

    void fill(From from, To to);

}

...and a default implementation depending on type parameters...

class DefaultFiller<From, To> extends Filler<From, To>{

  private final Class<From> fromClass;
  private final Class<To> toClass;

  public DefaultFiller(Class<From> fromClass, Class<To> toClass){
    this.fromClass = fromClass;
    this.toClass = toClass;
  }

  .....

}

... and several Filler client classes...

class PersonService{

   @Inject
   Filler<Person, PersonDto> filler;

}

class DepartmentService{

  @Inject
  Filler<Department, DepartmentDto> filler;

}


... I want to generate instances of DefaultFiller, depending on the
type parameters of the injection point, ie. new DefaultFiller
(Person.class, PersonDto.class), new DefaultFiller(Department.class,
DepartmentDto.class), etc.. What is the right way to perform this with
Guice?

Thanks in advance.

- Andrés


--~--~---------~--~----~------------~-------~--~----~
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