org.apache.maven.doxia.parser
Class AbstractXmlParser
java.lang.Object
org.apache.maven.doxia.parser.AbstractParser
org.apache.maven.doxia.parser.AbstractXmlParser
- All Implemented Interfaces:
- Markup, XmlMarkup, Parser
public abstract class AbstractXmlParser
- extends AbstractParser
- implements XmlMarkup
An abstract class that defines some convenience methods for XML
parsers.
- Since:
- 1.0
- Version:
- $Id: AbstractXmlParser.java 567665 2007-08-20 12:23:16Z ltheussl $
- Author:
- Vincent Siveton
Fields inherited from interface org.apache.maven.doxia.markup.Markup |
EOL, EQUAL, GREATER_THAN, LEFT_CURLY_BRACKET, LEFT_SQUARE_BRACKET, LESS_THAN, MINUS, PLUS, QUOTE, RIGHT_CURLY_BRACKET, RIGHT_SQUARE_BRACKET, SLASH, SPACE, STAR |
Method Summary |
int |
getType()
The parser type value could be Parser.UNKNOWN_TYPE , Parser.TXT_TYPE or
Parser.XML_TYPE . |
protected abstract void |
handleEndTag(org.codehaus.plexus.util.xml.pull.XmlPullParser parser,
org.apache.maven.doxia.sink.Sink sink)
Goes through the possible end tags. |
protected abstract void |
handleStartTag(org.codehaus.plexus.util.xml.pull.XmlPullParser parser,
org.apache.maven.doxia.sink.Sink sink)
Goes through the possible start tags. |
protected abstract void |
handleText(org.codehaus.plexus.util.xml.pull.XmlPullParser parser,
org.apache.maven.doxia.sink.Sink sink)
Handles text events. |
void |
parse(java.io.Reader source,
org.apache.maven.doxia.sink.Sink sink)
Parses the given source model and emits Doxia events into the given sink. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractXmlParser
public AbstractXmlParser()
parse
public void parse(java.io.Reader source,
org.apache.maven.doxia.sink.Sink sink)
throws ParseException
- Parses the given source model and emits Doxia events into the given sink.
- Specified by:
parse
in interface Parser
- Parameters:
source
- A reader that provides the source document.sink
- A sink that consumes the Doxia events.
- Throws:
ParseException
- if the model could not be parsed.
getType
public final int getType()
- The parser type value could be
Parser.UNKNOWN_TYPE
, Parser.TXT_TYPE
or
Parser.XML_TYPE
.
- Specified by:
getType
in interface Parser
- Overrides:
getType
in class AbstractParser
- Returns:
- the type of Parser
handleStartTag
protected abstract void handleStartTag(org.codehaus.plexus.util.xml.pull.XmlPullParser parser,
org.apache.maven.doxia.sink.Sink sink)
throws org.codehaus.plexus.util.xml.pull.XmlPullParserException,
MacroExecutionException
- Goes through the possible start tags.
- Parameters:
parser
- A parser.sink
- the sink to receive the events.
- Throws:
org.codehaus.plexus.util.xml.pull.XmlPullParserException
- if there's a problem parsing the model
MacroExecutionException
- if there's a problem executing a macro
handleEndTag
protected abstract void handleEndTag(org.codehaus.plexus.util.xml.pull.XmlPullParser parser,
org.apache.maven.doxia.sink.Sink sink)
throws org.codehaus.plexus.util.xml.pull.XmlPullParserException,
MacroExecutionException
- Goes through the possible end tags.
- Parameters:
parser
- A parser.sink
- the sink to receive the events.
- Throws:
org.codehaus.plexus.util.xml.pull.XmlPullParserException
- if there's a problem parsing the model
MacroExecutionException
- if there's a problem executing a macro
handleText
protected abstract void handleText(org.codehaus.plexus.util.xml.pull.XmlPullParser parser,
org.apache.maven.doxia.sink.Sink sink)
throws org.codehaus.plexus.util.xml.pull.XmlPullParserException
- Handles text events.
- Parameters:
parser
- A parser.sink
- the sink to receive the events.
- Throws:
org.codehaus.plexus.util.xml.pull.XmlPullParserException
- if there's a problem parsing the model
Copyright © 2002-2010 Apache Software Foundation. All Rights Reserved.