Package org.apache.maven.doxia
Class DefaultDoxia
- java.lang.Object
-
- org.codehaus.plexus.logging.AbstractLogEnabled
-
- org.apache.maven.doxia.DefaultDoxia
-
- All Implemented Interfaces:
Doxia
,org.codehaus.plexus.logging.LogEnabled
@Component(role=Doxia.class) public class DefaultDoxia extends org.codehaus.plexus.logging.AbstractLogEnabled implements Doxia
Simple implementation of the Doxia interface: uses a ParserManager to lookup a parser.- Since:
- 1.0
- Author:
- Jason van Zyl
-
-
Constructor Summary
Constructors Constructor Description DefaultDoxia()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Parser
getParser(java.lang.String parserId)
Return a parser for the givenparserId
.void
parse(java.io.Reader source, java.lang.String parserId, org.apache.maven.doxia.sink.Sink sink)
Parses the given source model using a parser with given id, and emits Doxia events into the given sink.
-
-
-
Method Detail
-
parse
public void parse(java.io.Reader source, java.lang.String parserId, org.apache.maven.doxia.sink.Sink sink) throws ParserNotFoundException, ParseException
Parses the given source model using a parser with given id, and emits Doxia events into the given sink.- Specified by:
parse
in interfaceDoxia
- Parameters:
source
- not null reader that provides the source document. You could usenewReader
methods fromReaderFactory
.parserId
- Identifier for the parser to use.sink
- A sink that consumes the Doxia events.- Throws:
ParserNotFoundException
- if no parser could be found for the given id.ParseException
- if the model could not be parsed.
-
getParser
public Parser getParser(java.lang.String parserId) throws ParserNotFoundException
Return a parser for the givenparserId
.- Specified by:
getParser
in interfaceDoxia
- Parameters:
parserId
- Identifier for the parser to use.- Returns:
- the parser defining by parserId.
- Throws:
ParserNotFoundException
- if no parser could be found for the given id.
-
-