• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Exporting Myclass.class bindings to an external file.

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Sheriff
Posts: 22780
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think Class.forName should work just fine.
reply
    Bookmark Topic Watch Topic
  • New Topic