Clone this wiki locally
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:
- changes to the API are possible
- JDOM users will need to re-visit their code to change the import statements (at least) and at that time they can take advantage of other JDOM2 features
- it is possible to simultaneously run both JDOM and JDOM2 in the same Java VM if necessary.
In addition to this obvious change, there are a lot of other changes.
- Namespaces In Scope
- Collections (and Iterators)
- XPath Upgrade
- Extended Filter Interface
- AttributeType Enumeration
- SAX Parsing Updates
- StAX Support
Attribute is Content
- Outputter Updates
- End-of-line Sequence
- Reduced Memory Footprint
- Specified Attributes
- Text Coalesce
- Location-Aware Content
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 covariant return type for each of these classes, thus
Cloning JDOM content will always result in a 'deep' clone, and the cloned content will always be detached. You cannot change any infomation related to the original content by changing the clone, and visa-versa.