org.apache.maven.doxia.parser
Interface Parser

All Superinterfaces:
LogEnabled
All Known Implementing Classes:
AbstractParser, AbstractTextParser, AbstractXmlParser, XhtmlBaseParser

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 746978 2009-02-23 12:20:33Z vsiveton $
Author:
Jason van Zyl

Field Summary
static String ROLE
          The Plexus lookup role.
static int TXT_TYPE
          Text parser type
static int UNKNOWN_TYPE
          Unknown parser type
static int XML_TYPE
          XML parser type
 
Method Summary
 int getType()
          The parser type value could be UNKNOWN_TYPE, TXT_TYPE or XML_TYPE.
 void parse(Reader source, Sink sink)
          Parses the given source model and emits Doxia events into the given sink.
 
Methods inherited from interface org.apache.maven.doxia.logging.LogEnabled
enableLogging
 

Field Detail

ROLE

static final 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(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 use newReader methods from ReaderFactory.
sink - A sink that consumes the Doxia events.
Throws:
ParseException - if the model could not be parsed.

getType

int getType()
The parser type value could be UNKNOWN_TYPE, TXT_TYPE or XML_TYPE.

Returns:
the type of Parser


Copyright © 2005-2012 The Apache Software Foundation. All Rights Reserved.