|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object org.attoparser.AbstractAttoHandler org.attoparser.markup.AbstractBasicMarkupAttoHandler org.attoparser.markup.AbstractDetailedMarkupAttoHandler org.attoparser.markup.html.AbstractDetailedNonValidatingHtmlAttoHandler
public abstract class AbstractDetailedNonValidatingHtmlAttoHandler
Constructor Summary | |
---|---|
protected |
AbstractDetailedNonValidatingHtmlAttoHandler(HtmlParsingConfiguration configuration)
|
Method Summary | |
---|---|
void |
handleAttribute(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 |
handleAutoCloseElementEnd(int line,
int col)
Called for signaling the end of an auto-close element, created for balancing an unclosed tag. |
void |
handleAutoCloseElementStart(char[] buffer,
int offset,
int len,
int line,
int col)
Called for signaling the start of an auto-close element (a synthetic close tag), created for balancing an unclosed tag. |
void |
handleCloseElementEnd(int line,
int col)
Called when the end of a close element (a close tag) is found. |
void |
handleCloseElementStart(char[] buffer,
int offset,
int len,
int line,
int col)
Called when the start of a close element (a close tag) is found. |
void |
handleDocumentEnd(long endTimeNanos,
long totalTimeNanos,
int line,
int col,
HtmlParsingConfiguration parsingConfiguration)
|
void |
handleDocumentEnd(long endTimeNanos,
long totalTimeNanos,
int line,
int col,
MarkupParsingConfiguration markupParsingConfiguration)
Called when document parsing ends. |
void |
handleDocumentStart(long startTimeNanos,
int line,
int col,
HtmlParsingConfiguration parsingConfiguration)
|
void |
handleDocumentStart(long startTimeNanos,
int line,
int col,
MarkupParsingConfiguration markupParsingConfiguration)
Called when document parsing starts. |
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 |
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 |
handleHtmlInnerWhiteSpace(char[] buffer,
int offset,
int len,
int line,
int col)
Called when an amount of white space is found inside an element. |
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. |
void |
handleInnerWhiteSpace(char[] buffer,
int offset,
int len,
int line,
int col)
Called when an amount of white space is found inside an element. |
void |
handleOpenElementEnd(int line,
int col)
Called when the end of an open element (an open tag) is found. |
void |
handleOpenElementStart(char[] buffer,
int offset,
int len,
int line,
int col)
Called when an open element (an open tag) is found. |
void |
handleStandaloneElementEnd(int line,
int col)
Called when the end of a standalone element (a minimized tag) is found |
void |
handleStandaloneElementStart(char[] buffer,
int offset,
int len,
int line,
int col)
Called when a standalone element (a minimized tag) is found. |
void |
handleUnmatchedCloseElementEnd(int line,
int col)
Called when the end of an unmatched close element (close tag) is found. |
void |
handleUnmatchedCloseElementStart(char[] buffer,
int offset,
int len,
int line,
int col)
Called when the start of an unmatched close element (close tag) is found. |
Methods inherited from class org.attoparser.markup.AbstractDetailedMarkupAttoHandler |
---|
handleCloseElement, handleDocType, handleDocType, handleDocumentEnd, handleDocumentStart, handleOpenElement, handleStandaloneElement, handleXmlDeclaration, handleXmlDeclarationDetail |
Methods inherited from class org.attoparser.markup.AbstractBasicMarkupAttoHandler |
---|
handleCDATASection, handleComment, handleProcessingInstruction, handleStructure |
Methods inherited from class org.attoparser.AbstractAttoHandler |
---|
getEndTimeNanos, getStartTimeNanos, getTotalTimeNanos, handleDocumentEnd, handleDocumentStart, handleText |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AbstractDetailedNonValidatingHtmlAttoHandler(HtmlParsingConfiguration configuration)
Method Detail |
---|
public final void handleDocumentStart(long startTimeNanos, int line, int col, MarkupParsingConfiguration markupParsingConfiguration) throws AttoParseException
AbstractDetailedMarkupAttoHandler
Called when document parsing starts.
handleDocumentStart
in class AbstractDetailedMarkupAttoHandler
startTimeNanos
- the starting time, in nanoseconds.markupParsingConfiguration
- the document restrictions being applied.
AttoParseException
public final void handleDocumentEnd(long endTimeNanos, long totalTimeNanos, int line, int col, MarkupParsingConfiguration markupParsingConfiguration) throws AttoParseException
AbstractDetailedMarkupAttoHandler
Called when document parsing ends.
handleDocumentEnd
in class AbstractDetailedMarkupAttoHandler
endTimeNanos
- the parsing end time, in nanoseconds.totalTimeNanos
- the difference between parsing start and end times.markupParsingConfiguration
- the document restrictions being applied.
AttoParseException
public final void handleStandaloneElementStart(char[] buffer, int offset, int len, int line, int col) throws AttoParseException
IDetailedElementHandling
Called when a standalone element (a minimized tag) is found. The name of the element is also reported.
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.
handleStandaloneElementStart
in interface IDetailedElementHandling
handleStandaloneElementStart
in class AbstractDetailedMarkupAttoHandler
buffer
- the document buffer (not copied)offset
- the offset (position in buffer) where the element name appears.len
- 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.
AttoParseException
public final void handleStandaloneElementEnd(int line, int col) throws AttoParseException
IDetailedElementHandling
Called when the end of a standalone element (a minimized tag) is found
handleStandaloneElementEnd
in interface IDetailedElementHandling
handleStandaloneElementEnd
in class AbstractDetailedMarkupAttoHandler
line
- the line in the original document where the element ending structure appears.col
- the column in the original document where the element ending structure appears.
AttoParseException
public final void handleOpenElementStart(char[] buffer, int offset, int len, int line, int col) throws AttoParseException
IDetailedElementHandling
Called when an open element (an open tag) is found. The name of the element is also reported.
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.
handleOpenElementStart
in interface IDetailedElementHandling
handleOpenElementStart
in class AbstractDetailedMarkupAttoHandler
buffer
- the document buffer (not copied)offset
- the offset (position in buffer) where the element name appears.len
- 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.
AttoParseException
public final void handleOpenElementEnd(int line, int col) throws AttoParseException
IDetailedElementHandling
Called when the end of an open element (an open tag) is found.
handleOpenElementEnd
in interface IDetailedElementHandling
handleOpenElementEnd
in class AbstractDetailedMarkupAttoHandler
line
- the line in the original document where the element ending structure appears.col
- the column in the original document where the element ending structure appears.
AttoParseException
public final void handleCloseElementStart(char[] buffer, int offset, int len, int line, int col) throws AttoParseException
IDetailedElementHandling
Called when the start of a close element (a close tag) is found. The name of the element is also reported.
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.
handleCloseElementStart
in interface IDetailedElementHandling
handleCloseElementStart
in class AbstractDetailedMarkupAttoHandler
buffer
- the document buffer (not copied)offset
- the offset (position in buffer) where the element name appears.len
- 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.
AttoParseException
public final void handleCloseElementEnd(int line, int col) throws AttoParseException
IDetailedElementHandling
Called when the end of a close element (a close tag) is found.
handleCloseElementEnd
in interface IDetailedElementHandling
handleCloseElementEnd
in class AbstractDetailedMarkupAttoHandler
line
- the line in the original document where the element ending structure appears.col
- the column in the original document where the element ending structure appears.
AttoParseException
public final void handleAutoCloseElementStart(char[] buffer, int offset, int len, int line, int col) throws AttoParseException
IDetailedElementHandling
Called for signaling the start of an auto-close element (a synthetic close tag), created for balancing an unclosed tag. The name of the element is also reported.
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.
handleAutoCloseElementStart
in interface IDetailedElementHandling
handleAutoCloseElementStart
in class AbstractDetailedMarkupAttoHandler
buffer
- the document buffer (not copied)offset
- the offset (position in buffer) where the element name appears.len
- 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.
AttoParseException
public final void handleAutoCloseElementEnd(int line, int col) throws AttoParseException
IDetailedElementHandling
Called for signaling the end of an auto-close element, created for balancing an unclosed tag.
handleAutoCloseElementEnd
in interface IDetailedElementHandling
handleAutoCloseElementEnd
in class AbstractDetailedMarkupAttoHandler
line
- the line in the original document where the element ending structure appears.col
- the column in the original document where the element ending structure appears.
AttoParseException
public final void handleUnmatchedCloseElementStart(char[] buffer, int offset, int len, int line, int col) throws AttoParseException
IDetailedElementHandling
Called when the start of an unmatched close element (close tag) is found. The name of the element is also reported.
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.
handleUnmatchedCloseElementStart
in interface IDetailedElementHandling
handleUnmatchedCloseElementStart
in class AbstractDetailedMarkupAttoHandler
buffer
- the document buffer (not copied)offset
- the offset (position in buffer) where the element name appears.len
- 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.
AttoParseException
public final void handleUnmatchedCloseElementEnd(int line, int col) throws AttoParseException
IDetailedElementHandling
Called when the end of an unmatched close element (close tag) is found.
handleUnmatchedCloseElementEnd
in interface IDetailedElementHandling
handleUnmatchedCloseElementEnd
in class AbstractDetailedMarkupAttoHandler
line
- the line in the original document where the element ending structure appears.col
- the column in the original document where the element ending structure appears.
AttoParseException
public final void handleAttribute(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
IAttributeSequenceHandling
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.
handleAttribute
in interface IAttributeSequenceHandling
handleAttribute
in class AbstractDetailedMarkupAttoHandler
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.
AttoParseException
public final void handleInnerWhiteSpace(char[] buffer, int offset, int len, int line, int col) throws AttoParseException
IAttributeSequenceHandling
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.
handleInnerWhiteSpace
in interface IAttributeSequenceHandling
handleInnerWhiteSpace
in class AbstractDetailedMarkupAttoHandler
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.
AttoParseException
public void handleDocumentStart(long startTimeNanos, int line, int col, HtmlParsingConfiguration parsingConfiguration) throws AttoParseException
AttoParseException
public void handleDocumentEnd(long endTimeNanos, long totalTimeNanos, int line, int col, HtmlParsingConfiguration parsingConfiguration) throws AttoParseException
AttoParseException
public void handleHtmlStandaloneElementStart(IHtmlElement element, boolean minimized, char[] buffer, int nameOffset, int nameLen, int line, int col) throws AttoParseException
IDetailedHtmlElementHandling
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.
handleHtmlStandaloneElementStart
in interface IDetailedHtmlElementHandling
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.
AttoParseException
public void handleHtmlStandaloneElementEnd(IHtmlElement element, boolean minimized, int line, int col) throws AttoParseException
IDetailedHtmlElementHandling
Called when the end of a standalone element is found.
handleHtmlStandaloneElementEnd
in interface IDetailedHtmlElementHandling
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.
AttoParseException
public void handleHtmlOpenElementStart(IHtmlElement element, char[] buffer, int nameOffset, int nameLen, int line, int col) throws AttoParseException
IDetailedHtmlElementHandling
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.
handleHtmlOpenElementStart
in interface IDetailedHtmlElementHandling
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.
AttoParseException
public void handleHtmlOpenElementEnd(IHtmlElement element, int line, int col) throws AttoParseException
IDetailedHtmlElementHandling
Called when the end of an open element (an open tag) is found.
handleHtmlOpenElementEnd
in interface IDetailedHtmlElementHandling
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.
AttoParseException
public void handleHtmlCloseElementStart(IHtmlElement element, char[] buffer, int nameOffset, int nameLen, int line, int col) throws AttoParseException
IDetailedHtmlElementHandling
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.
handleHtmlCloseElementStart
in interface IDetailedHtmlElementHandling
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.
AttoParseException
public void handleHtmlCloseElementEnd(IHtmlElement element, int line, int col) throws AttoParseException
IDetailedHtmlElementHandling
Called when the end of a close element (a close tag) is found.
handleHtmlCloseElementEnd
in interface IDetailedHtmlElementHandling
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.
AttoParseException
public 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
IHtmlAttributeSequenceHandling
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.
handleHtmlAttribute
in interface IHtmlAttributeSequenceHandling
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.
AttoParseException
public void handleHtmlInnerWhiteSpace(char[] buffer, int offset, int len, int line, int col) throws AttoParseException
IHtmlAttributeSequenceHandling
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.
handleHtmlInnerWhiteSpace
in interface IHtmlAttributeSequenceHandling
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.
AttoParseException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |