org.attoparser.markup.xml
Class AbstractDetailedXmlAttoHandler

Object
  extended by org.attoparser.AbstractAttoHandler
      extended by org.attoparser.markup.AbstractBasicMarkupAttoHandler
          extended by org.attoparser.markup.AbstractDetailedMarkupAttoHandler
              extended by org.attoparser.markup.xml.AbstractDetailedXmlAttoHandler
All Implemented Interfaces:
IAttoHandler, ITimedDocumentHandling, IAttributeSequenceHandling, IBasicDocTypeHandling, IBasicElementHandling, ICDATASectionHandling, ICommentHandling, IDetailedDocTypeHandling, IDetailedElementHandling, IProcessingInstructionHandling, IXmlDeclarationHandling, IDetailedXmlElementHandling
Direct Known Subclasses:
AbstractStandardXmlAttoHandler

public abstract class AbstractDetailedXmlAttoHandler
extends AbstractDetailedMarkupAttoHandler
implements IDetailedXmlElementHandling

Since:
1.1
Author:
Daniel Fernández

Constructor Summary
AbstractDetailedXmlAttoHandler()
           
 
Method Summary
 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 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 handleCloseElementEnd(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 handleDocumentEnd(long endTimeNanos, long totalTimeNanos, int line, int col, MarkupParsingConfiguration documentRestrictions)
           Called when document parsing ends.
 void handleDocumentStart(long startTimeNanos, int line, int col, MarkupParsingConfiguration documentRestrictions)
           Called when document parsing starts.
 void handleOpenElementEnd(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(int line, int col)
           Called when the end of a standalone element (a minimized tag) is found
 void handleStandaloneElementStart(char[] buffer, int nameOffset, int nameLen, int line, int col)
           Called when a standalone element (a minimized tag) is found.
 void handleXmlCloseElementEnd(int line, int col)
           Called when the end of a close element (a close tag) is found.
 void handleXmlCloseElementStart(char[] buffer, int nameOffset, int nameLen, int line, int col)
           Called when a close element (a close tag) is found.
 void handleXmlDocumentEnd(long endTimeNanos, long totalTimeNanos, int line, int col)
           
 void handleXmlDocumentStart(long startTimeNanos, int line, int col)
           
 void handleXmlOpenElementEnd(int line, int col)
           Called when the end of an open element (an open tag) is found.
 void handleXmlOpenElementStart(char[] buffer, int nameOffset, int nameLen, int line, int col)
           Called when an open element (an open tag) is found.
 void handleXmlStandaloneElementEnd(int line, int col)
           Called when the end of a standalone element (a minimized tag) is found.
 void handleXmlStandaloneElementStart(char[] buffer, int nameOffset, int nameLen, int line, int col)
           Called when a standalone element (a minimized tag) is found.
 
Methods inherited from class org.attoparser.markup.AbstractDetailedMarkupAttoHandler
handleAttribute, handleCloseElement, handleDocType, handleDocType, handleDocumentEnd, handleDocumentStart, handleInnerWhiteSpace, handleOpenElement, handleStandaloneElement, handleUnmatchedCloseElementEnd, handleUnmatchedCloseElementStart, 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
 
Methods inherited from interface org.attoparser.markup.IAttributeSequenceHandling
handleAttribute, handleInnerWhiteSpace
 

Constructor Detail

AbstractDetailedXmlAttoHandler

public AbstractDetailedXmlAttoHandler()
Method Detail

handleDocumentStart

public final void handleDocumentStart(long startTimeNanos,
                                      int line,
                                      int col,
                                      MarkupParsingConfiguration documentRestrictions)
                               throws AttoParseException
Description copied from class: AbstractDetailedMarkupAttoHandler

Called when document parsing starts.

Overrides:
handleDocumentStart in class AbstractDetailedMarkupAttoHandler
Parameters:
startTimeNanos - the starting time, in nanoseconds.
documentRestrictions - the document restrictions being applied.
Throws:
AttoParseException

handleDocumentEnd

public final void handleDocumentEnd(long endTimeNanos,
                                    long totalTimeNanos,
                                    int line,
                                    int col,
                                    MarkupParsingConfiguration documentRestrictions)
                             throws AttoParseException
Description copied from class: AbstractDetailedMarkupAttoHandler

Called when document parsing ends.

Overrides:
handleDocumentEnd in class AbstractDetailedMarkupAttoHandler
Parameters:
endTimeNanos - the parsing end time, in nanoseconds.
totalTimeNanos - the difference between parsing start and end times.
documentRestrictions - the document restrictions being applied.
Throws:
AttoParseException

handleStandaloneElementStart

public final void handleStandaloneElementStart(char[] buffer,
                                               int nameOffset,
                                               int nameLen,
                                               int line,
                                               int col)
                                        throws AttoParseException
Description copied from interface: 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.

Specified by:
handleStandaloneElementStart in interface IDetailedElementHandling
Overrides:
handleStandaloneElementStart in class AbstractDetailedMarkupAttoHandler
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:
AttoParseException

handleStandaloneElementEnd

public final void handleStandaloneElementEnd(int line,
                                             int col)
                                      throws AttoParseException
Description copied from interface: IDetailedElementHandling

Called when the end of a standalone element (a minimized tag) is found

Specified by:
handleStandaloneElementEnd in interface IDetailedElementHandling
Overrides:
handleStandaloneElementEnd in class AbstractDetailedMarkupAttoHandler
Parameters:
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:
AttoParseException

handleOpenElementStart

public final void handleOpenElementStart(char[] buffer,
                                         int nameOffset,
                                         int nameLen,
                                         int line,
                                         int col)
                                  throws AttoParseException
Description copied from interface: 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.

Specified by:
handleOpenElementStart in interface IDetailedElementHandling
Overrides:
handleOpenElementStart in class AbstractDetailedMarkupAttoHandler
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:
AttoParseException

handleOpenElementEnd

public final void handleOpenElementEnd(int line,
                                       int col)
                                throws AttoParseException
Description copied from interface: IDetailedElementHandling

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

Specified by:
handleOpenElementEnd in interface IDetailedElementHandling
Overrides:
handleOpenElementEnd in class AbstractDetailedMarkupAttoHandler
Parameters:
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:
AttoParseException

handleCloseElementStart

public final void handleCloseElementStart(char[] buffer,
                                          int nameOffset,
                                          int nameLen,
                                          int line,
                                          int col)
                                   throws AttoParseException
Description copied from interface: 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.

Specified by:
handleCloseElementStart in interface IDetailedElementHandling
Overrides:
handleCloseElementStart in class AbstractDetailedMarkupAttoHandler
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:
AttoParseException

handleCloseElementEnd

public final void handleCloseElementEnd(int line,
                                        int col)
                                 throws AttoParseException
Description copied from interface: IDetailedElementHandling

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

Specified by:
handleCloseElementEnd in interface IDetailedElementHandling
Overrides:
handleCloseElementEnd in class AbstractDetailedMarkupAttoHandler
Parameters:
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:
AttoParseException

handleAutoCloseElementStart

public final void handleAutoCloseElementStart(char[] buffer,
                                              int nameOffset,
                                              int nameLen,
                                              int line,
                                              int col)
                                       throws AttoParseException
Description copied from interface: 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.

Specified by:
handleAutoCloseElementStart in interface IDetailedElementHandling
Overrides:
handleAutoCloseElementStart in class AbstractDetailedMarkupAttoHandler
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:
AttoParseException

handleAutoCloseElementEnd

public final void handleAutoCloseElementEnd(int line,
                                            int col)
                                     throws AttoParseException
Description copied from interface: IDetailedElementHandling

Called for signaling the end of an auto-close element, created for balancing an unclosed tag.

Specified by:
handleAutoCloseElementEnd in interface IDetailedElementHandling
Overrides:
handleAutoCloseElementEnd in class AbstractDetailedMarkupAttoHandler
Parameters:
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:
AttoParseException

handleXmlDocumentStart

public void handleXmlDocumentStart(long startTimeNanos,
                                   int line,
                                   int col)
                            throws AttoParseException
Throws:
AttoParseException

handleXmlDocumentEnd

public void handleXmlDocumentEnd(long endTimeNanos,
                                 long totalTimeNanos,
                                 int line,
                                 int col)
                          throws AttoParseException
Throws:
AttoParseException

handleXmlStandaloneElementStart

public void handleXmlStandaloneElementStart(char[] buffer,
                                            int nameOffset,
                                            int nameLen,
                                            int line,
                                            int col)
                                     throws AttoParseException
Description copied from interface: IDetailedXmlElementHandling

Called when a standalone element (a minimized tag) is found. The name of the element is also reported.

An example standalone element: <metainfo action-type="interop"/>

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.

Specified by:
handleXmlStandaloneElementStart in interface IDetailedXmlElementHandling
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:
AttoParseException

handleXmlStandaloneElementEnd

public void handleXmlStandaloneElementEnd(int line,
                                          int col)
                                   throws AttoParseException
Description copied from interface: IDetailedXmlElementHandling

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

Specified by:
handleXmlStandaloneElementEnd in interface IDetailedXmlElementHandling
Parameters:
line - the line in the original document where this artifact starts.
col - the column in the original document where this artifact starts.
Throws:
AttoParseException

handleXmlOpenElementStart

public void handleXmlOpenElementStart(char[] buffer,
                                      int nameOffset,
                                      int nameLen,
                                      int line,
                                      int col)
                               throws AttoParseException
Description copied from interface: IDetailedXmlElementHandling

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.

Specified by:
handleXmlOpenElementStart in interface IDetailedXmlElementHandling
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:
AttoParseException

handleXmlOpenElementEnd

public void handleXmlOpenElementEnd(int line,
                                    int col)
                             throws AttoParseException
Description copied from interface: IDetailedXmlElementHandling

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

Specified by:
handleXmlOpenElementEnd in interface IDetailedXmlElementHandling
Parameters:
line - the line in the original document where this artifact starts.
col - the column in the original document where this artifact starts.
Throws:
AttoParseException

handleXmlCloseElementStart

public void handleXmlCloseElementStart(char[] buffer,
                                       int nameOffset,
                                       int nameLen,
                                       int line,
                                       int col)
                                throws AttoParseException
Description copied from interface: IDetailedXmlElementHandling

Called when 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.

Specified by:
handleXmlCloseElementStart in interface IDetailedXmlElementHandling
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:
AttoParseException

handleXmlCloseElementEnd

public void handleXmlCloseElementEnd(int line,
                                     int col)
                              throws AttoParseException
Description copied from interface: IDetailedXmlElementHandling

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

Specified by:
handleXmlCloseElementEnd in interface IDetailedXmlElementHandling
Parameters:
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 © 2012 The ATTOPARSER team. All Rights Reserved.