Shared Bean References in BeanBuilderI did a little more work on the Groovy BeanBuider class and added the abllity to define shared references in the markup so that the same bean could be referenced in multiple locations in the markup:
builder = new BeanBuilder(this);
Object o = builder.bean {
beanInstance(bbname:'shared-bean') {
listInstance {
map {
key {
bean(bbnameref:'shared-bean')
}
}
}
}
objectInstance(bbnameref:'shared-bean')
}
A shared bean must be defined and declared with a bbname before it can be referenced via the bbnameref attribute. I updated the groovy-beanbuilder.tgz source code to include this feature. I placed the classes and scripts in the 'groovy.util' package only so I could execute the tests using the groovy testing mechanism in the groovy source distribution. BeanBuilder is NOT part of the groovy source tree.. |
Calendar
Categories
Archives
XML/RSS Feed
Powered by
|
||||||||||||||