3 Replies Latest reply on Jul 1, 2011 8:46 PM by yangju.richard.yang.pearson.com

    How to inject based on class name?

    yangju.richard.yang.pearson.com
      I have this kind of java reflection in my code:
      Class<?> myClass= Class.forName("MyClassName");
      MyType myObject = (MyType)myClass.newInstance();

      If I want to use weld to inject an "myObject", is there way to do it?

      i.e., how to inject an object based on this object's class name?

      Thanks.