Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable expansion support for @Key #69

Closed
mmadson opened this issue Feb 3, 2014 · 5 comments
Closed

Variable expansion support for @Key #69

mmadson opened this issue Feb 3, 2014 · 5 comments

Comments

@mmadson
Copy link

mmadson commented Feb 3, 2014

@key("myapp.${webappContextName}.jdbc.url")

Then I could create a new ConfigFactory passing in the webappContextName as a property and get a new jdbc url for each instance of my webapp. That'd be pretty neat.

@mmadson
Copy link
Author

mmadson commented Feb 3, 2014

taking a quick peek at the source it looks like this is pretty easy to implement, just calling expandVariables on the result of expandKey in the resolveProperty method of the PropertiesInvocationHandler

@lviggiano
Copy link
Collaborator

Yes. This is very useful and it's already implemented on master branch.
I would use this feature for a configuration pattern I used in a company, where we needed to select the runtime environment (dev, test, production) from some configuration files.

I wrote the documentation today so I closed the related issue #63

There is already the unit tests for it, so it should work fine.

See the related docs for additional infos. Last paragraph has been added today, and it is specific to this issue you spotted.

@lviggiano
Copy link
Collaborator

Let me know if you need something more, related to this, or if the feature I implemented for issue #63 covers your usage pattern, so I can close this issue.

Thanks.

@lviggiano lviggiano self-assigned this Feb 8, 2014
@mmadson
Copy link
Author

mmadson commented Feb 10, 2014

#63 looks exactly like what I was looking for (sorry for not looking before posting =/ ) Appreciate the quick response, thanks for the great work!

@mmadson mmadson closed this as completed Feb 10, 2014
@lviggiano
Copy link
Collaborator

Thanks.

sorry for not looking before posting

No worries at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants