Package nu.validator.htmlparser.io
Class MetaSniffer
java.lang.Object
nu.validator.htmlparser.impl.MetaScanner
nu.validator.htmlparser.io.MetaSniffer
- All Implemented Interfaces:
Locator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Encoding
private int
private final ErrorHandler
private int
private final Locator
private boolean
Fields inherited from class nu.validator.htmlparser.impl.MetaScanner
readable, stateSave
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
int
int
protected int
read()
-1 means end.sniff
(ByteReadable readable) Main loop.protected boolean
tryCharset
(String encoding) Tries to switch to an encoding.private void
Methods inherited from class nu.validator.htmlparser.impl.MetaScanner
stateLoop
-
Field Details
-
characterEncoding
-
errorHandler
-
locator
-
line
private int line -
col
private int col -
prevWasCR
private boolean prevWasCR
-
-
Constructor Details
-
MetaSniffer
-
-
Method Details
-
read
-1 means end.- Overrides:
read
in classMetaScanner
- Returns:
- Throws:
IOException
-
sniff
Main loop.- Returns:
- Throws:
SAXException
IOException
-
err
- Parameters:
string
-- Throws:
SAXException
-
warn
- Parameters:
string
-- Throws:
SAXException
-
getColumnNumber
public int getColumnNumber()- Specified by:
getColumnNumber
in interfaceLocator
-
getLineNumber
public int getLineNumber()- Specified by:
getLineNumber
in interfaceLocator
-
getPublicId
- Specified by:
getPublicId
in interfaceLocator
-
getSystemId
- Specified by:
getSystemId
in interfaceLocator
-
tryCharset
Description copied from class:MetaScanner
Tries to switch to an encoding.- Specified by:
tryCharset
in classMetaScanner
- Parameters:
encoding
-- Returns:
true
if successful- Throws:
SAXException
-