Class HTMLScanner.CurrentEntity

  • Enclosing class:
    HTMLScanner

    static final class HTMLScanner.CurrentEntity
    extends java.lang.Object
    Current entity.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.lang.String baseSystemId
      Base system identifier.
      (package private) char[] buffer_
      Character buffer.
      private int characterOffset_
      Character offset in the file.
      private int columnNumber_
      Column number.
      (package private) java.lang.String encoding_
      Encoding.
      private boolean endReached_  
      (package private) int length_
      Length of characters read into character buffer.
      private int lineNumber_
      Line number.
      java.lang.String literalSystemId
      Literal system identifier.
      (package private) int offset_
      Offset into character buffer.
      java.lang.String publicId
      Public identifier.
      private java.io.Reader reader_
      Character stream.
      (package private) java.lang.String systemId
      Expanded system identifier.
      java.lang.String version
      XML version.
    • Constructor Summary

      Constructors 
      Constructor Description
      CurrentEntity​(java.io.Reader reader, int readerBufferSize, java.lang.String encoding, java.lang.String publicId, java.lang.String baseSystemId, java.lang.String literalSystemId, java.lang.String systemId)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) void closeQuietly()  
      private void debugBufferIfNeeded​(java.lang.String prefix)
      Prints the contents of the character buffer to standard out.
      private void debugBufferIfNeeded​(java.lang.String prefix, java.lang.String suffix)
      Prints the contents of the character buffer to standard out.
      (package private) int getCharacterOffset()  
      (package private) int getColumnNumber()  
      (package private) char getCurrentChar()  
      int getLineNumber()  
      (package private) char getNextChar()  
      (package private) boolean hasNext()
      Indicates if there are characters left.
      (package private) void incLine()  
      (package private) void incLine​(int nbLines)  
      (package private) int load​(int loadOffset)
      Loads a new chunk of data into the buffer and returns the number of characters loaded or -1 if no additional characters were loaded.
      (package private) int loadWholeBuffer()  
      (package private) java.lang.String nextContent​(int len)
      Reads the next characters WITHOUT impacting the buffer content up to current offset.
      (package private) int read()  
      (package private) int readPreservingBufferContent()  
      (package private) void resetBuffer​(XMLString xmlBuffer, int lineNumber, int columnNumber, int characterOffset)  
      (package private) void rewind()
      Goes back, canceling the effect of the previous read() call.
      (package private) void rewind​(int i)  
      (package private) void setStream​(java.io.Reader inputStreamReader, java.lang.String encoding)  
      (package private) boolean skip​(java.lang.String expectedInUpperCase)  
      (package private) boolean skipMarkup​(boolean balance)  
      (package private) int skipNewlines()  
      (package private) boolean skipSpaces()  
      • Methods inherited from class java.lang.Object

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

      • reader_

        private java.io.Reader reader_
        Character stream.
      • encoding_

        java.lang.String encoding_
        Encoding.
      • publicId

        public final java.lang.String publicId
        Public identifier.
      • baseSystemId

        public final java.lang.String baseSystemId
        Base system identifier.
      • literalSystemId

        public final java.lang.String literalSystemId
        Literal system identifier.
      • systemId

        final java.lang.String systemId
        Expanded system identifier.
      • lineNumber_

        private int lineNumber_
        Line number.
      • columnNumber_

        private int columnNumber_
        Column number.
      • characterOffset_

        private int characterOffset_
        Character offset in the file.
      • buffer_

        char[] buffer_
        Character buffer.
      • offset_

        int offset_
        Offset into character buffer.
      • length_

        int length_
        Length of characters read into character buffer.
      • endReached_

        private boolean endReached_
    • Constructor Detail

      • CurrentEntity

        CurrentEntity​(java.io.Reader reader,
                      int readerBufferSize,
                      java.lang.String encoding,
                      java.lang.String publicId,
                      java.lang.String baseSystemId,
                      java.lang.String literalSystemId,
                      java.lang.String systemId)
    • Method Detail

      • getCurrentChar

        char getCurrentChar()
      • getNextChar

        char getNextChar()
        Returns:
        the current character and moves to next one.
      • closeQuietly

        void closeQuietly()
      • hasNext

        boolean hasNext()
        Indicates if there are characters left.
      • load

        int load​(int loadOffset)
          throws java.io.IOException
        Loads a new chunk of data into the buffer and returns the number of characters loaded or -1 if no additional characters were loaded.
        Parameters:
        loadOffset - The offset at which new characters should be loaded.
        Returns:
        count
        Throws:
        java.io.IOException - in case of io problems
      • loadWholeBuffer

        int loadWholeBuffer()
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • read

        int read()
          throws java.io.IOException
        Throws:
        java.io.IOException
      • nextContent

        java.lang.String nextContent​(int len)
                              throws java.io.IOException
        Reads the next characters WITHOUT impacting the buffer content up to current offset.
        Parameters:
        len - the number of characters to read
        Returns:
        the read string (length may be smaller if EOF is encountered)
        Throws:
        java.io.IOException - in case of io problems
      • readPreservingBufferContent

        int readPreservingBufferContent()
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • debugBufferIfNeeded

        private void debugBufferIfNeeded​(java.lang.String prefix)
        Prints the contents of the character buffer to standard out.
      • debugBufferIfNeeded

        private void debugBufferIfNeeded​(java.lang.String prefix,
                                         java.lang.String suffix)
        Prints the contents of the character buffer to standard out.
      • setStream

        void setStream​(java.io.Reader inputStreamReader,
                       java.lang.String encoding)
      • rewind

        void rewind()
        Goes back, canceling the effect of the previous read() call.
      • rewind

        void rewind​(int i)
      • incLine

        void incLine()
      • incLine

        void incLine​(int nbLines)
      • getLineNumber

        public int getLineNumber()
      • resetBuffer

        void resetBuffer​(XMLString xmlBuffer,
                         int lineNumber,
                         int columnNumber,
                         int characterOffset)
      • getColumnNumber

        int getColumnNumber()
      • getCharacterOffset

        int getCharacterOffset()
      • skip

        boolean skip​(java.lang.String expectedInUpperCase)
              throws java.io.IOException
        Throws:
        java.io.IOException
      • skipMarkup

        boolean skipMarkup​(boolean balance)
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • skipSpaces

        boolean skipSpaces()
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • skipNewlines

        int skipNewlines()
                  throws java.io.IOException
        Throws:
        java.io.IOException