Apart from the details described below, it is important not to forget that JDOM2 is delivered with a completely different package name: - all JDOM2 classes are now in the
org.jdom2.* package hierarchy.
This change is guaranteed to break all compatibility with JDOM1. The decision was made to do it this way so that:
In addition to this obvious change, there are a lot of other changes.
In addition to the major extensions and features above a number of other notable changes have been made too.
Serialization has been completely audited, revamped, and tested. All core JDOM content is completely serializable. This includes: Namespace, Attribute, all Parent, and all Content.
Clonable has been completely audited, revamped, and tested. All core JDOM content is completely cloneable. This includes: Attribute, all Parent, and all Content. Namespace is not Clonable. In addition, the clone() method has been made to have a covarian return type for each of these classes, thus,
There were a number of places in JDOM where reflection and introspection was used to determine what features were available. This sort of logic was required to support Java 1.2 while still also making certain Java 1.4 functionality possible. These places have been stripped and replaced with cleaner direct access to code functionality, which now effectively precludes support for previous versions of Java, but that's what JDOM2 is all about.
This interface has been slightly extended to include methods for handling Attributes with the new AttributeType enum. Additionally, there is now a setRoot() factory method.