Class ParsingXmlDeclarationMarkupUtil.XmlDeclarationAttributeProcessor
- java.lang.Object
-
- org.attoparser.ParsingXmlDeclarationMarkupUtil.XmlDeclarationAttributeProcessor
-
- All Implemented Interfaces:
IAttributeSequenceHandler
- Enclosing class:
- ParsingXmlDeclarationMarkupUtil
private static class ParsingXmlDeclarationMarkupUtil.XmlDeclarationAttributeProcessor extends java.lang.Object implements IAttributeSequenceHandler
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static char[]
ENCODING
(package private) int
encodingCol
(package private) int
encodingLen
(package private) int
encodingLine
(package private) int
encodingOffset
(package private) boolean
encodingPresent
private int
outerCol
private int
outerLen
private int
outerLine
private int
outerOffset
(package private) static char[]
STANDALONE
(package private) int
standaloneCol
(package private) int
standaloneLen
(package private) int
standaloneLine
(package private) int
standaloneOffset
(package private) boolean
standalonePresent
(package private) static char[]
VERSION
(package private) int
versionCol
(package private) int
versionLen
(package private) int
versionLine
(package private) int
versionOffset
(package private) boolean
versionPresent
-
Constructor Summary
Constructors Constructor Description XmlDeclarationAttributeProcessor(int outerOffset, int outerLen, int outerLine, int outerCol)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static boolean
charArrayEquals(char[] arr1, int arr1Offset, int arr1Len, char[] arr2, int arr2Offset, int arr2Len)
void
finalChecks(int[] locator, char[] buffer)
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
handleInnerWhiteSpace(char[] buffer, int offset, int len, int line, int col)
Called when an amount of white space is found inside an element.
-
-
-
Field Detail
-
outerOffset
private final int outerOffset
-
outerLen
private final int outerLen
-
outerLine
private final int outerLine
-
outerCol
private final int outerCol
-
VERSION
static final char[] VERSION
-
versionPresent
boolean versionPresent
-
versionOffset
int versionOffset
-
versionLen
int versionLen
-
versionLine
int versionLine
-
versionCol
int versionCol
-
ENCODING
static final char[] ENCODING
-
encodingPresent
boolean encodingPresent
-
encodingOffset
int encodingOffset
-
encodingLen
int encodingLen
-
encodingLine
int encodingLine
-
encodingCol
int encodingCol
-
STANDALONE
static final char[] STANDALONE
-
standalonePresent
boolean standalonePresent
-
standaloneOffset
int standaloneOffset
-
standaloneLen
int standaloneLen
-
standaloneLine
int standaloneLine
-
standaloneCol
int standaloneCol
-
-
Method Detail
-
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:IAttributeSequenceHandler
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.
- Specified by:
handleAttribute
in interfaceIAttributeSequenceHandler
- 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.
-
handleInnerWhiteSpace
public void handleInnerWhiteSpace(char[] buffer, int offset, int len, int line, int col) throws ParseException
Description copied from interface:IAttributeSequenceHandler
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">
[INNWSP]
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:
handleInnerWhiteSpace
in interfaceIAttributeSequenceHandler
- Parameters:
buffer
- the document buffer (not copied)offset
- offset for the artifact.len
- length of the artifact.line
- the line in the original document where the artifact starts.col
- the column in the original document where the artifact starts.- Throws:
ParseException
- if any exceptions occur during handling.
-
finalChecks
public void finalChecks(int[] locator, char[] buffer) throws ParseException
- Throws:
ParseException
-
charArrayEquals
private static boolean charArrayEquals(char[] arr1, int arr1Offset, int arr1Len, char[] arr2, int arr2Offset, int arr2Len)
-
-