org.attoparser.markup.html
Interface IHtmlAttributeSequenceHandling

All Known Subinterfaces:
IDetailedHtmlElementHandling
All Known Implementing Classes:
AbstractDetailedNonValidatingHtmlAttoHandler, AbstractStandardNonValidatingHtmlAttoHandler, HtmlCodeDisplayAttoHandler, TracingDetailedHtmlAttoHandler

public interface IHtmlAttributeSequenceHandling

Handler feature interface to be implemented by IAttoHandler implementations that offer detailed reporting of HTML attributes.

Since:
1.1
Author:
Daniel Fernández

Method Summary
 void handleHtmlAttribute(char[] buffer, int nameOffset, int nameLen, int nameLine, int nameCol, int operatorOffset, int operatorLen, int operatorLine, int operatorCol, int valueContentOffset, int valueContentLen, int valueOuterOffset, int valueOuterLen, int valueLine, int valueCol)
           Called when an attribute is found.
 void handleHtmlInnerWhiteSpace(char[] buffer, int offset, int len, int line, int col)
           Called when an amount of white space is found inside an element.
 

Method Detail

handleHtmlAttribute

void handleHtmlAttribute(char[] buffer,
                         int nameOffset,
                         int nameLen,
                         int nameLine,
                         int nameCol,
                         int operatorOffset,
                         int operatorLen,
                         int operatorLine,
                         int operatorCol,
                         int valueContentOffset,
                         int valueContentLen,
                         int valueOuterOffset,
                         int valueOuterLen,
                         int valueLine,
                         int valueCol)
                         throws AttoParseException

Called when an attribute is found.

Three [offset, len] pairs are provided for three partitions (name, operator, valueContent and valueOuter):

class="basic_column"
[NAM]* [VALUECONTE]| (*) = [OPERATOR]
|     [VALUEOUTER--]
[OUTER-------------]

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:
buffer - the document buffer (not copied)
nameOffset - offset for the name partition.
nameLen - length of the name partition.
nameLine - the line in the original document where the name partition starts.
nameCol - the column in the original document where the name partition starts.
operatorOffset - offset for the operator partition.
operatorLen - length of the operator partition.
operatorLine - the line in the original document where the operator partition starts.
operatorCol - the column in the original document where the operator partition starts.
valueContentOffset - offset for the valueContent partition.
valueContentLen - length of the valueContent partition.
valueOuterOffset - offset for the valueOuter partition.
valueOuterLen - length of the valueOuter partition.
valueLine - the line in the original document where the value (outer) partition starts.
valueCol - the column in the original document where the value (outer) partition starts.
Throws:
AttoParseException

handleHtmlInnerWhiteSpace

void handleHtmlInnerWhiteSpace(char[] buffer,
                               int offset,
                               int len,
                               int line,
                               int col)
                               throws AttoParseException

Called when an amount of white space is found inside an element.

This attribute separators can contain any amount of whitespace, including line feeds:

<div id="main"        class="basic_column">
              [ATTSEP]

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:
buffer - the document buffer (not copied)
offset - offset for the artifact.
len - length of the artifact.
line - the line in the original document where the artifact starts.
col - the column in the original document where the artifact starts.
Throws:
AttoParseException


Copyright © 2012 The ATTOPARSER team. All Rights Reserved.