The frameworks such as Castor and XMLBeans do exactly
this. JAXB is the Java reference implementation for Java XML binding. Today, we
have XStream which will do the same functionality quickly. Let us see how these
frameworks are relevant in the JBI discussion.
Chapter 12
[ 223 ]
JAXB
Java API for XML Binding (JAXB) provides a convenient way to process XML
content using Java objects by binding its XML schema to Java representation. JAXB
provides an API and the required tool sets that automate the mapping between the
XML documents and the Java instances. Thus we can list out the main features as:
Unmarshal the XML instance into a Java instance.
Access, update, and validate the Java representation against
schema constraint.
Marshal the Java instance of the XML content into the XML
document instance.
XStream
XStream is a simple, open source library to serialize Java objects to the XML and
back again. It is lightweight in the sense that it doesn't require much configuration
or mapping files. XStream has a good integration with the ServiceMix. In fact,
ServiceMix provides an XStream backed API itself named JavaSource.
Pages:
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313