I am writing an API and I want the client to be able to pass in a fully 
qualified class as a param.

UseApi api = new UseApi("com.company.classes.thisClass");
api.process();


Can I use Guice to take a fully qualified class string and inject the class 
in the code that implements process() as an example. In my code I want to 
be able to say

public class UseApi {
   public final String clazz;

  public UseApi ( String clazz ) {
    this.clazz = clazz;
  }
  public void process()
  {
     // inject an instance of com.company.classes.thisClass
    Object theirClass = inject this.clazz
    theirClass.someMethod();
  {
}

This assumes I also have access to the compiled passed in class.

Thank you so much in advance

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-guice/-/pMnIR9BoTCIJ.
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