Created
August 17, 2012 14:59
-
-
Save cy6erGn0m/3379556 to your computer and use it in GitHub Desktop.
Groovy dot "override"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def map = [:] | |
map.test = 1 | |
println map.test | |
map.xxx = [ aa : 'aa'] | |
println map.xxx.aa | |
class HasGetter extends Expando { | |
@Override | |
Object getProperty(String property) { | |
return this | |
} | |
@Override | |
String toString() { | |
"me" | |
} | |
} | |
map.yyy = new HasGetter() | |
println map.yyy.any.node.I.want.to.use |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment