Class Heading

    • Method Detail

      • h1

        public static Heading h1()
        Returns:
        a new, empty level 1 heading
      • h1

        public static Heading h1​(String content)
        Returns:
        a new level 1 heading with the given content
      • h1

        public static Heading h1​(String... content)
        Returns:
        a new level 1 heading with the given content
      • h1

        public static Heading h1​(InlineContent content)
        Returns:
        a new level 1 heading with the given content
      • h1

        public static Heading h1​(InlineContent... content)
        Returns:
        a new level 1 heading with the given content
      • h1

        public static Heading h1​(Stream<? extends InlineContent> content)
        Returns:
        a new level 1 heading with the given content
      • h2

        public static Heading h2()
        Returns:
        a new, empty level 2 heading
      • h2

        public static Heading h2​(String content)
        Returns:
        a new level 2 heading with the given content
      • h2

        public static Heading h2​(String... content)
        Returns:
        a new level 2 heading with the given content
      • h2

        public static Heading h2​(InlineContent content)
        Returns:
        a new level 2 heading with the given content
      • h2

        public static Heading h2​(InlineContent... content)
        Returns:
        a new level 2 heading with the given content
      • h2

        public static Heading h2​(Stream<? extends InlineContent> content)
        Returns:
        a new level 2 heading with the given content
      • h3

        public static Heading h3()
        Returns:
        a new, empty level 3 heading
      • h3

        public static Heading h3​(String content)
        Returns:
        a new level 3 heading with the given content
      • h3

        public static Heading h3​(String... content)
        Returns:
        a new level 3 heading with the given content
      • h3

        public static Heading h3​(InlineContent content)
        Returns:
        a new level 3 heading with the given content
      • h3

        public static Heading h3​(InlineContent... content)
        Returns:
        a new level 3 heading with the given content
      • h3

        public static Heading h3​(Stream<? extends InlineContent> content)
        Returns:
        a new level 3 heading with the given content
      • h4

        public static Heading h4()
        Returns:
        a new, empty level 4 heading
      • h4

        public static Heading h4​(String content)
        Returns:
        a new level 4 heading with the given content
      • h4

        public static Heading h4​(String... content)
        Returns:
        a new level 4 heading with the given content
      • h4

        public static Heading h4​(InlineContent content)
        Returns:
        a new level 4 heading with the given content
      • h4

        public static Heading h4​(InlineContent... content)
        Returns:
        a new level 4 heading with the given content
      • h4

        public static Heading h4​(Stream<? extends InlineContent> content)
        Returns:
        a new level 4 heading with the given content
      • h5

        public static Heading h5()
        Returns:
        a new, empty level 5 heading
      • h5

        public static Heading h5​(String content)
        Returns:
        a new level 5 heading with the given content
      • h5

        public static Heading h5​(String... content)
        Returns:
        a new level 5 heading with the given content
      • h5

        public static Heading h5​(InlineContent content)
        Returns:
        a new level 5 heading with the given content
      • h5

        public static Heading h5​(InlineContent... content)
        Returns:
        a new level 5 heading with the given content
      • h5

        public static Heading h5​(Stream<? extends InlineContent> content)
        Returns:
        a new level 5 heading with the given content
      • h6

        public static Heading h6()
        Returns:
        a new, empty level 6 heading
      • h6

        public static Heading h6​(String content)
        Returns:
        a new level 6 heading with the given content
      • h6

        public static Heading h6​(String... content)
        Returns:
        a new level 6 heading with the given content
      • h6

        public static Heading h6​(InlineContent content)
        Returns:
        a new level 6 heading with the given content
      • h6

        public static Heading h6​(InlineContent... content)
        Returns:
        a new level 6 heading with the given content
      • h6

        public static Heading h6​(Stream<? extends InlineContent> content)
        Returns:
        a new level 6 heading with the given content
      • heading

        public static Heading heading​(int level)
        Parameters:
        level - must be in the range 1-6
        Returns:
        a new, empty heading with the given level
      • heading

        public static Heading heading​(int level,
                                      String content)
        Parameters:
        level - must be in the range 1-6
        Returns:
        a new heading with the given level and content
      • heading

        public static Heading heading​(int level,
                                      String... content)
        Parameters:
        level - must be in the range 1-6
        Returns:
        a new heading with the given level and content
      • heading

        public static Heading heading​(int level,
                                      InlineContent content)
        Parameters:
        level - must be in the range 1-6
        Returns:
        a new heading with the given level and content
      • heading

        public static Heading heading​(int level,
                                      InlineContent... content)
        Parameters:
        level - must be in the range 1-6
        Returns:
        a new heading with the given level and content
      • heading

        public static Heading heading​(int level,
                                      Iterable<? extends InlineContent> content)
        Parameters:
        level - must be in the range 1-6
        Returns:
        a new heading with the given level and content
      • heading

        public static Heading heading​(int level,
                                      Stream<? extends InlineContent> content)
        Parameters:
        level - must be in the range 1-6
        Returns:
        a new heading with the given level and content
      • level

        public Heading level​(int level)
      • content

        public Heading content​(String content)
        Adds the given string to this heading after first wrapping it as a Text node.
        Parameters:
        content - the content to add
        Returns:
        this
      • content

        public Heading content​(String... content)
        Adds the given strings to this heading after first wrapping them as Text nodes.
        Parameters:
        content - the content to add
        Returns:
        this
      • indentation

        public Heading indentation​(int level)
      • level

        public int level()
        Returns the heading level for this heading note, such as 3 for an <h3> heading.
        Returns:
        the heading level for this heading note, such as 3 for an <h3> heading.
      • copy

        public Heading copy()
        Description copied from interface: Element
        Returns a deep copy of this element, including copies of any nodes or marks that it contains. The copy will not necessarily be in exactly the same state as the original in some cases. For example, a text node that is used inside a codeBlock will have the ability to use marks on it disabled, but a copy made of the text node using this method will not similarly disallow marks unless it is also added to a content node with those same restrictions.

        Implementations notes:

        • Implementations should narrow the return type.
        • Implementations should return this if the element is immutable. The @Immutable annotation should be used on the class to offer additional confirmation of this intent.
        • Implementations should return parse(toMap()) if they have state.
        • While there may be cases where it is worthwhile to do something more efficient than the conversion to a map and back, this is discouraged because it would add yet another fragile piece of code that breaks when new data is added to the node. The parse and toMap methods already have to be updated in these circumstances, so it makes sense to take advantage of that.
        Specified by:
        copy in interface ContentNode<Heading,​InlineContent>
        Specified by:
        copy in interface Element
        Specified by:
        copy in interface Marked<Heading,​HeadingMark>
        Specified by:
        copy in interface Node
        Returns:
        a copy of this element, or this if the element is immutable anyway
      • elementType

        public String elementType()
        Description copied from interface: Element
        The type value that identifies this element, such as "paragraph" or "strong".
        Specified by:
        elementType in interface Element
      • toMap

        public Map<String,​?> toMap()
        Description copied from interface: Element
        Transforms this element to a map of String values to various basic object types suitable for direct rendering as JSON content.
        Specified by:
        toMap in interface Element
        Returns:
        the map representation of this ADF element