# Class MetaSniffer

java.lang.Object
nu.validator.htmlparser.impl.MetaScanner
nu.validator.htmlparser.io.MetaSniffer

All Implemented Interfaces:
  `Locator2, Locator`

public class MetaSniffer extends MetaScanner implements Locator, Locator2

## Field Summary

### Fields inherited from class MetaScanner

`readable, stateSave`

## Constructor Summary

Constructors
Constructor
Description
`MetaSniffer(ErrorHandler eh, Locator locator)`

## Method Summary

Modifier and Type
Method
Description
`int`
`getColumnNumber()`
`String`
`getEncoding()`
`int`
`getLineNumber()`
`String`
`getPublicId()`
`String`
`getSystemId()`
`String`
`getXMLVersion()`
`protected int`
`read()`
-1 means end.
`Encoding`
`sniff(ByteReadable readable)`
Main loop.
`protected boolean`
`tryCharset(String encoding)`
Tries to switch to an encoding.

### Methods inherited from class MetaScanner

`stateLoop`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### MetaSniffer

public MetaSniffer(ErrorHandler eh, Locator locator)

## Method Details

### 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`

### 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`

### getXMLVersion

public String getXMLVersion()

Specified by:
  `getXMLVersion` in interface `Locator2`

### getEncoding

public String getEncoding()

Specified by:
  `getEncoding` in interface `Locator2`

### tryCharset

protected boolean tryCharset(String encoding) throws SAXException
Description copied from class: `MetaScanner`
Tries to switch to an encoding.

Specified by:
  `tryCharset` in class `MetaScanner`
Parameters:
  `encoding` -
Returns:
  `true` if successful
Throws:
  `SAXException`