O'Reilly logo

Special Edition Using Java™ 2 Enterprise Edition by Mark Wutka

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

Using XML to Describe Objects

XML is handy for describing data for a code generator. XML's capability to handle structured data with ease makes it ideal for generating code.

One of the areas of Java coding that can be particularly tedious is creating JavaBeans— especially when they have a lot of properties. The properties are easy to define, and you typically implement them all the same way—at least until you start adding extra business logic to the getters and setters.

When you generate code, there's no reason you can't edit the generated code. Sometimes a code generator just makes for a good head start.

Now, to generate JavaBeans (for this example, you'll just generate properties and not events), you need a way to represent the parts of the ...

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