Class MarkupEventProcessorHandler
- All Implemented Interfaces:
IAttributeSequenceHandler, ICDATASectionHandler, ICommentHandler, IDocTypeHandler, IDocumentHandler, IElementHandler, IMarkupHandler, IProcessingInstructionHandler, ITextHandler, IXMLDeclarationHandler
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final class(package private) static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate booleanprivate booleanprivate booleanprivate char[][]private intprivate static final intprivate static final intprivate booleanprivate booleanprivate char[][]private intprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate char[]private ParseStatusprivate booleanprivate booleanprivate booleanprivate booleanprivate boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidautoClose(char[][] autoCloseElements, char[][] autoCloseLimits, int line, int col) private voidautoOpen(char[][] autoOpenParents, char[][] autoOpenLimits, int line, int col) private booleancheckStackForElement(char[] buffer, int offset, int len, int line, int col) private voidcheckValidRootElement(char[] buffer, int offset, int len, int line, int col) private voidcleanStack(int line, int col) private voidvoidhandleAttribute(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.voidhandleAutoCloseElementEnd(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.voidhandleAutoCloseElementStart(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.voidhandleAutoOpenElementEnd(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.voidhandleAutoOpenElementStart(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.voidhandleCloseElementEnd(char[] buffer, int nameOffset, int nameLen, int line, int col) Called when the end of a close element (a close tag) is found.voidhandleCloseElementStart(char[] buffer, int nameOffset, int nameLen, int line, int col) Called when the start of a close element (a close tag) is found.voidhandleDocType(char[] buffer, int keywordOffset, int keywordLen, int keywordLine, int keywordCol, int elementNameOffset, int elementNameLen, int elementNameLine, int elementNameCol, int typeOffset, int typeLen, int typeLine, int typeCol, int publicIdOffset, int publicIdLen, int publicIdLine, int publicIdCol, int systemIdOffset, int systemIdLen, int systemIdLine, int systemIdCol, int internalSubsetOffset, int internalSubsetLen, int internalSubsetLine, int internalSubsetCol, int outerOffset, int outerLen, int outerLine, int outerCol) Called when a DOCTYPE clause is found.voidhandleDocumentEnd(long endTimeNanos, long totalTimeNanos, int line, int col) Called at the end of document parsing.voidhandleOpenElementEnd(char[] buffer, int nameOffset, int nameLen, int line, int col) Called when the end of an open element (an open tag) is found.voidhandleOpenElementStart(char[] buffer, int nameOffset, int nameLen, int line, int col) Called when an open element (an open tag) is found.voidhandleStandaloneElementEnd(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 foundvoidhandleStandaloneElementStart(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.voidhandleUnmatchedCloseElementEnd(char[] buffer, int nameOffset, int nameLen, int line, int col) Called when the end of an unmatched close element (close tag) is found.voidhandleUnmatchedCloseElementStart(char[] buffer, int nameOffset, int nameLen, int line, int col) Called when the start of an unmatched close element (close tag) is found.voidhandleXmlDeclaration(char[] buffer, int keywordOffset, int keywordLen, int keywordLine, int keywordCol, int versionOffset, int versionLen, int versionLine, int versionCol, int encodingOffset, int encodingLen, int encodingLine, int encodingCol, int standaloneOffset, int standaloneLen, int standaloneLine, int standaloneCol, int outerOffset, int outerLen, int line, int col) Called when a XML Declaration is found.private char[]peekFromStack(int delta) private char[]private voidpushToStack(char[] buffer, int offset, int len) voidsetParseConfiguration(ParseConfiguration parseConfiguration) Sets theParseConfigurationobject that will be used during the parsing operation.voidsetParseStatus(ParseStatus status) Sets theParseStatusobject that will be used during the parsing operation.Methods inherited from class AbstractChainedMarkupHandler
getNext, handleCDATASection, handleComment, handleDocumentStart, handleInnerWhiteSpace, handleProcessingInstruction, handleText, setParseSelection
-
Field Details
-
DEFAULT_STACK_LEN
private static final int DEFAULT_STACK_LEN- See Also:
-
DEFAULT_ATTRIBUTE_NAMES_LEN
private static final int DEFAULT_ATTRIBUTE_NAMES_LEN- See Also:
-
status
-
useStack
private boolean useStack -
autoOpen
private boolean autoOpen -
autoClose
private boolean autoClose -
requireBalancedElements
private boolean requireBalancedElements -
requireNoUnmatchedCloseElements
private boolean requireNoUnmatchedCloseElements -
prologParseConfiguration
-
uniqueRootElementPresence
-
caseSensitive
private boolean caseSensitive -
requireWellFormedAttributeValues
private boolean requireWellFormedAttributeValues -
requireUniqueAttributesInElement
private boolean requireUniqueAttributesInElement -
validateProlog
private boolean validateProlog -
prologPresenceForbidden
private boolean prologPresenceForbidden -
xmlDeclarationPresenceForbidden
private boolean xmlDeclarationPresenceForbidden -
doctypePresenceForbidden
private boolean doctypePresenceForbidden -
structureNamesRepository
-
elementStack
private char[][] elementStack -
elementStackSize
private int elementStackSize -
validPrologXmlDeclarationRead
private boolean validPrologXmlDeclarationRead -
validPrologDocTypeRead
private boolean validPrologDocTypeRead -
elementRead
private boolean elementRead -
rootElementName
private char[] rootElementName -
currentElementAttributeNames
private char[][] currentElementAttributeNames -
currentElementAttributeNamesSize
private int currentElementAttributeNamesSize -
closeElementIsMatched
private boolean closeElementIsMatched
-
-
Constructor Details
-
MarkupEventProcessorHandler
MarkupEventProcessorHandler(IMarkupHandler handler)
-
-
Method Details
-
setParseStatus
Description copied from interface:IMarkupHandlerSets the
ParseStatusobject that will be used during the parsing operation. This object can be used for instructing the parser about specific low-level conditions arisen during event handling.This method is always called by the parser before calling any other event handling method.
Note that this method can be safely ignored by most implementations, as there are very few and very specific scenarios in which this kind of interaction with the parser would be needed. It is therefore mainly for internal use.
- Specified by:
setParseStatusin interfaceIMarkupHandler- Overrides:
setParseStatusin classAbstractChainedMarkupHandler- Parameters:
status- the status object.
-
setParseConfiguration
Description copied from interface:IMarkupHandlerSets the
ParseConfigurationobject that will be used during the parsing operation. This object will normally have been specified to the parser object during its instantiation or initialization.This method is always called by the parser before calling any other event handling method.
Note that this method can be safely ignored by most implementations, as there are very few scenarios in which this kind of interaction would be consisdered relevant.
- Specified by:
setParseConfigurationin interfaceIMarkupHandler- Overrides:
setParseConfigurationin classAbstractChainedMarkupHandler- Parameters:
parseConfiguration- the configuration object.
-
handleDocumentEnd
public void handleDocumentEnd(long endTimeNanos, long totalTimeNanos, int line, int col) throws ParseException Description copied from interface:IDocumentHandlerCalled at the end of document parsing.
- Specified by:
handleDocumentEndin interfaceIDocumentHandler- Overrides:
handleDocumentEndin classAbstractChainedMarkupHandler- Parameters:
endTimeNanos- the current time (in nanoseconds) obtained when parsing ends.totalTimeNanos- the difference between current times at the start and end of parsing (in nanoseconds).line- the line of the document where parsing ends (usually the last one).col- the column of the document where the parsing ends (usually the last one).- Throws:
ParseException- if any exceptions occur during handling.
-
handleXmlDeclaration
public void handleXmlDeclaration(char[] buffer, int keywordOffset, int keywordLen, int keywordLine, int keywordCol, int versionOffset, int versionLen, int versionLine, int versionCol, int encodingOffset, int encodingLen, int encodingLine, int encodingCol, int standaloneOffset, int standaloneLen, int standaloneLine, int standaloneCol, int outerOffset, int outerLen, int line, int col) throws ParseException Description copied from interface:IXMLDeclarationHandlerCalled when a XML Declaration is found.
Five [offset, len] pairs are provided for five partitions (outer, keyword, version, encoding and standalone):
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
| [K] [V] [ENC] [S] |
[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.
- Specified by:
handleXmlDeclarationin interfaceIXMLDeclarationHandler- Overrides:
handleXmlDeclarationin classAbstractChainedMarkupHandler- Parameters:
buffer- the document buffer (not copied)keywordOffset- offset for the keyword partition.keywordLen- length of the keyword partition.keywordLine- the line in the original document where the keyword partition starts.keywordCol- the column in the original document where the keyword partition starts.versionOffset- offset for the version partition.versionLen- length of the version partition.versionLine- the line in the original document where the version partition starts.versionCol- the column in the original document where the version partition starts.encodingOffset- offset for the encoding partition.encodingLen- length of the encoding partition.encodingLine- the line in the original document where the encoding partition starts.encodingCol- the column in the original document where the encoding partition starts.standaloneOffset- offset for the standalone partition.standaloneLen- length of the standalone partition.standaloneLine- the line in the original document where the standalone partition starts.standaloneCol- the column in the original document where the standalone partition starts.outerOffset- offset for the outer partition.outerLen- length of the outer partition.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.
-
handleStandaloneElementStart
public void handleStandaloneElementStart(char[] buffer, int nameOffset, int nameLen, boolean minimized, int line, int col) throws ParseException Description copied from interface:IElementHandlerCalled 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.
- Specified by:
handleStandaloneElementStartin interfaceIElementHandler- Overrides:
handleStandaloneElementStartin classAbstractChainedMarkupHandler- 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
public void handleStandaloneElementEnd(char[] buffer, int nameOffset, int nameLen, boolean minimized, int line, int col) throws ParseException Description copied from interface:IElementHandlerCalled 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.
- Specified by:
handleStandaloneElementEndin interfaceIElementHandler- Overrides:
handleStandaloneElementEndin classAbstractChainedMarkupHandler- 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
public void handleOpenElementStart(char[] buffer, int nameOffset, int nameLen, int line, int col) throws ParseException Description copied from interface:IElementHandlerCalled 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:
handleOpenElementStartin interfaceIElementHandler- Overrides:
handleOpenElementStartin classAbstractChainedMarkupHandler- 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
public void handleOpenElementEnd(char[] buffer, int nameOffset, int nameLen, int line, int col) throws ParseException Description copied from interface:IElementHandlerCalled 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.
- Specified by:
handleOpenElementEndin interfaceIElementHandler- Overrides:
handleOpenElementEndin classAbstractChainedMarkupHandler- 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
public void handleAutoOpenElementStart(char[] buffer, int nameOffset, int nameLen, int line, int col) throws ParseException Description copied from interface:IElementHandlerCalled 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.
- Specified by:
handleAutoOpenElementStartin interfaceIElementHandler- Overrides:
handleAutoOpenElementStartin classAbstractChainedMarkupHandler- 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
public void handleAutoOpenElementEnd(char[] buffer, int nameOffset, int nameLen, int line, int col) throws ParseException Description copied from interface:IElementHandlerCalled 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.
- Specified by:
handleAutoOpenElementEndin interfaceIElementHandler- Overrides:
handleAutoOpenElementEndin classAbstractChainedMarkupHandler- 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
public void handleCloseElementStart(char[] buffer, int nameOffset, int nameLen, int line, int col) throws ParseException Description copied from interface:IElementHandlerCalled 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:
handleCloseElementStartin interfaceIElementHandler- Overrides:
handleCloseElementStartin classAbstractChainedMarkupHandler- 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
public void handleCloseElementEnd(char[] buffer, int nameOffset, int nameLen, int line, int col) throws ParseException Description copied from interface:IElementHandlerCalled 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.
- Specified by:
handleCloseElementEndin interfaceIElementHandler- Overrides:
handleCloseElementEndin classAbstractChainedMarkupHandler- 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
public void handleAutoCloseElementStart(char[] buffer, int nameOffset, int nameLen, int line, int col) throws ParseException Description copied from interface:IElementHandlerCalled 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:
handleAutoCloseElementStartin interfaceIElementHandler- Overrides:
handleAutoCloseElementStartin classAbstractChainedMarkupHandler- 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
public void handleAutoCloseElementEnd(char[] buffer, int nameOffset, int nameLen, int line, int col) throws ParseException Description copied from interface:IElementHandlerCalled 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.
- Specified by:
handleAutoCloseElementEndin interfaceIElementHandler- Overrides:
handleAutoCloseElementEndin classAbstractChainedMarkupHandler- 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
public void handleUnmatchedCloseElementStart(char[] buffer, int nameOffset, int nameLen, int line, int col) throws ParseException Description copied from interface:IElementHandlerCalled 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.
- Specified by:
handleUnmatchedCloseElementStartin interfaceIElementHandler- Overrides:
handleUnmatchedCloseElementStartin classAbstractChainedMarkupHandler- 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
public void handleUnmatchedCloseElementEnd(char[] buffer, int nameOffset, int nameLen, int line, int col) throws ParseException Description copied from interface:IElementHandlerCalled 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.
- Specified by:
handleUnmatchedCloseElementEndin interfaceIElementHandler- Overrides:
handleUnmatchedCloseElementEndin classAbstractChainedMarkupHandler- 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.
-
handleAttribute
public 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 ParseException Description copied from interface:IAttributeSequenceHandlerCalled 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.
- Specified by:
handleAttributein interfaceIAttributeSequenceHandler- Overrides:
handleAttributein classAbstractChainedMarkupHandler- 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:
ParseException- if any exceptions occur during handling.
-
handleDocType
public void handleDocType(char[] buffer, int keywordOffset, int keywordLen, int keywordLine, int keywordCol, int elementNameOffset, int elementNameLen, int elementNameLine, int elementNameCol, int typeOffset, int typeLen, int typeLine, int typeCol, int publicIdOffset, int publicIdLen, int publicIdLine, int publicIdCol, int systemIdOffset, int systemIdLen, int systemIdLine, int systemIdCol, int internalSubsetOffset, int internalSubsetLen, int internalSubsetLine, int internalSubsetCol, int outerOffset, int outerLen, int outerLine, int outerCol) throws ParseException Description copied from interface:IDocTypeHandlerCalled when a DOCTYPE clause is found.
This method reports the DOCTYPE clause splitting it into its different parts.
Seven [offset, len] pairs are provided for seven partitions (outer, keyword, elementName, type, publicId, systemId and internalSubset) of the DOCTYPE clause:
<!DOCTYPE html PUBLIC ".........." ".........." [................]>
| [KEYWO] [EN] [TYPE] [PUBLICID] [SYSTEMID] [INTERNALSUBSET] |
[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.
- Specified by:
handleDocTypein interfaceIDocTypeHandler- Overrides:
handleDocTypein classAbstractChainedMarkupHandler- Parameters:
buffer- the document buffer (not copied)keywordOffset- offset for the keyword partition.keywordLen- length of the keyword partition.keywordLine- the line in the original document where the keyword partition starts.keywordCol- the column in the original document where the keyword partition starts.elementNameOffset- offset for the elementName partition.elementNameLen- length of the elementName partition.elementNameLine- the line in the original document where the elementName partition starts.elementNameCol- the column in the original document where the elementName partition starts.typeOffset- offset for the type partition.typeLen- length of the type partition.typeLine- the line in the original document where the type partition starts.typeCol- the column in the original document where the type partition starts.publicIdOffset- offset for the publicId partition.publicIdLen- length of the publicId partition.publicIdLine- the line in the original document where the publicId partition starts.publicIdCol- the column in the original document where the publicId partition starts.systemIdOffset- offset for the systemId partition.systemIdLen- length of the systemId partition.systemIdLine- the line in the original document where the systemId partition starts.systemIdCol- the column in the original document where the systemId partition starts.internalSubsetOffset- offset for the internalSubsetId partition.internalSubsetLen- length of the internalSubsetId partition.internalSubsetLine- the line in the original document where the internalSubsetId partition starts.internalSubsetCol- the column in the original document where the internalSubsetId partition starts.outerOffset- offset for the outer partition.outerLen- length of the outer partition.outerLine- the line in the original document where this artifact starts.outerCol- the column in the original document where this artifact starts.- Throws:
ParseException- if any exceptions occur during handling.
-
checkValidRootElement
private void checkValidRootElement(char[] buffer, int offset, int len, int line, int col) throws ParseException - Throws:
ParseException
-
checkStackForElement
private boolean checkStackForElement(char[] buffer, int offset, int len, int line, int col) throws ParseException - Throws:
ParseException
-
cleanStack
- Throws:
ParseException
-
autoClose
private void autoClose(char[][] autoCloseElements, char[][] autoCloseLimits, int line, int col) throws ParseException - Throws:
ParseException
-
autoOpen
private void autoOpen(char[][] autoOpenParents, char[][] autoOpenLimits, int line, int col) throws ParseException - Throws:
ParseException
-
pushToStack
private void pushToStack(char[] buffer, int offset, int len) -
peekFromStack
private char[] peekFromStack(int delta) -
popFromStack
private char[] popFromStack() -
growStack
private void growStack()
-