public class DocumentParser extends Object implements ParserState
Modifier and Type | Class and Description |
---|---|
static class |
DocumentParser.BlockPreProcessorDependencies |
static class |
DocumentParser.BlockPreProcessorDependencyStage |
static class |
DocumentParser.CustomBlockParserDependencies |
static class |
DocumentParser.CustomBlockParserDependencyStage |
static class |
DocumentParser.ParagraphPreProcessorDependencies |
static class |
DocumentParser.ParagraphPreProcessorDependencyStage |
Modifier and Type | Field and Description |
---|---|
static InlineParserFactory |
INLINE_PARSER_FACTORY |
Constructor and Description |
---|
DocumentParser(DataHolder options,
List<CustomBlockParserFactory> customBlockParserFactories,
DocumentParser.ParagraphPreProcessorDependencies paragraphPreProcessorDependencies,
DocumentParser.BlockPreProcessorDependencies blockPreProcessorDependencies,
InlineParser inlineParser) |
public static final InlineParserFactory INLINE_PARSER_FACTORY
public DocumentParser(DataHolder options, List<CustomBlockParserFactory> customBlockParserFactories, DocumentParser.ParagraphPreProcessorDependencies paragraphPreProcessorDependencies, DocumentParser.BlockPreProcessorDependencies blockPreProcessorDependencies, InlineParser inlineParser)
public List<BasedSequence> getLineSegments()
ParserState
getLineSegments
in interface ParserState
public void blockParserAdded(BlockParser blockParser)
blockParserAdded
in interface BlockParserTracker
public void blockParserRemoved(BlockParser blockParser)
blockParserRemoved
in interface BlockParserTracker
public void blockAdded(Block node)
blockAdded
in interface BlockTracker
public void blockAddedWithChildren(Block node)
blockAddedWithChildren
in interface BlockTracker
public void blockAddedWithDescendants(Block node)
blockAddedWithDescendants
in interface BlockTracker
public void blockRemoved(Block node)
blockRemoved
in interface BlockTracker
public void blockRemovedWithChildren(Block node)
blockRemovedWithChildren
in interface BlockTracker
public void blockRemovedWithDescendants(Block node)
blockRemovedWithDescendants
in interface BlockTracker
public ParserPhase getParserPhase()
ParserState
getParserPhase
in interface ParserState
ParserPhase
public Parsing getParsing()
getParsing
in interface ParserState
Parsing
public MutableDataHolder getProperties()
getProperties
in interface ParserState
public static List<CustomBlockParserFactory> calculateBlockParserFactories(DataHolder options, List<CustomBlockParserFactory> customBlockParserFactories)
public static DocumentParser.ParagraphPreProcessorDependencies calculateParagraphPreProcessors(DataHolder options, List<ParagraphPreProcessorFactory> blockPreProcessors, InlineParserFactory inlineParserFactory)
public static DocumentParser.BlockPreProcessorDependencies calculateBlockPreProcessors(DataHolder options, List<BlockPreProcessorFactory> blockPreProcessors, InlineParserFactory inlineParserFactory)
public InlineParser getInlineParser()
getInlineParser
in interface ParserState
public Document parse(CharSequence source)
source
- source sequence to parsepublic Document parse(Reader input) throws IOException
IOException
public int getLineNumber()
getLineNumber
in interface ParserState
public int getLineStart()
getLineStart
in interface ParserState
public int getLineEndIndex()
getLineEndIndex
in interface ParserState
public BasedSequence getLine()
getLine
in interface ParserState
public BasedSequence getLineWithEOL()
getLineWithEOL
in interface ParserState
public int getLineEolLength()
getLineEolLength
in interface ParserState
public int getIndex()
getIndex
in interface ParserState
public int getNextNonSpaceIndex()
getNextNonSpaceIndex
in interface ParserState
ParserState.getIndex()
(may be the same) (0-based)public int getColumn()
ParserState
ParserState.getIndex()
. If the line starts with a tab,
followed by text, then the column for the first character of the text is 4 (the index is 1).getColumn
in interface ParserState
public int getIndent()
getIndent
in interface ParserState
ParserState.getColumn()
public boolean isBlank()
isBlank
in interface ParserState
public BlockParser getActiveBlockParser()
getActiveBlockParser
in interface ParserState
public BlockParser getActiveBlockParser(Block node)
getActiveBlockParser
in interface ParserState
node
- block node for which to get the active block parserpublic List<BlockParser> getActiveBlockParsers()
getActiveBlockParsers
in interface ParserState
public boolean endsWithBlankLine(Node block)
ParserState
endsWithBlankLine
in interface ParserState
block
- block to be testedpublic boolean isLastLineBlank(Node node)
ParserState
isLastLineBlank
in interface ParserState
node
- block instance to testCopyright © 2018. All rights reserved.