Class Structure in ODFDOM

The Java packages reflect the layers of the ODFDOM library.

Shared Functionality

Shared by all layers are the basic XML classes as in the org.odftoolkit.odfdom package, like

Similar used through all layers are the ODF datatypes, to be found in

The Package/Physical Layer

These classes are in the org.odftoolkit.odfdom.pkg package to access files from the ODF package. The classes you will find here include:

The ODF Typed DOM / XML Layer

These classes are in general the generated DOM elements and attributes of ODF 1.2.

The third package will vanish in the future (mostly parts will be moved to the DOC layer in an upcoming release).

If you are using an IDE such as NetBeans or Eclipse, you don't have to memorize this hierarchy; the IDE can generate the proper import statements for you.

The code in these classes is generated directly from the Relax NG (RNG) schema for ODF.

The ODF Document / Convenience Functionality Layer

This is the layer that developers will use most often. A sub-level like org.odftoolkit.odfdom.doc.text inherits (currently) from the elements of the org.odftoolkit.odfdom.dom.element.text package. Aside of the namespace prefix an 'Odf' prefix is being used in the beginning. Furthermore is the namespace prefix neglected in case it already exists in the local name. The convenient class for the ODF element table:table, which is represented in the DOM layer by org.odftoolkit.odfdom.table.TableTableElement, is OdfTable and NOT OdfTableTable. We encourage developers to create methods for these classes, based on actual use cases of the toolkit.

The entry point for the convenient layer should be in the future the document itself. Some example functions had been added to OdfTextDocument to show this, like newParagraph(), adding a paragraph (ie. text:p element) at the end of the document.

Powered by the Apache CMS.

Apache "ODF Toolkit" is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.

Copyright © 2011 The Apache Software Foundation Licensed under the Apache License, Version 2.0. Contact Us
Apache and the Apache feather logos are trademarks of The Apache Software Foundation.
Other names appearing on the site may be trademarks of their respective owners.