org.attoparser.markup
Class MarkupAttoParser
Object
org.attoparser.AbstractAttoParser
org.attoparser.AbstractBufferedAttoParser
org.attoparser.markup.MarkupAttoParser
- All Implemented Interfaces:
- IAttoParser
public final class MarkupAttoParser
- extends AbstractBufferedAttoParser
Default implementation of the IAttoParser interface, able of
parsing XML and HTML markup.
This parser reports as structures:
- Tags (a.k.a. elements): <body>, <img/>,
<div class="content">, etc.
- Comments: <!-- this is a comment -->
- CDATA sections: <![CDATA[ ... ]]>
- DOCTYPE clauses: <!DOCTYPE html>
- XML Declarations: <?xml version="1.0"?>
- Processing Instructions: <?xsl-stylesheet ...?>
This parser class is thread-safe. But take into account that, usually, the
IAttoHandler implementations passed to parsers for event handling are not.
- Since:
- 1.0
- Author:
- Daniel Fernández
| Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MarkupAttoParser
public MarkupAttoParser()
Creates a new instance of this parser.
parseBuffer
protected final AbstractBufferedAttoParser.BufferParseResult parseBuffer(char[] buffer,
int offset,
int len,
IAttoHandler handler,
int line,
int col)
throws AttoParseException
- Description copied from class:
AbstractBufferedAttoParser
Parse a buffer segment and return a AbstractBufferedAttoParser.BufferParseResult reporting
the results of this parsing.
- Specified by:
parseBuffer in class AbstractBufferedAttoParser
- Parameters:
buffer - the document buffer.offset - the offset (in the document buffer) of the segment to be parsed.len - the length (in chars) of the segment to be parsed.handler - the IAttoHandler implementation to be used for reporting events.line - the line of the first position (offset) in buffer.col - the column of the first position (offset) in buffer.
- Returns:
- a
AbstractBufferedAttoParser.BufferParseResult reporting the parsing status.
- Throws:
AttoParseException - if an error occurs.
Copyright © 2012 The ATTOPARSER team. All Rights Reserved.