|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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:
AbstractAttoHandler
: basic implementation only differentiating
between text and structuresAbstractBasicMarkupAttoHandler
: markup-specialized
(XML and HTML) abstract handler able to differentiate among different
types of markup structures: Elements, comments, CDATA, DOCTYPE, etc.AbstractDetailedMarkupAttoHandler
: markup-specialized
(XML and HTML) abstract handler able not only to differentiate among different
types of markup structures, but also of reporting lowel-level detail inside
elements (name, attributes, inner whitespace) and DOCTYPE clauses.AbstractStandardMarkupAttoHandler
: higher-level
markup-specialized (XML and HTML) abstract handler that offers an interface
more similar to the Standard SAX ContentHandlers (use of Strings instead of
char[]'s, attribute maps, etc).AbstractDetailedXmlAttoHandler
: XML-specialized
abstract handler equivalent to AbstractDetailedMarkupAttoHandler
but only allowing XML markup.AbstractStandardXmlAttoHandler
: XML-specialized
abstract handler equivalent to AbstractStandardMarkupAttoHandler
but only allowing XML markup.DOMXmlAttoHandler
: handler implementation
(non-abstract) for building an attoDOM tree (DOM node tres based on classes
from the org.attoparser.markup.dom package) from XML markup.
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 |
---|
void parse(String document, IAttoHandler handler) throws AttoParseException
Parse a document using the specified IAttoHandler
.
document
- the document to be parsed, as a String.handler
- the handler to be used, an IAttoHandler
implementation.
AttoParseException
- if the document cannot be parsed.void parse(char[] document, IAttoHandler handler) throws AttoParseException
Parse a document using the specified IAttoHandler
.
document
- the document to be parsed, as a char[].handler
- the handler to be used, an IAttoHandler
implementation.
AttoParseException
- if the document cannot be parsed.void parse(char[] document, int offset, int len, IAttoHandler handler) throws AttoParseException
Parse a document using the specified IAttoHandler
.
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.
AttoParseException
- if the document cannot be parsed.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.
reader
- a Reader on the document.handler
- the handler to be used, an IAttoHandler
implementation.
AttoParseException
- if the document cannot be parsed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |