JAXB - Adding Support for MethodChaining

the XML Duke

Kohsuke is reporting about a customer that wanted Method chaining (also known as Fluent Interface). He filed a bug but when Kohsuke told him he could write a plugin, he wrote one; the community in action!

The plugin lets you write things like:

USAddress address = new USAddress()
			.withName(name)
			.withStreet(street)
			.withCity(city)
			.withState(state)
			.withZip(new BigDeciaml(zip));

Check Kohsuke's blog and the JAXB plugin.

Comments:

Post a Comment:
Comments are closed for this entry.