-
-
Notifications
You must be signed in to change notification settings - Fork 212
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
SimpleDateFormat variable expansion, is it possible? #104
Comments
This looks as an interesting add. |
I'll submit a pull request as soon as I get the time. |
Define some junit tests first to show how this shall be used. I'd like to
|
I mean, from your example: public interface Configuration extends Config {
@DefaultValue("${user.home}${file.separator}${date:yyyyMMdd-HHmmssSSS}")
String logDirPath();
}
Registering a custom substitutor may be interesting, though I'd like to see a test case to figure out how the feature would work. Try to design a simple API for that: adding complexity adds overhead on other important features that are still missing. But also, once we introduce something in the API, I'd like to have some clean+simple+powerful api, so we don't need to change the feature later (breaking backward compatibility). |
Just added a pull request for this, containing only the unit tests. See #108 |
Updated the pull request #108 with the actual implementation. |
I'll look into it asap |
FYI This feature is inspired by a similar feature in apache commons configuration (which I have found useful). |
Any comments on this? /Alex |
I didn't had time to study this in deep, yet. I think I got a general understanding, but not a complete idea on this. Unfortunately I am working on this project on my spare time. |
Fair enough. Just wanted to be sure you haven't forgotten about it. Will remind you again in a month or two. /Alex |
just a friendly reminder about this. |
I would like to define a
Config
interface like this:where
prints the expected output:
Where the
X
in "${date:X}" represent any pattern as used byjava.text.SimpleDateFormat
.More generally, it would be nice to be able to register custom substitutors. Something like this
Could this be a possible feature for OWNER in the future?
The text was updated successfully, but these errors were encountered: