1
package com.thaiopensource.xml.tok;
4
* Thrown to indicate that the byte subarray being tokenized does not start
5
* with a legal XML token and cannot start one if more bytes are added.
7
public class InvalidTokenException extends TokenException {
8
private final int offset;
11
* The character or byte at the specified offset is not allowed
14
public static final byte ILLEGAL_CHAR = 0;
16
* The target of a processing instruction was XML.
18
public static final byte XML_TARGET = 1;
20
* A duplicate attribute was specified.
22
public static final byte DUPLICATE_ATTRIBUTE = 2;
24
private final byte type;
26
InvalidTokenException(int offset, byte type) {
31
InvalidTokenException(int offset) {
33
this.type = ILLEGAL_CHAR;
37
* Returns the offset after the longest initial subarray
38
* which could start a legal XML token.
40
public final int getOffset() {
43
public final byte getType() {