public abstract class MetaScanner
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static int |
A |
private static int |
AFTER_ATTRIBUTE_NAME |
private static int |
AFTER_ATTRIBUTE_VALUE_QUOTED |
private static int |
ATTRIBUTE_NAME |
private static int |
ATTRIBUTE_VALUE_DOUBLE_QUOTED |
private static int |
ATTRIBUTE_VALUE_SINGLE_QUOTED |
private static int |
ATTRIBUTE_VALUE_UNQUOTED |
private static int |
BEFORE_ATTRIBUTE_NAME |
private static int |
BEFORE_ATTRIBUTE_VALUE |
private java.lang.String |
charset |
private static char[] |
CHARSET
Constant for "charset".
|
private int |
charsetIndex
The current position in recognizing the attribute name "charset".
|
private static int |
COMMENT |
private static int |
COMMENT_END |
private static int |
COMMENT_END_DASH |
private static int |
COMMENT_START |
private static int |
COMMENT_START_DASH |
private java.lang.String |
content |
private static char[] |
CONTENT
Constant for "content".
|
private static char[] |
CONTENT_TYPE
Constant for "content-type".
|
private int |
contentIndex
The current position in recognizing the attribute name "content".
|
private int |
contentTypeIndex
The current position in recognizing the attribute value "content-type".
|
private static int |
DATA |
private static int |
E |
private static char[] |
HTTP_EQUIV
Constant for "http-equiv".
|
private static int |
HTTP_EQUIV_CONTENT_TYPE |
private static int |
HTTP_EQUIV_NOT_SEEN |
private static int |
HTTP_EQUIV_OTHER |
private int |
httpEquivIndex
The current position in recognizing the attribute name "http-equive".
|
private int |
httpEquivState |
private static int |
M |
private static int |
MARKUP_DECLARATION_HYPHEN |
private static int |
MARKUP_DECLARATION_OPEN |
private int |
metaState
The state of the state machine that recognizes the tag name "meta".
|
private static int |
NO |
protected ByteReadable |
readable
The data source.
|
private static int |
SCAN_UNTIL_GT |
private static int |
SELF_CLOSING_START_TAG |
protected int |
stateSave
The tokenizer state.
|
private char[] |
strBuf
Accumulation buffer for attribute values.
|
private int |
strBufLen
The currently filled length of strBuf.
|
private static int |
T |
private static int |
TAG_NAME |
private static int |
TAG_OPEN |
Constructor and Description |
---|
MetaScanner() |
Modifier and Type | Method and Description |
---|---|
private void |
addToBuffer(int c)
Adds a character to the accumulation buffer.
|
private void |
destructor() |
private void |
handleAttributeValue()
Attempts to extract a charset name from the accumulation buffer.
|
private void |
handleCharInAttributeValue(int c) |
private boolean |
handleTag() |
private boolean |
handleTagInner() |
protected int |
read()
Reads a byte from the data source.
|
protected void |
stateLoop(int state)
The runs the meta scanning algorithm.
|
private int |
toAsciiLowerCase(int c) |
protected abstract boolean |
tryCharset(java.lang.String encoding)
Tries to switch to an encoding.
|
private static final char[] CHARSET
private static final char[] CONTENT
private static final char[] HTTP_EQUIV
private static final char[] CONTENT_TYPE
private static final int NO
private static final int M
private static final int E
private static final int T
private static final int A
private static final int DATA
private static final int TAG_OPEN
private static final int SCAN_UNTIL_GT
private static final int TAG_NAME
private static final int BEFORE_ATTRIBUTE_NAME
private static final int ATTRIBUTE_NAME
private static final int AFTER_ATTRIBUTE_NAME
private static final int BEFORE_ATTRIBUTE_VALUE
private static final int ATTRIBUTE_VALUE_DOUBLE_QUOTED
private static final int ATTRIBUTE_VALUE_SINGLE_QUOTED
private static final int ATTRIBUTE_VALUE_UNQUOTED
private static final int AFTER_ATTRIBUTE_VALUE_QUOTED
private static final int MARKUP_DECLARATION_OPEN
private static final int MARKUP_DECLARATION_HYPHEN
private static final int COMMENT_START
private static final int COMMENT_START_DASH
private static final int COMMENT
private static final int COMMENT_END_DASH
private static final int COMMENT_END
private static final int SELF_CLOSING_START_TAG
private static final int HTTP_EQUIV_NOT_SEEN
private static final int HTTP_EQUIV_CONTENT_TYPE
private static final int HTTP_EQUIV_OTHER
protected ByteReadable readable
private int metaState
private int contentIndex
private int charsetIndex
private int httpEquivIndex
private int contentTypeIndex
protected int stateSave
private int strBufLen
private char[] strBuf
private java.lang.String content
private java.lang.String charset
private int httpEquivState
private void destructor()
protected int read() throws java.io.IOException
java.io.IOException
protected final void stateLoop(int state) throws org.xml.sax.SAXException, java.io.IOException
org.xml.sax.SAXException
java.io.IOException
private void handleCharInAttributeValue(int c)
private int toAsciiLowerCase(int c)
private void addToBuffer(int c)
c
- the character to addprivate void handleAttributeValue() throws org.xml.sax.SAXException
org.xml.sax.SAXException
private boolean handleTag() throws org.xml.sax.SAXException
org.xml.sax.SAXException
private boolean handleTagInner() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected abstract boolean tryCharset(java.lang.String encoding) throws org.xml.sax.SAXException
encoding
- true
if successfulorg.xml.sax.SAXException