Project Documentation

Welcome to Java2XmlBinding (J2XB)

What is J2XB

The J2XB project aims at offering seamless Java and XML integration defined in Java. It offers the developer a tool to bind XML documents to Java types. What is special with J2XB is that no code Java generation is involved. J2XB transform the development of Java and XML binding from Java code generation to XML Schema generation.

The J2XB project is unique in that it aims at:

Complete XML Schema generation from the Java code, including all Schema features.

XML validations (Facets, such as minLength and patterns).

Substitution Groups

Full control of the XML document structure, including flattening Java structures and introducing grouping XML elements.

Support all XML Simple types

XML Union Types

XML List Types

Bind any Java object to XML.

No requirement for inheriting from a common ancestor.

No requirement to implement any interface.

No requirement to have a default constructor.

No requirement to even have a public constructor, if a factory is provided

Full support for factories (static factories, instance factories)

Support for Java built in collection types (Set, List, Array)

Complete support for inheritence

Mapped as Substitution Groups

Complete and accurate XML Schema generation of the Substitution Groups

Getting Started

Binding Java classes to XML with J2XB is as simple as it can be - just annotate your classes with a few annotations and you are ready (to get the full benefit of J2XB you will need to add only annotations).

First, download J2XB and include it in your classpath.

Add annotations to your Java code. At the vary minimum, you should add the MOPersistentBean
annotation for every mapped class and the MOProperty
annotation for every Java property to map.

What next

Have a look at the documentation to utilize the full power of J2XB, Have a look at the examples, And try J2XB!

What is still to be done with J2XB

The J2XB project is at a mature stage and offers important benefits with the feature set it includes. However, like any software project, there is still a lot that can be done to improve this project. Some of the ideas that can be added to this project are:

Ant task to generate XML Schema from source files.

Overriding the annotations on a Java class with an external XML configuration file.

Automatic handling of Bean cycles, where one bean points to another and the other back to the first.