nu.validator.htmlparser.io
Class MetaSniffer

java.lang.Object
  extended by nu.validator.htmlparser.impl.MetaScanner
      extended by nu.validator.htmlparser.io.MetaSniffer
All Implemented Interfaces:
org.xml.sax.Locator

public class MetaSniffer
extends MetaScanner
implements org.xml.sax.Locator


Field Summary
 
Fields inherited from class nu.validator.htmlparser.impl.MetaScanner
readable, stateSave
 
Constructor Summary
MetaSniffer(org.xml.sax.ErrorHandler eh, org.xml.sax.Locator locator)
           
 
Method Summary
 int getColumnNumber()
           
 int getLineNumber()
           
 java.lang.String getPublicId()
           
 java.lang.String getSystemId()
           
protected  int read()
          -1 means end.
 Encoding sniff(ByteReadable readable)
          Main loop.
protected  boolean tryCharset(java.lang.String encoding)
          Tries to switch to an encoding.
 
Methods inherited from class nu.validator.htmlparser.impl.MetaScanner
stateLoop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetaSniffer

public MetaSniffer(org.xml.sax.ErrorHandler eh,
                   org.xml.sax.Locator locator)
Method Detail

read

protected int read()
            throws java.io.IOException
-1 means end.

Overrides:
read in class MetaScanner
Returns:
Throws:
java.io.IOException

sniff

public Encoding sniff(ByteReadable readable)
               throws org.xml.sax.SAXException,
                      java.io.IOException
Main loop.

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

getColumnNumber

public int getColumnNumber()
Specified by:
getColumnNumber in interface org.xml.sax.Locator

getLineNumber

public int getLineNumber()
Specified by:
getLineNumber in interface org.xml.sax.Locator

getPublicId

public java.lang.String getPublicId()
Specified by:
getPublicId in interface org.xml.sax.Locator

getSystemId

public java.lang.String getSystemId()
Specified by:
getSystemId in interface org.xml.sax.Locator

tryCharset

protected boolean tryCharset(java.lang.String encoding)
                      throws org.xml.sax.SAXException
Description copied from class: MetaScanner
Tries to switch to an encoding.

Specified by:
tryCharset in class MetaScanner
Returns:
true if successful
Throws:
org.xml.sax.SAXException