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:
Locator

public class MetaSniffer
extends MetaScanner
implements Locator


Field Summary
private  Encoding characterEncoding
           
private  int col
           
private  ErrorHandler errorHandler
           
private  int line
           
private  Locator locator
           
private  boolean prevWasCR
           
 
Fields inherited from class nu.validator.htmlparser.impl.MetaScanner
readable, stateSave
 
Constructor Summary
MetaSniffer(ErrorHandler eh, Locator locator)
           
 
Method Summary
private  void err(String message)
           
 int getColumnNumber()
           
 int getLineNumber()
           
 String getPublicId()
           
 String getSystemId()
           
protected  int read()
          -1 means end.
 Encoding sniff(ByteReadable readable)
          Main loop.
protected  boolean tryCharset(String encoding)
           
private  void warn(String message)
           
 
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
 

Field Detail

characterEncoding

private Encoding characterEncoding

errorHandler

private final ErrorHandler errorHandler

locator

private final Locator locator

line

private int line

col

private int col

prevWasCR

private boolean prevWasCR
Constructor Detail

MetaSniffer

public MetaSniffer(ErrorHandler eh,
                   Locator locator)
Method Detail

read

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

Overrides:
read in class MetaScanner
Returns:
Throws:
IOException

sniff

public Encoding sniff(ByteReadable readable)
               throws SAXException,
                      IOException
Main loop.

Returns:
Throws:
SAXException
IOException

err

private void err(String message)
          throws SAXException
Parameters:
string -
Throws:
SAXException

warn

private void warn(String message)
           throws SAXException
Parameters:
string -
Throws:
SAXException

getColumnNumber

public int getColumnNumber()
Specified by:
getColumnNumber in interface Locator

getLineNumber

public int getLineNumber()
Specified by:
getLineNumber in interface Locator

getPublicId

public String getPublicId()
Specified by:
getPublicId in interface Locator

getSystemId

public String getSystemId()
Specified by:
getSystemId in interface Locator

tryCharset

protected boolean tryCharset(String encoding)
                      throws SAXException
Specified by:
tryCharset in class MetaScanner
Throws:
SAXException