nu.validator.htmlparser.impl
Class MetaScanner

java.lang.Object
  extended by nu.validator.htmlparser.impl.MetaScanner
Direct Known Subclasses:
MetaSniffer

public abstract class MetaScanner
extends java.lang.Object


Field Summary
protected  ByteReadable readable
          The data source.
protected  int stateSave
          The tokenizer state.
 
Constructor Summary
MetaScanner()
           
 
Method Summary
protected  int read()
          Reads a byte from the data source.
protected  void stateLoop(int state)
          The runs the meta scanning algorithm.
protected abstract  boolean tryCharset(java.lang.String encoding)
          Tries to switch to an encoding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

readable

protected ByteReadable readable
The data source.


stateSave

protected int stateSave
The tokenizer state.

Constructor Detail

MetaScanner

public MetaScanner()
Method Detail

read

protected int read()
            throws java.io.IOException
Reads 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.IOException
The runs the meta scanning algorithm.

Throws:
org.xml.sax.SAXException
java.io.IOException

tryCharset

protected abstract boolean tryCharset(java.lang.String encoding)
                               throws org.xml.sax.SAXException
Tries to switch to an encoding.

Parameters:
encoding -
Returns:
true if successful
Throws:
org.xml.sax.SAXException