Package nu.validator.htmlparser.impl
Class MetaScanner
- java.lang.Object
-
- nu.validator.htmlparser.impl.MetaScanner
-
- Direct Known Subclasses:
MetaSniffer
public abstract class MetaScanner extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected ByteReadablereadableThe data source.protected intstateSaveThe tokenizer state.
-
Constructor Summary
Constructors Constructor Description MetaScanner()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected intread()Reads a byte from the data source.protected voidstateLoop(int state)The runs the meta scanning algorithm.protected abstract booleantryCharset(java.lang.String encoding)Tries to switch to an encoding.
-
-
-
Field Detail
-
readable
protected ByteReadable readable
The data source.
-
stateSave
protected int stateSave
The tokenizer state.
-
-
Method Detail
-
read
protected int read() throws java.io.IOExceptionReads a byte from the data source. -1 means end.- Returns:
- Throws:
java.io.IOException
-
stateLoop
protected final void stateLoop(int state) throws org.xml.sax.SAXException, java.io.IOExceptionThe runs the meta scanning algorithm.- Throws:
org.xml.sax.SAXExceptionjava.io.IOException
-
tryCharset
protected abstract boolean tryCharset(java.lang.String encoding) throws org.xml.sax.SAXExceptionTries to switch to an encoding.- Parameters:
encoding-- Returns:
trueif successful- Throws:
org.xml.sax.SAXException
-
-