Interface Processor

    • Method Detail

      • createTable

        Table createTable​(StructuralNode parent,
                          java.util.Map<java.lang.String,​java.lang.Object> attributes)
      • createTableRow

        Row createTableRow​(Table parent)
      • createTableColumn

        Column createTableColumn​(Table parent,
                                 int index)
      • createTableColumn

        Column createTableColumn​(Table parent,
                                 int index,
                                 java.util.Map<java.lang.String,​java.lang.Object> attributes)
      • createTableCell

        Cell createTableCell​(Column column,
                             java.lang.String text)
      • createTableCell

        Cell createTableCell​(Column column,
                             Document innerDocument,
                             java.util.Map<java.lang.String,​java.lang.Object> attributes)
      • createTableCell

        Cell createTableCell​(Column column,
                             java.lang.String text,
                             java.util.Map<java.lang.String,​java.lang.Object> attributes)
      • createBlock

        Block createBlock​(StructuralNode parent,
                          java.lang.String context,
                          java.lang.String content)
      • createBlock

        Block createBlock​(StructuralNode parent,
                          java.lang.String context,
                          java.lang.String content,
                          java.util.Map<java.lang.String,​java.lang.Object> attributes)
      • createBlock

        Block createBlock​(StructuralNode parent,
                          java.lang.String context,
                          java.lang.String content,
                          java.util.Map<java.lang.String,​java.lang.Object> attributes,
                          java.util.Map<java.lang.Object,​java.lang.Object> options)
      • createBlock

        Block createBlock​(StructuralNode parent,
                          java.lang.String context,
                          java.util.List<java.lang.String> content)
      • createBlock

        Block createBlock​(StructuralNode parent,
                          java.lang.String context,
                          java.util.List<java.lang.String> content,
                          java.util.Map<java.lang.String,​java.lang.Object> attributes)
      • createBlock

        Block createBlock​(StructuralNode parent,
                          java.lang.String context,
                          java.util.List<java.lang.String> content,
                          java.util.Map<java.lang.String,​java.lang.Object> attributes,
                          java.util.Map<java.lang.Object,​java.lang.Object> options)
      • createSection

        Section createSection​(StructuralNode parent,
                              java.util.Map<java.lang.Object,​java.lang.Object> options)
      • createSection

        Section createSection​(StructuralNode parent,
                              boolean numbered,
                              java.util.Map<java.lang.Object,​java.lang.Object> options)
      • createSection

        Section createSection​(StructuralNode parent,
                              int level,
                              boolean numbered,
                              java.util.Map<java.lang.Object,​java.lang.Object> options)
      • createPhraseNode

        PhraseNode createPhraseNode​(ContentNode parent,
                                    java.lang.String context,
                                    java.util.List<java.lang.String> text)
      • createPhraseNode

        PhraseNode createPhraseNode​(ContentNode parent,
                                    java.lang.String context,
                                    java.util.List<java.lang.String> text,
                                    java.util.Map<java.lang.String,​java.lang.Object> attributes)
      • createPhraseNode

        PhraseNode createPhraseNode​(ContentNode parent,
                                    java.lang.String context,
                                    java.util.List<java.lang.String> text,
                                    java.util.Map<java.lang.String,​java.lang.Object> attributes,
                                    java.util.Map<java.lang.Object,​java.lang.Object> options)
      • createPhraseNode

        PhraseNode createPhraseNode​(ContentNode parent,
                                    java.lang.String context,
                                    java.lang.String text)
      • createPhraseNode

        PhraseNode createPhraseNode​(ContentNode parent,
                                    java.lang.String context,
                                    java.lang.String text,
                                    java.util.Map<java.lang.String,​java.lang.Object> attributes)
      • createPhraseNode

        PhraseNode createPhraseNode​(ContentNode parent,
                                    java.lang.String context,
                                    java.lang.String text,
                                    java.util.Map<java.lang.String,​java.lang.Object> attributes,
                                    java.util.Map<java.lang.String,​java.lang.Object> options)
      • createBlock

        Block createBlock​(StructuralNode parent,
                          java.lang.String context,
                          java.util.Map<java.lang.Object,​java.lang.Object> options)
      • createSection

        Section createSection​(StructuralNode parent,
                              java.lang.Integer level,
                              boolean numbered,
                              java.util.Map<java.lang.Object,​java.lang.Object> options)
      • createDocument

        Document createDocument​(Document parentDocument)
        Creates an inner document for the given parent document. Inner documents are used for tables cells with style asciidoc.
        Parameters:
        parentDocument - The parent document of the new document.
        Returns:
        A new inner document.
      • createList

        List createList​(StructuralNode parent,
                        java.lang.String context)
        Creates a new List. This method is experimental and may change in future minor releases until declared to be stable.
        Parameters:
        parent - The block to which the parsed content should be added as children.
        context - Either "olist", ulist, colist or dlist
        Returns:
        A List node that can be added to the AST of a document.
      • createList

        List createList​(StructuralNode parent,
                        java.lang.String context,
                        java.util.Map<java.lang.String,​java.lang.Object> attributes,
                        java.util.Map<java.lang.Object,​java.lang.Object> options)
        Creates a new List. This method is experimental and may change in future minor releases until declared to be stable.
        Parameters:
        parent - The block to which the parsed content should be added as children.
        context - Either "olist", ulist, colist or dlist
        attributes - Additional attributes to be set on the new list node, e.g. Collections.singletonMap("start", "2").
        options - Additional options to be set on the new list node.
        Returns:
        A List node that can be added to the AST of a document.
      • createList

        List createList​(StructuralNode parent,
                        java.lang.String context,
                        java.util.Map<java.lang.Object,​java.lang.Object> options)
        Creates a new List. This method is experimental and may change in future minor releases until declared to be stable.
        Parameters:
        parent - The block to which the parsed content should be added as children.
        context - Either "olist", ulist, colist or dlist
        options - Additional options to be set on the new list node.
        Returns:
        A List node that can be added to the AST of a document.
      • createListItem

        ListItem createListItem​(List parent,
                                java.lang.String text)
      • parseContent

        void parseContent​(StructuralNode parent,
                          java.util.List<java.lang.String> lines)
        Parses the given raw asciidoctor content, parses it and appends it as children to the given parent block.

        The following example will add two paragraphs with the role newcontent to all top level sections of a document:

             
         Asciidoctor asciidoctor = ...
         asciidoctor.javaExtensionRegistry().treeprocessor(new Treeprocessor() {
             DocumentRuby process(DocumentRuby document) {
                 for (AbstractBlock block: document.getBlocks()) {
                     if (block instanceof Section) {
                         parseContent(block, Arrays.asList(new String[]{
                                                     "[newcontent]",
                                                     "This is new content"
                                                     "",
                                                     "[newcontent]",
                                                     "This is also new content"}));
                     }
                 }
             }
         });
             
         
        Parameters:
        parent - The block to which the parsed content should be added as children.
        lines - Raw asciidoctor content
      • newCursor

        Cursor newCursor​(java.lang.String file)
      • newCursor

        Cursor newCursor​(java.lang.String file,
                         java.lang.String dir)
      • newCursor

        Cursor newCursor​(java.lang.String file,
                         java.lang.String dir,
                         int lineno)
      • newReader

        Reader newReader​(java.util.List<java.lang.String> source,
                         Cursor cursor,
                         java.util.Map<java.lang.Object,​java.lang.Object> options)
      • newReader

        Reader newReader​(java.util.List<java.lang.String> source,
                         Cursor cursor)
      • newReader

        Reader newReader​(java.util.List<java.lang.String> source,
                         java.util.Map<java.lang.Object,​java.lang.Object> options)
      • newReader

        Reader newReader​(java.util.List<java.lang.String> source)
      • getConfig

        java.util.Map<java.lang.String,​java.lang.Object> getConfig()
      • setConfig

        void setConfig​(java.util.Map<java.lang.String,​java.lang.Object> config)
      • updateConfig

        void updateConfig​(java.util.Map<java.lang.String,​java.lang.Object> config)
      • unwrap

        <T> T unwrap​(java.lang.Class<T> clazz)