@FieldsAreNonnullByDefault @ParametersAreNonnullByDefault @PublicApi @ReturnValuesAreNonnullByDefault
Package com.atlassian.adf.model
QUICK START GUIDE.
Quick Start Guide
What do you want to do?Build brand new ADF contentParse existing ADF contentScan existing ADF content and/or modify to itAdd more content to an existing ADF node
Okay, That Was TOO Quick!
This library provides a Java API for building, parsing, and manipulating ADF documents. The Atlassian Document Format is a JSON-encoded representation of rich content used by multiple Atlassian Cloud products, notably both Jira and Confluence.While the focus has been heavily weighted towards feature development rather than public documentation of this API for an extended period, this shortcoming is now (late 2022) starting to receive significant attention as we try to enable ecosystem developers to make use of the richer content options that ADF provides. While the Javadocs for this library are by no means an adequate replacement for the proper documentation to come, hopefully they provide enough detail to bridge the gap in the meantime.
The primary library, which uses groupId com.atlassian.adf and artifactId
adf-builder-java provides three main capabilities:
- Building — Each node and mark type has
staticfactories for creating nodes of that type and composing them to form ADF. The nodes (includingDocitself) contain define atoMap()method whose output can be serialized by your favorite JSON library to create valid input for Atlassian APIs that require ADF values. - Parsing — The
Docnode has aDoc.parse(java.util.Map)parse} method that accepts aMap<String, ?>structure and parses it to the same concrete classes that are used when Building. When accepting ADF output from Atlassian APIs, your favorite JSON library can parse the value to aMap<String, Object>and use this method to map it to concrete classes that can be used to interpret the content. - Manipulating — Whether building a new document or parsing a new one, the concrete classes representing the various nodes and marks in the ADF structure are mutable within this library, providing a rich and context-aware API for modifying the content while maintaining the correctness of its structure. See the individual node and mark classes for more information about what changes can be made and any related caveats.
Doc class's parse and toMap methods so that you never have to deal with
the intermediate Map<String, Object> data format yourself.- See Also:
Doc,nodes,marks, Atlassian Document Format
-
Interface Summary Interface Description Element Any object within the Atlassian Document Format (ADF) structure.Element.Attr Element.Key -
Class Summary Class Description Schema Schema reader for the JSON schema included in the source.UnsupportedElement Represents an ADF element that isn't supported by this library and can only be preserved as-is, not directly manipulated, because we don't know what it is, what it does, or what constraints there might be around its use. -
Enum Summary Enum Description Documentation.State Expresses that library's author on the state of the Jira ADF Documentation for this item (whether it is a mark, a node, or a property of either) at the time of its more recent review onDocumentation.date(). -
Annotation Types Summary Annotation Type Description Documentation Expresses the library maintainer's opinion of the state of the public documentation for the Atlassian Document Format with regard to the annotated node or mark.