Feeds

A practical guide to JAXB 2.0

Take a peek at its new features

  • alert
  • submit to reddit

High performance access to file storage

The directory structure of the JAXB2 project is shown in Figure 2.

JAXB Project Directory Structure

Compiling an XML Schema

In this section, we will bind the catalog schema, catalog.xsd, to Java classes with the xjc compiler. We shall configure xjc as an external tool in Eclipse. Select Run>External Tools>External Tools. In the External Tools frame, right-click on the Program node and select New to create a new configuration as shown in Figure 3.  XJC External Tools Configuration

Also, set environment variables JAVA_HOME and JAXB_HOME in the external tool configuration for xjc in the Environment tab, as shown in Figure 4.

 Setting Environment Variables

Run xjc compiler on the example schema, catalog.xsd. Select catalog.xsd file in the Package Explorer window and then Run>External Tools>XJC.

The output from the XJC compiler is shown in Figure 5.

Output from XJC Compiler

Schema-derived classes get generated in the gen_source folder, as shown in Figure 6.

Schema Derived Classes

Java classes and interfaces are generated in package generated, by default. For each xsd:complexType schema component, one value class gets generated, instead of an interface and an implementation class. For example, for catalogType complexType a Java value class CatalogType.java gets generated. An ObjectFactory.java class also gets generated. The factory class consists of create methods to create Java value class objects.

High performance access to file storage

More from The Register

next story
Windows 8.1, which you probably haven't upgraded to yet, ALREADY OBSOLETE
Pre-Update versions of new Windows version will no longer support patches
Android engineer: We DIDN'T copy Apple OR follow Samsung's orders
Veep testifies for Samsung during Apple patent trial
OpenSSL Heartbleed: Bloody nose for open-source bleeding hearts
Bloke behind the cockup says not enough people are helping crucial crypto project
Half of Twitter's 'active users' are SILENT STALKERS
Nearly 50% have NEVER tweeted a word
Windows XP still has 27 per cent market share on its deathbed
Windows 7 making some gains on XP Death Day
Internet-of-stuff startup dumps NoSQL for ... SQL?
NoSQL taste great at first but lacks proper nutrients, says startup cloud whiz
Microsoft lobs pre-release Windows Phone 8.1 at devs who dare
App makers can load it before anyone else, but if they do they're stuck with it
US taxman blows Win XP deadline, must now spend millions on custom support
Gov't IT likened to 'a Model T with a lot of things on top of it'
prev story

Whitepapers

Mainstay ROI - Does application security pay?
In this whitepaper learn how you and your enterprise might benefit from better software security.
Five 3D headsets to be won!
We were so impressed by the Durovis Dive headset we’ve asked the company to give some away to Reg readers.
3 Big data security analytics techniques
Applying these Big Data security analytics techniques can help you make your business safer by detecting attacks early, before significant damage is done.
The benefits of software based PBX
Why you should break free from your proprietary PBX and how to leverage your existing server hardware.
Mobile application security study
Download this report to see the alarming realities regarding the sheer number of applications vulnerable to attack, as well as the most common and easily addressable vulnerability errors.