99soft / rocoto

expanded properties file parsing for Google Guice
http://99soft.github.com/rocoto/
Apache License 2.0
22 stars 12 forks source link

Extending variables resolving capabilities #3

Closed picpoc closed 12 years ago

picpoc commented 12 years ago
property=${not.found|${not.found.again|Crap!}}

# property = Crap!

not.found.again=Fallback!

# property = Fallback!
...
hello.en=Hi!
hello.fr=Salut !
hello.i18n=${hello.${locale|en}}

# hello.i18n = Hi!

locale=fr

# hello.i18n = Salut!
# Will not thow a stack overflow
GNU=${GNU}'s Not UNIX
g=2g
gg2=2
h=${${${g}4|${g}2}}
2g=gg
2g2=4
gg=${h}${4|${${2g}2}}

# gg=42

May need some refactoring and optimization.

simonetripodi commented 12 years ago

Many apologize to join the discussion so late - github didn't send me the email notification about that pullrequest - anyway, better late than never ;)

Proposals are cool, just give me the time to review them and I will merge them!!!

May I can kindly ask you to add few notes in the documentation as well? It would simplify the release process ;)

Thanks a lot for contributing back! -Simo

simonetripodi commented 12 years ago

Very well done Picpoc, I am going to merge it, congrats and thanks for the hard work!

Could you please send me in PVT your email contact? I have something to speak with you! TIA!