Package org.apache.maven.doxia.parser
Interface Parser
-
- All Superinterfaces:
LogEnabled
- All Known Implementing Classes:
AbstractParser
,AbstractTextParser
,AbstractXmlParser
,AptParser
,ConfluenceParser
,DocBookParser
,FmlContentParser
,FmlParser
,MarkdownParser
,MarkdownParser.PegDownHtmlParser
,TWikiParser
,XdocParser
,XhtmlBaseParser
,XhtmlParser
public interface Parser extends LogEnabled
A Parser is responsible for parsing any document in a supported front-end format, and emitting the standard Doxia events, which can then be consumed by any Doxia Sink.- Since:
- 1.0
- Version:
- $Id: Parser.java 1726913 2016-01-26 22:01:54Z rfscholte $
- Author:
- Jason van Zyl
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ROLE
The Plexus lookup role.static int
TXT_TYPE
Text parser typestatic int
UNKNOWN_TYPE
Unknown parser typestatic int
XML_TYPE
XML parser type
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getType()
boolean
isEmitComments()
Does the parser emit Doxia comments event when comments found in source?void
parse(java.io.Reader source, Sink sink)
Parses the given source model and emits Doxia events into the given sink.void
parse(java.io.Reader source, Sink sink, java.lang.String reference)
Parses the given source model and emits Doxia events into the given sink.void
setEmitComments(boolean emitComments)
When comments are found in source markup, emit comment Doxia events or just ignore?-
Methods inherited from interface org.apache.maven.doxia.logging.LogEnabled
enableLogging
-
-
-
-
Field Detail
-
ROLE
static final java.lang.String ROLE
The Plexus lookup role.
-
UNKNOWN_TYPE
static final int UNKNOWN_TYPE
Unknown parser type- See Also:
- Constant Field Values
-
TXT_TYPE
static final int TXT_TYPE
Text parser type- See Also:
- Constant Field Values
-
XML_TYPE
static final int XML_TYPE
XML parser type- See Also:
- Constant Field Values
-
-
Method Detail
-
parse
void parse(java.io.Reader source, Sink sink) throws ParseException
Parses the given source model and emits Doxia events into the given sink.- Parameters:
source
- not null reader that provides the source document. You could usenewReader
methods fromReaderFactory
.sink
- A sink that consumes the Doxia events.- Throws:
ParseException
- if the model could not be parsed.
-
parse
void parse(java.io.Reader source, Sink sink, java.lang.String reference) throws ParseException
Parses the given source model and emits Doxia events into the given sink.- Parameters:
source
- not null reader that provides the source document. You could usenewReader
methods fromReaderFactory
.sink
- A sink that consumes the Doxia events.- Throws:
ParseException
- if the model could not be parsed.
-
getType
int getType()
- Returns:
- the type of Parser
-
setEmitComments
void setEmitComments(boolean emitComments)
When comments are found in source markup, emit comment Doxia events or just ignore?- Parameters:
emitComments
-true
(default value) to emit comment Doxia events
-
isEmitComments
boolean isEmitComments()
Does the parser emit Doxia comments event when comments found in source?- Returns:
true
(default value) if comment Doxia events are emitted
-
-