Interface IElementHandler
-
- All Superinterfaces:
IAttributeSequenceHandler
- All Known Subinterfaces:
IMarkupHandler
- All Known Implementing Classes:
AbstractChainedMarkupHandler
,AbstractMarkupHandler
,AttributeSelectionMarkingMarkupHandler
,BlockSelectorMarkupHandler
,DiscardMarkupHandler
,DOMBuilderMarkupHandler
,DuplicateMarkupHandler
,HtmlMarkupHandler
,MarkupEventProcessorHandler
,MinimizeHtmlMarkupHandler
,NodeSelectorMarkupHandler
,OutputMarkupHandler
,PrettyHtmlMarkupHandler
,SimplifierMarkupHandler
,TextOutputMarkupHandler
,TraceBuilderMarkupHandler
public interface IElementHandler extends IAttributeSequenceHandler
Interface to be implemented by all handlers capable of receiving events about elements.
Events in this interface are a part of the
IMarkupHandler
interface, the main handling interface in AttoParser.- Since:
- 2.0.0
- See Also:
IMarkupHandler
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
handleAutoCloseElementEnd(char[] buffer, int nameOffset, int nameLen, 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 nameOffset, int nameLen, 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
handleAutoOpenElementEnd(char[] buffer, int nameOffset, int nameLen, int line, int col)
Called for signaling the end of an auto-open element (a synthetic open tag), created for adapting parsed markup to a specification such as, for example, HTML5.void
handleAutoOpenElementStart(char[] buffer, int nameOffset, int nameLen, int line, int col)
Called for signaling the start of an auto-open element (a synthetic open tag), created for adapting parsed markup to a specification such as, for example, HTML5.void
handleCloseElementEnd(char[] buffer, int nameOffset, int nameLen, int line, int col)
Called when the end of a close element (a close tag) is found.void
handleCloseElementStart(char[] buffer, int nameOffset, int nameLen, int line, int col)
Called when the start of a close element (a close tag) is found.void
handleOpenElementEnd(char[] buffer, int nameOffset, int nameLen, int line, int col)
Called when the end of an open element (an open tag) is found.void
handleOpenElementStart(char[] buffer, int nameOffset, int nameLen, int line, int col)
Called when an open element (an open tag) is found.void
handleStandaloneElementEnd(char[] buffer, int nameOffset, int nameLen, boolean minimized, int line, int col)
Called when the end of a standalone element (an element with no closing tag) is foundvoid
handleStandaloneElementStart(char[] buffer, int nameOffset, int nameLen, boolean minimized, int line, int col)
Called when a standalone element (an element with no closing tag) is found.void
handleUnmatchedCloseElementEnd(char[] buffer, int nameOffset, int nameLen, int line, int col)
Called when the end of an unmatched close element (close tag) is found.void
handleUnmatchedCloseElementStart(char[] buffer, int nameOffset, int nameLen, int line, int col)
Called when the start of an unmatched close element (close tag) is found.-
Methods inherited from interface org.attoparser.IAttributeSequenceHandler
handleAttribute, handleInnerWhiteSpace
-
-
-
-
Method Detail
-
handleStandaloneElementStart
void handleStandaloneElementStart(char[] buffer, int nameOffset, int nameLen, boolean minimized, int line, int col) throws ParseException
Called when a standalone element (an element with no closing 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.
- Parameters:
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.minimized
- whether the element has been found minimized (<element/>)in code 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:
ParseException
- if any exceptions occur during handling.
-
handleStandaloneElementEnd
void handleStandaloneElementEnd(char[] buffer, int nameOffset, int nameLen, boolean minimized, int line, int col) throws ParseException
Called when the end of a standalone element (an element with no closing 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:
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.minimized
- whether the element has been found minimized (<element/>)in code or not.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.- Throws:
ParseException
- if any exceptions occur during handling.
-
handleOpenElementStart
void handleOpenElementStart(char[] buffer, int nameOffset, int nameLen, int line, int col) throws ParseException
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.
- Parameters:
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:
ParseException
- if any exceptions occur during handling.
-
handleOpenElementEnd
void handleOpenElementEnd(char[] buffer, int nameOffset, int nameLen, int line, int col) throws ParseException
Called when the end 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:
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 the element ending structure appears.col
- the column in the original document where the element ending structure appears.- Throws:
ParseException
- if any exceptions occur during handling.
-
handleAutoOpenElementStart
void handleAutoOpenElementStart(char[] buffer, int nameOffset, int nameLen, int line, int col) throws ParseException
Called for signaling the start of an auto-open element (a synthetic open tag), created for adapting parsed markup to a specification such as, for example, HTML5. 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.
- Parameters:
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:
ParseException
- if any exceptions occur during handling.
-
handleAutoOpenElementEnd
void handleAutoOpenElementEnd(char[] buffer, int nameOffset, int nameLen, int line, int col) throws ParseException
Called for signaling the end of an auto-open element (a synthetic open tag), created for adapting parsed markup to a specification such as, for example, HTML5. 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.
- Parameters:
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 the element ending structure appears.col
- the column in the original document where the element ending structure appears.- Throws:
ParseException
- if any exceptions occur during handling.
-
handleCloseElementStart
void handleCloseElementStart(char[] buffer, int nameOffset, int nameLen, int line, int col) throws ParseException
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.
- Parameters:
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:
ParseException
- if any exceptions occur during handling.
-
handleCloseElementEnd
void handleCloseElementEnd(char[] buffer, int nameOffset, int nameLen, int line, int col) throws ParseException
Called when the end 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:
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 the element ending structure appears.col
- the column in the original document where the element ending structure appears.- Throws:
ParseException
- if any exceptions occur during handling.
-
handleAutoCloseElementStart
void handleAutoCloseElementStart(char[] buffer, int nameOffset, int nameLen, int line, int col) throws ParseException
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.
- Parameters:
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:
ParseException
- if any exceptions occur during handling.
-
handleAutoCloseElementEnd
void handleAutoCloseElementEnd(char[] buffer, int nameOffset, int nameLen, int line, int col) throws ParseException
Called for signaling the end of an auto-close element, created for balancing an unclosed tag.
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
- 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 the element ending structure appears.col
- the column in the original document where the element ending structure appears.- Throws:
ParseException
- if any exceptions occur during handling.
-
handleUnmatchedCloseElementStart
void handleUnmatchedCloseElementStart(char[] buffer, int nameOffset, int nameLen, int line, int col) throws ParseException
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.
- Parameters:
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:
ParseException
- if any exceptions occur during handling.
-
handleUnmatchedCloseElementEnd
void handleUnmatchedCloseElementEnd(char[] buffer, int nameOffset, int nameLen, int line, int col) throws ParseException
Called when the end of an unmatched close element (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:
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 the element ending structure appears.col
- the column in the original document where the element ending structure appears.- Throws:
ParseException
- if any exceptions occur during handling.
-
-