All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.vladsch.flexmark.formatter.NodeFormatterSubContext Maven / Gradle / Ivy

There is a newer version: 0.50.50
Show newest version
package com.vladsch.flexmark.formatter;

import com.vladsch.flexmark.util.ast.Node;

import java.io.IOException;

public abstract class NodeFormatterSubContext implements NodeFormatterContext {
    final protected MarkdownWriter markdown;
    Node renderingNode;

    public NodeFormatterSubContext(MarkdownWriter markdown) {
        this.markdown = markdown;
        this.renderingNode = null;
    }

    public Node getRenderingNode() {
        return renderingNode;
    }

    public void setRenderingNode(final Node renderingNode) {
        this.renderingNode = renderingNode;
    }

    public MarkdownWriter getMarkdown() {
        return markdown;
    }

    public void flushTo(Appendable out, int maxBlankLines) {
        markdown.line();
        try {
            markdown.appendTo(out, maxBlankLines);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy