Class ToAsciiDocSerializer

java.lang.Object
io.micronaut.openapi.adoc.md.ToAsciiDocSerializer
All Implemented Interfaces:
org.pegdown.ast.Visitor

public class ToAsciiDocSerializer extends Object implements org.pegdown.ast.Visitor
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final Map<String,String>
     
    protected boolean
     
    protected int
     
    protected int
     
    protected org.pegdown.ast.TableNode
     
    static final String
     
    protected boolean
     
    protected final org.pegdown.LinkRenderer
     
    protected int
     
    protected char
     
    protected org.pegdown.Printer
     
    protected final Map<String,org.pegdown.ast.ReferenceNode>
     
    protected org.pegdown.ast.RootNode
     
    protected String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ToAsciiDocSerializer(org.pegdown.ast.RootNode rootNode, String source)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    cleanAst(org.pegdown.ast.Node node)
    Removes superfluous nodes from the tree.
    protected org.pegdown.ast.Node
    findParentNode(org.pegdown.ast.Node target, org.pegdown.ast.Node from)
     
    protected boolean
    isFirstChild(org.pegdown.ast.Node parent, org.pegdown.ast.Node child)
     
    protected boolean
    isListItemText(org.pegdown.ast.Node node)
     
    protected String
    normalize(String string)
     
    protected String
     
    protected String
    printChildrenToString(org.pegdown.ast.SuperNode node)
     
    protected void
    printImageTag(org.pegdown.LinkRenderer.Rendering rendering)
     
    protected void
    printImageTagWithLink(org.pegdown.LinkRenderer.Rendering image, org.pegdown.LinkRenderer.Rendering link)
     
    protected void
    printLink(org.pegdown.LinkRenderer.Rendering rendering)
     
    protected void
    printNodeSurroundedBy(org.pegdown.ast.AbstractNode node, String token)
     
    protected void
    printTextWithQuotesIfNeeded(org.pegdown.Printer p, String text)
     
    protected void
     
     
    void
    visit(org.pegdown.ast.AbbreviationNode node)
     
    void
    visit(org.pegdown.ast.AnchorLinkNode node)
     
    void
    visit(org.pegdown.ast.AutoLinkNode node)
     
    void
    visit(org.pegdown.ast.BlockQuoteNode node)
     
    void
    visit(org.pegdown.ast.BulletListNode node)
     
    void
    visit(org.pegdown.ast.CodeNode node)
     
    void
    visit(org.pegdown.ast.DefinitionListNode node)
     
    void
    visit(org.pegdown.ast.DefinitionNode node)
     
    void
    visit(org.pegdown.ast.DefinitionTermNode node)
     
    void
    visit(org.pegdown.ast.ExpImageNode node)
     
    void
    visit(org.pegdown.ast.ExpLinkNode node)
     
    void
    visit(org.pegdown.ast.HeaderNode node)
     
    void
    visit(org.pegdown.ast.HtmlBlockNode node)
     
    void
    visit(org.pegdown.ast.InlineHtmlNode node)
     
    void
    visit(org.pegdown.ast.ListItemNode node)
     
    void
    visit(org.pegdown.ast.MailLinkNode node)
     
    void
    visit(org.pegdown.ast.Node node)
     
    void
    visit(org.pegdown.ast.OrderedListNode node)
     
    void
    visit(org.pegdown.ast.ParaNode node)
     
    void
    visit(org.pegdown.ast.QuotedNode node)
     
    void
    visit(org.pegdown.ast.ReferenceNode node)
     
    void
    visit(org.pegdown.ast.RefImageNode node)
     
    void
    visit(org.pegdown.ast.RefLinkNode node)
     
    void
    visit(org.pegdown.ast.RootNode node)
     
    void
    visit(org.pegdown.ast.SimpleNode node)
     
    void
    visit(org.pegdown.ast.SpecialTextNode node)
     
    void
    visit(org.pegdown.ast.StrikeNode node)
     
    void
    visit(org.pegdown.ast.StrongEmphSuperNode node)
     
    void
    visit(org.pegdown.ast.SuperNode node)
     
    void
    visit(org.pegdown.ast.TableBodyNode node)
     
    void
    visit(org.pegdown.ast.TableCaptionNode node)
     
    void
    visit(org.pegdown.ast.TableCellNode node)
     
    void
    visit(org.pegdown.ast.TableColumnNode node)
     
    void
    visit(org.pegdown.ast.TableHeaderNode node)
     
    void
    visit(org.pegdown.ast.TableNode node)
     
    void
    visit(org.pegdown.ast.TableRowNode node)
     
    void
    visit(org.pegdown.ast.TextNode node)
     
    void
    visit(org.pegdown.ast.VerbatimNode node)
     
    void
    visit(org.pegdown.ast.WikiLinkNode node)
     
    protected void
    visitChildren(org.pegdown.ast.AbstractNode node)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • HARD_LINE_BREAK_MARKDOWN

      public static final String HARD_LINE_BREAK_MARKDOWN
      See Also:
    • source

      protected String source
    • printer

      protected org.pegdown.Printer printer
    • references

      protected final Map<String,org.pegdown.ast.ReferenceNode> references
    • abbreviations

      protected final Map<String,String> abbreviations
    • linkRenderer

      protected final org.pegdown.LinkRenderer linkRenderer
    • currentTableNode

      protected org.pegdown.ast.TableNode currentTableNode
    • currentTableColumn

      protected int currentTableColumn
    • inTableHeader

      protected boolean inTableHeader
    • listMarker

      protected char listMarker
    • listLevel

      protected int listLevel
    • blockQuoteLevel

      protected int blockQuoteLevel
    • autoDetectLanguageType

      protected boolean autoDetectLanguageType
    • rootNode

      protected org.pegdown.ast.RootNode rootNode
  • Constructor Details

    • ToAsciiDocSerializer

      public ToAsciiDocSerializer(org.pegdown.ast.RootNode rootNode, String source)
  • Method Details

    • toAsciiDoc

      public String toAsciiDoc()
    • visit

      public void visit(org.pegdown.ast.RootNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.AbbreviationNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.AnchorLinkNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.AutoLinkNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.BlockQuoteNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.BulletListNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.CodeNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.DefinitionListNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.DefinitionTermNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.DefinitionNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.ExpImageNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.ExpLinkNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.HeaderNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.HtmlBlockNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.InlineHtmlNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.ListItemNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.MailLinkNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.OrderedListNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.ParaNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.QuotedNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.ReferenceNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.RefImageNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.RefLinkNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.SimpleNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.StrongEmphSuperNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.StrikeNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.TableBodyNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.TableCaptionNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.TableCellNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.TableColumnNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.TableHeaderNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.TableNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.TableRowNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.VerbatimNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.WikiLinkNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.TextNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.SpecialTextNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.SuperNode node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visit

      public void visit(org.pegdown.ast.Node node)
      Specified by:
      visit in interface org.pegdown.ast.Visitor
    • visitChildren

      protected void visitChildren(org.pegdown.ast.AbstractNode node)
    • cleanAst

      protected void cleanAst(org.pegdown.ast.Node node)
      Removes superfluous nodes from the tree.
      Parameters:
      node - The node to clean.
    • printNodeSurroundedBy

      protected void printNodeSurroundedBy(org.pegdown.ast.AbstractNode node, String token)
    • printImageTag

      protected void printImageTag(org.pegdown.LinkRenderer.Rendering rendering)
    • printImageTagWithLink

      protected void printImageTagWithLink(org.pegdown.LinkRenderer.Rendering image, org.pegdown.LinkRenderer.Rendering link)
    • printLink

      protected void printLink(org.pegdown.LinkRenderer.Rendering rendering)
    • printChildrenToString

      protected String printChildrenToString(org.pegdown.ast.SuperNode node)
    • normalize

      protected String normalize(String string)
    • normalizeWhitelines

      protected String normalizeWhitelines(String text)
    • printTextWithQuotesIfNeeded

      protected void printTextWithQuotesIfNeeded(org.pegdown.Printer p, String text)
    • printWithAbbreviations

      protected void printWithAbbreviations(String string)
    • findParentNode

      protected org.pegdown.ast.Node findParentNode(org.pegdown.ast.Node target, org.pegdown.ast.Node from)
    • isFirstChild

      protected boolean isFirstChild(org.pegdown.ast.Node parent, org.pegdown.ast.Node child)
    • isListItemText

      protected boolean isListItemText(org.pegdown.ast.Node node)