org.attoparser
Interface IAttoParser

All Known Implementing Classes:
AbstractAttoParser, AbstractBufferedAttoParser, MarkupAttoParser

public interface IAttoParser

Common interface for all attoparser instances. Default implementation is MarkupAttoParser.

Attoparser implementations work as SAX-style parsers that need an attohandler instance for handling parsing events. Depending on the desired level of detail in these events, several handler abstract and concrete implementations are offered out-of-the-box:

Since:
1.0
Author:
Daniel Fernández

Method Summary
 void parse(char[] document, IAttoHandler handler)
           Parse a document using the specified IAttoHandler.
 void parse(char[] document, int offset, int len, IAttoHandler handler)
           Parse a document using the specified IAttoHandler.
 void parse(Reader reader, IAttoHandler handler)
           Parse a document using the specified IAttoHandler.
 void parse(String document, IAttoHandler handler)
           Parse a document using the specified IAttoHandler.
 

Method Detail

parse

void parse(String document,
           IAttoHandler handler)
           throws AttoParseException

Parse a document using the specified IAttoHandler.

Parameters:
document - the document to be parsed, as a String.
handler - the handler to be used, an IAttoHandler implementation.
Throws:
AttoParseException - if the document cannot be parsed.

parse

void parse(char[] document,
           IAttoHandler handler)
           throws AttoParseException

Parse a document using the specified IAttoHandler.

Parameters:
document - the document to be parsed, as a char[].
handler - the handler to be used, an IAttoHandler implementation.
Throws:
AttoParseException - if the document cannot be parsed.

parse

void parse(char[] document,
           int offset,
           int len,
           IAttoHandler handler)
           throws AttoParseException

Parse a document using the specified IAttoHandler.

Parameters:
document - the document to be parsed, as a char[].
offset - the offset to be applied on the char[] document to determine the start of the document contents.
len - the length (in chars) of the document stored in the char[].
handler - the handler to be used, an IAttoHandler implementation.
Throws:
AttoParseException - if the document cannot be parsed.

parse

void parse(Reader reader,
           IAttoHandler handler)
           throws AttoParseException

Parse a document using the specified IAttoHandler.

Implementations of this interface must close the provided Reader object after parsing.

Parameters:
reader - a Reader on the document.
handler - the handler to be used, an IAttoHandler implementation.
Throws:
AttoParseException - if the document cannot be parsed.


Copyright © 2012 The ATTOPARSER team. All Rights Reserved.