O'Reilly logo

Groovy Programming by John Savage, Kenneth Barclay

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

APPENDIX K MORE ON BUILDERS

Chapters 19 and 20 introduced the notion of Groovy builders. Essentially, Groovy builders allow us to easily represent nested treelike data structures such as XML data. With a builder, specifically a MarkupBuilder, we can effortlessly construct XML data. With a SwingBuilder, we can effortlessly construct a GUI application comprised of Swing components.

In this appendix, we consider an AntBuilder that we can use to construct Ant XML build files (Holzner, 2005) and execute them without having to deal with XML. Also, we briefly demonstrate how we can make our own specialized builders. We assume prior knowledge of Ant.

K.1 ANTBUILDER

Groovy provides the AntBuilder class with which we can easily construct and execute ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required