Class MetaScanner

  • Direct Known Subclasses:
    MetaSniffer

    public abstract class MetaScanner
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected ByteReadable readable
      The data source.
      protected int stateSave
      The tokenizer state.
    • Constructor Summary

      Constructors 
      Constructor Description
      MetaScanner()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected int read()
      Reads a byte from the data source.
      protected void stateLoop​(int state)
      The runs the meta scanning algorithm.
      protected abstract boolean tryCharset​(java.lang.String encoding)
      Tries to switch to an encoding.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • readable

        protected ByteReadable readable
        The data source.
      • stateSave

        protected int stateSave
        The tokenizer state.
    • Constructor Detail

      • MetaScanner

        public MetaScanner()
    • Method Detail

      • read

        protected int read()
                    throws java.io.IOException
        Reads a byte from the data source. -1 means end.
        Returns:
        Throws:
        java.io.IOException
      • stateLoop

        protected final void stateLoop​(int state)
                                throws org.xml.sax.SAXException,
                                       java.io.IOException
        The runs the meta scanning algorithm.
        Throws:
        org.xml.sax.SAXException
        java.io.IOException
      • tryCharset

        protected abstract boolean tryCharset​(java.lang.String encoding)
                                       throws org.xml.sax.SAXException
        Tries to switch to an encoding.
        Parameters:
        encoding -
        Returns:
        true if successful
        Throws:
        org.xml.sax.SAXException