Package org.xwiki.rendering.parser
Interface StreamParser
-
@Role public interface StreamParser
Streaming based parser. Instead of returning a resulting XDOM it send events during the parsing.- Since:
- 2.1M1
- Version:
- $Id: 453e71a1bea5c2d96055b7fee08c486a6844d042 $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Syntax
getSyntax()
void
parse(Reader source, Listener listener)
default void
parse(Reader source, Listener listener, IdGenerator idGenerator)
-
-
-
Method Detail
-
getSyntax
Syntax getSyntax()
- Returns:
- the wiki syntax the parser is implementing
-
parse
void parse(Reader source, Listener listener) throws ParseException
- Parameters:
source
- the content to parselistener
- receive event for each element- Throws:
ParseException
- if the source cannot be read or an unexpected error happens during the parsing. Parsers should be written to not generate any error as much as possible.
-
parse
@Unstable default void parse(Reader source, Listener listener, IdGenerator idGenerator) throws ParseException
- Parameters:
source
- the content to parselistener
- the listener that receives an event for each elementidGenerator
- the id generator to use for automatically generating ids during parsing- Throws:
ParseException
- if the source cannot be read or an unexpected error happens during the parsing. Parsers should be written to not generate any error as much as possible.- Since:
- 14.2RC1
-
-