@FieldsAreNonnullByDefault @ParametersAreNonnullByDefault @PublicApi @ReturnValuesAreNonnullByDefault

Package com.atlassian.adf.model

QUICK START GUIDE.

Quick Start Guide

What do you want to do?

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:

  1. Building — Each node and mark type has static factories for creating nodes of that type and composing them to form ADF. The nodes (including Doc itself) contain define a toMap() method whose output can be serialized by your favorite JSON library to create valid input for Atlassian APIs that require ADF values.
  2. Parsing — The Doc node has a Doc.parse(java.util.Map) parse} method that accepts a Map<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 a Map<String, Object> and use this method to map it to concrete classes that can be used to interpret the content.
  3. 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.
Additionally, separate modules are provided for gluing your favorite JSON library directly into the 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