Package org.commonmark.internal.inline
Class EntityInlineParser
- java.lang.Object
-
- org.commonmark.internal.inline.EntityInlineParser
-
- All Implemented Interfaces:
InlineContentParser
public class EntityInlineParser extends java.lang.Object implements InlineContentParser
Attempts to parse an HTML entity or numeric character reference.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEntityInlineParser.Factory
-
Field Summary
Fields Modifier and Type Field Description private static AsciiMatcherdecprivate static AsciiMatcherentityContinueprivate static AsciiMatcherentityStartprivate static AsciiMatcherhex
-
Constructor Summary
Constructors Constructor Description EntityInlineParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private ParsedInlineentity(Scanner scanner, Position start)ParsedInlinetryParse(InlineParserState inlineParserState)Try to parse inline content starting from the current position.
-
-
-
Field Detail
-
hex
private static final AsciiMatcher hex
-
dec
private static final AsciiMatcher dec
-
entityStart
private static final AsciiMatcher entityStart
-
entityContinue
private static final AsciiMatcher entityContinue
-
-
Method Detail
-
tryParse
public ParsedInline tryParse(InlineParserState inlineParserState)
Description copied from interface:InlineContentParserTry to parse inline content starting from the current position. Note that the character at the current position is one ofInlineContentParserFactory.getTriggerCharacters()of the factory that created this parser.For a given inline content snippet that is being parsed, this method can be called multiple times: each time a trigger character is encountered.
- Specified by:
tryParsein interfaceInlineContentParser- Parameters:
inlineParserState- the current state of the inline parser- Returns:
- the result of parsing; can indicate that this parser is not interested, or that parsing was successful
-
entity
private ParsedInline entity(Scanner scanner, Position start)
-
-