Package nu.validator.htmlparser.io
Class MetaSniffer
- java.lang.Object
-
- nu.validator.htmlparser.impl.MetaScanner
-
- 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
Constructors Constructor Description MetaSniffer(org.xml.sax.ErrorHandler eh, org.xml.sax.Locator locator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
-
-
-
-
Method Detail
-
read
protected int read() throws java.io.IOException
-1 means end.- Overrides:
read
in classMetaScanner
- 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 interfaceorg.xml.sax.Locator
-
getLineNumber
public int getLineNumber()
- Specified by:
getLineNumber
in interfaceorg.xml.sax.Locator
-
getPublicId
public java.lang.String getPublicId()
- Specified by:
getPublicId
in interfaceorg.xml.sax.Locator
-
getSystemId
public java.lang.String getSystemId()
- Specified by:
getSystemId
in interfaceorg.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 classMetaScanner
- Returns:
true
if successful- Throws:
org.xml.sax.SAXException
-
-