• Post Reply Bookmark Topic Watch Topic
  • New Topic

Exporting Myclass.class bindings to an external file.  RSS feed

 
Bill Zelan
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I am using Google Guice to create dependency injections between Test classes and actual implementations like this:

<code>binder.bind(MyClassInterface.class).to(MyClassImpl.class);
binder.bind(MyClass2Interface.class).to(MyClass2Stub.class);</code>

The point is to be able to change to a stub-implementation or to actual-implementation at runtime. Therefore I should externalize the
loadable classes to an external properties file. To problem is however that how do I parse a "MyClassImpl.class" out of the String I read from the Properties file?

All help appreciated! Thanks in advance!
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think Class.forName should work just fine.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!