0

I am currently working in the Guice Module. Here, I am injecting the Properties file from Java Util. The properties file constists of default constructor. So do I have to bind the properties file in my Guice Module or it will directly create the properties class with its default constructor without binding it?

Thank you very much

Jasmine
  • 135
  • 3
  • 16

1 Answers1

0

You don't need to bind it. Binding is required to map a type to its implementation. However, you can use Names.bindProperties(Binder binder, Properties properties). See Guice and properties files. You can also implement your own Provider - https://github.com/google/guice/wiki/ProviderBindings

Community
  • 1
  • 1
Jakub Bibro
  • 1,570
  • 13
  • 17