like:
def test = ["a","b","c,"]
Object a = new Object()
test.each{
a.metaClass."${it}" = it
}
generates te following fields in the object a
a.a = "a"
a.b = "b"
a.c = "c"
works incredible well with the grails export plugin :)
def test = ["a","b","c,"]
Object a = new Object()
test.each{
a.metaClass."${it}" = it
}
No comments:
Post a Comment