I have an application config file that looks something like this:
database:
type: [db-type]
username: [name]
password: [pw]
server: [ip]
database: [db-name]
db-type can be any of the following: {postgresql, mysql, mssql, file}. I wanted to configure the binding, such that (it's hibernate based) the app loads a special Provider of SessionFactory depending on which of the values is used, i.e. a PostgresqlSessionFactoryProvider.
The problem is, that Guice also takes care of injecting an instance of Config.class into classes that need access to it. Now I need to access the config, while setting up the binding... It's sort of a chicken-egg problem.
How do I get around that?