Class Blockquote

    • Method Detail

      • bq

        public static Blockquote bq()
        Create an empty Blockquote node. At least one Paragraph must be provided as the block's content to make it valid.
        Returns:
        a new, empty Blockquote
      • bq

        public static Blockquote bq​(String content)
        Create a Blockquote node containing a single paragraph with the given text as its content.
        Parameters:
        content - the string to use as the content of the block quote. As a convenience, the provided string is wrapped first as a Text node and then as a Paragraph before it is set as the content. It cannot be an empty string.
        Returns:
        a new Blockquote containing the provided text as its content
      • bq

        public static Blockquote bq​(String... content)
        Create a Blockquote node containing a single paragraph with the given text as its content. As a convenience, each element of content is wrapped first as a Text node and then as a Paragraph before it is set as the content for this Blockquote.

        At least one Paragraph must be provided as the block's content to make it valid.

        Parameters:
        content - the strings to use as the content of the block quote. As a convenience, each provided string is wrapped first as a Text node and then as a Paragraph before it is set as the content, so each element will form its own paragraph. None of them may be an empty string.
        Returns:
        a new Blockquote containing the provided text as its content
      • bq

        public static Blockquote bq​(Paragraph content)
        Create a Blockquote node containing a single paragraph as its content.
        Parameters:
        content - the paragraph to use as the content of the block quote.
        Returns:
        a new Blockquote containing the provided paragraph as its content
      • bq

        public static Blockquote bq​(Paragraph... content)
        Create a Blockquote node containing the given paragraph as its content. At least one Paragraph must be provided as the block's content to make it valid.
        Parameters:
        content - the paragraphs to use as the content of the block quote.
        Returns:
        a new Blockquote containing the provided paragraph as its content
      • bq

        public static Blockquote bq​(Iterable<? extends Paragraph> content)
        Create a Blockquote node containing the given paragraph as its content. At least one Paragraph must be provided as the block's content to make it valid.
        Parameters:
        content - the paragraphs to use as the content of the block quote. The iterable will be iterated at most once and immediately.
        Returns:
        a new Blockquote containing the provided paragraph as its content
      • bq

        public static Blockquote bq​(Stream<? extends Paragraph> content)
        Create a Blockquote node containing the given paragraph as its content. At least one Paragraph must be provided as the block's content to make it valid.
        Parameters:
        content - the paragraphs to use as the content of the block quote. The stream will be terminated and consumed immediately.
        Returns:
        a new Blockquote containing the provided paragraph as its content
      • copy

        public Blockquote 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<Blockquote,​Paragraph>
        Specified by:
        copy in interface Element
        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
      • appendPlainText

        public void appendPlainText​(StringBuilder sb)
        Description copied from interface: Node
        Renders this node as plain-text suitable for viewing by end users. This is equivalent to calling Node.toPlainText() and appending the result to the given buffer, except that it may be slightly more efficient, since it will write directly to the existing buffer instead of using a temporary buffer and having to make a copy of the result.
        Specified by:
        appendPlainText in interface Node
        Overrides:
        appendPlainText in class AbstractContentNode<Blockquote,​Paragraph>
        Parameters:
        sb - where to write the result