org.attoparser.markup.html
Interface IDetailedHtmlElementHandling

All Superinterfaces:
IHtmlAttributeSequenceHandling
All Known Implementing Classes:
AbstractDetailedNonValidatingHtmlAttoHandler, AbstractStandardNonValidatingHtmlAttoHandler, HtmlCodeDisplayAttoHandler, TextTracingDetailedHtmlAttoHandler, TracingDetailedHtmlAttoHandler

public interface IDetailedHtmlElementHandling
extends IHtmlAttributeSequenceHandling

Common interface for all handlers that support reporting detailed HTML parsing events.

Since:
1.1
Author:
Daniel Fernández

Method Summary
 void handleHtmlCloseElementEnd(IHtmlElement element, int line, int col)
           Called when the end of a close element (a close tag) is found.
 void handleHtmlCloseElementStart(IHtmlElement element, char[] buffer, int nameOffset, int nameLen, int line, int col)
           Called when the start of a close element (a close tag) is found.
 void handleHtmlOpenElementEnd(IHtmlElement element, int line, int col)
           Called when the end of an open element (an open tag) is found.
 void handleHtmlOpenElementStart(IHtmlElement element, char[] buffer, int nameOffset, int nameLen, int line, int col)
           Called when the start of an open element (an open tag) is found.
 void handleHtmlStandaloneElementEnd(IHtmlElement element, boolean minimized, int line, int col)
           Called when the end of a standalone element is found.
 void handleHtmlStandaloneElementStart(IHtmlElement element, boolean minimized, char[] buffer, int nameOffset, int nameLen, int line, int col)
           Called when the start of a standalone element is found.
 
Methods inherited from interface org.attoparser.markup.html.IHtmlAttributeSequenceHandling
handleHtmlAttribute, handleHtmlInnerWhiteSpace
 

Method Detail

handleHtmlStandaloneElementStart

void handleHtmlStandaloneElementStart(IHtmlElement element,
                                      boolean minimized,
                                      char[] buffer,
                                      int nameOffset,
                                      int nameLen,
                                      int line,
                                      int col)
                                      throws AttoParseException

Called when the start of a standalone element is found.

A standalone element can be either a minimized tag or not. For example: <img src="..." /> is minimized (self-closed), as opposed to <img src="..."> (non-minimized, perfectly valid from the HTML but not from the XML or XHTML standpoints).

Artifacts are reported using the document buffer directly, and this buffer should not be considered to be immutable, so reported structures should be copied if they need to be stored (either by copying len chars from the buffer char[] starting in offset or by creating a String from it using the same specification).

Implementations of this handler should never modify the document buffer.

Parameters:
element - the IHtmlElement element object representing the corresponding HTML element.
minimized - whether the tag representing this element is minimized (self-closed) or not.
buffer - the document buffer (not copied).
nameOffset - the offset (position in buffer) where the element name appears.
nameLen - the length (in chars) of the element name.
line - the line in the original document where this artifact starts.
col - the column in the original document where this artifact starts.
Throws:
AttoParseException

handleHtmlStandaloneElementEnd

void handleHtmlStandaloneElementEnd(IHtmlElement element,
                                    boolean minimized,
                                    int line,
                                    int col)
                                    throws AttoParseException

Called when the end of a standalone element is found.

Parameters:
element - the IHtmlElement element object representing the corresponding HTML element.
minimized - whether the tag representing this element is minimized (self-closed) or not.
line - the line in the original document where this artifact starts.
col - the column in the original document where this artifact starts.
Throws:
AttoParseException

handleHtmlOpenElementStart

void handleHtmlOpenElementStart(IHtmlElement element,
                                char[] buffer,
                                int nameOffset,
                                int nameLen,
                                int line,
                                int col)
                                throws AttoParseException

Called when the start of an open element (an open tag) is found.

Artifacts are reported using the document buffer directly, and this buffer should not be considered to be immutable, so reported structures should be copied if they need to be stored (either by copying len chars from the buffer char[] starting in offset or by creating a String from it using the same specification).

Implementations of this handler should never modify the document buffer.

Parameters:
element - the IHtmlElement element object representing the corresponding HTML element.
buffer - the document buffer (not copied).
nameOffset - the offset (position in buffer) where the element name appears.
nameLen - the length (in chars) of the element name.
line - the line in the original document where this artifact starts.
col - the column in the original document where this artifact starts.
Throws:
AttoParseException

handleHtmlOpenElementEnd

void handleHtmlOpenElementEnd(IHtmlElement element,
                              int line,
                              int col)
                              throws AttoParseException

Called when the end of an open element (an open tag) is found.

Parameters:
element - the IHtmlElement element object representing the corresponding HTML element.
line - the line in the original document where this artifact starts.
col - the column in the original document where this artifact starts.
Throws:
AttoParseException

handleHtmlCloseElementStart

void handleHtmlCloseElementStart(IHtmlElement element,
                                 char[] buffer,
                                 int nameOffset,
                                 int nameLen,
                                 int line,
                                 int col)
                                 throws AttoParseException

Called when the start of a close element (a close tag) is found.

Artifacts are reported using the document buffer directly, and this buffer should not be considered to be immutable, so reported structures should be copied if they need to be stored (either by copying len chars from the buffer char[] starting in offset or by creating a String from it using the same specification).

Implementations of this handler should never modify the document buffer.

Parameters:
element - the IHtmlElement element object representing the corresponding HTML element.
buffer - the document buffer (not copied).
nameOffset - the offset (position in buffer) where the element name appears.
nameLen - the length (in chars) of the element name.
line - the line in the original document where this artifact starts.
col - the column in the original document where this artifact starts.
Throws:
AttoParseException

handleHtmlCloseElementEnd

void handleHtmlCloseElementEnd(IHtmlElement element,
                               int line,
                               int col)
                               throws AttoParseException

Called when the end of a close element (a close tag) is found.

Parameters:
element - the IHtmlElement element object representing the corresponding HTML element.
line - the line in the original document where this artifact starts.
col - the column in the original document where this artifact starts.
Throws:
AttoParseException


Copyright © 2013 The ATTOPARSER team. All Rights Reserved.