Feeds

A practical guide to JAXB 2.0

Take a peek at its new features

  • alert
  • submit to reddit

Choosing a cloud hosting partner with confidence

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.

Business security measures using SSL

More from The Register

next story
'Windows 9' LEAK: Microsoft's playing catchup with Linux
Multiple desktops and live tiles in restored Start button star in new vids
Not appy with your Chromebook? Well now it can run Android apps
Google offers beta of tricky OS-inside-OS tech
New 'Cosmos' browser surfs the net by TXT alone
No data plan? No WiFi? No worries ... except sluggish download speed
Greater dev access to iOS 8 will put us AT RISK from HACKERS
Knocking holes in Apple's walled garden could backfire, says securo-chap
NHS grows a NoSQL backbone and rips out its Oracle Spine
Open source? In the government? Ha ha! What, wait ...?
Google extends app refund window to two hours
You now have 120 minutes to finish that game instead of 15
Intel: Hey, enterprises, drop everything and DO HADOOP
Big Data analytics projected to run on more servers than any other app
prev story

Whitepapers

Providing a secure and efficient Helpdesk
A single remote control platform for user support is be key to providing an efficient helpdesk. Retain full control over the way in which screen and keystroke data is transmitted.
Saudi Petroleum chooses Tegile storage solution
A storage solution that addresses company growth and performance for business-critical applications of caseware archive and search along with other key operational systems.
Security and trust: The backbone of doing business over the internet
Explores the current state of website security and the contributions Symantec is making to help organizations protect critical data and build trust with customers.
Reg Reader Research: SaaS based Email and Office Productivity Tools
Read this Reg reader report which provides advice and guidance for SMBs towards the use of SaaS based email and Office productivity tools.
Security for virtualized datacentres
Legacy security solutions are inefficient due to the architectural differences between physical and virtual environments.