JiBX 1.2, part 1th: From Java code to XML schema

Source: Internet
Author: User
Tags data structures new features

Improve pattern quality through custom transformations between the Java data model and XML documents

The XML schema definition is the basis for many types of data interchange, including most Web service forms. But XML schemas are a very complex standard, and most of the tools used to create and modify schema definitions are less functional and ease-of-use than the tools that work with Java™ code. You'll learn about the new features of JiBX 1.2 in part 1th of this tutorial-a two-part series-that will allow you to start with Java code and easily generate good schema definitions to match data structures. Then, whether you use JiBX data binding or not, you can use these patterns directly.

Before you start

About this tutorial

JiBX is the binding tool for XML data and Java objects. JiBX data binding has long been considered the fastest and most flexible way to bind Java code and XML. However, the complexity of its binding definitions and limited support for widely used XML schema definitions often disappoint users. Fortunately, the 1.2 version of JiBX has been working to eliminate these problems. In this tutorial, you will learn how to use the new features of the JIBX 1.2 to easily generate XML Schema definitions from existing Java code and to read and write XML documents that match the generated schema definitions-all of which do not require a detailed understanding of the JIBX binding definition. Part 2nd will introduce the opposite side, where Java code is generated from the XML schema definition.

Goal

This tutorial will guide you through the process of using JiBX to generate XML schema definitions from Java code. You'll first see how to start with a simple Java data model, and then generate a default pattern that matches the model. On this basis, you will learn how to easily control the actual values used by Java classes and their access methods by applying a series of customizations, and whether these classes are necessary or optional, the names and namespaces used in XML, and even the structure of the generated schema definition. In this process, you will see how JiBX uses the automated archiving pattern you have in Javadoc to define, making the generated schemas more valuable. After reading this tutorial and practicing the examples provided, you will be able to use JiBX to generate excellent XML schema definitions from your own Java data structure classes.

Prerequisite

To understand this tutorial, you should at least understand the basics of Java code and XML. You do not need to understand the XML schema definition in detail, but a slightly familiar pattern will help you better understand the example.

System Requirements

To run the sample, you need to install:

Any one of the following tools:

Sun ' s JDK 1.5.0_09 (or later).

IBM Developer Kit for Java technology 1.5.0 SR3.

The latest version of the Apache Ant build tool.

This tutorial includes the JiBX download and installation instructions.

Begin

In this section, you will have a preliminary understanding of Jibx and install the JIBX and tutorial sample code.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.