Enhydra 5.1 API

org.enhydra.xml.xmlc.misc
Class LineNumberMapReader

java.lang.Object
  |
  +--java.io.Reader
        |
        +--org.enhydra.xml.xmlc.misc.LineNumberMapReader

public final class LineNumberMapReader
extends java.io.Reader

A file reader that keeps a map of chararacter offsets to line numbers. This is used by the Swing HTML parser interface to provide reasonable error messages.


Field Summary
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
LineNumberMapReader(InputSource inputSource)
          Construct a new reader for the specified file.
 
Method Summary
 void close()
          Close the stream.
 LineNumberMap getLineNumberMap()
          Get the line number map.
 int read()
          Read a character.
 int read(char[] cbuf, int off, int len)
          Read characters into a portion of an array.
 
Methods inherited from class java.io.Reader
mark, markSupported, read, ready, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LineNumberMapReader

public LineNumberMapReader(InputSource inputSource)
                    throws java.io.IOException
Construct a new reader for the specified file.

Method Detail

getLineNumberMap

public final LineNumberMap getLineNumberMap()
Get the line number map.


read

public int read()
         throws java.io.IOException
Read a character.

Overrides:
read in class java.io.Reader
Throws:
java.io.IOException - If an I/O error occurs
See Also:
Reader.read()

read

public int read(char[] cbuf,
                int off,
                int len)
         throws java.io.IOException
Read characters into a portion of an array.

Specified by:
read in class java.io.Reader
Throws:
java.io.IOException - If an I/O error occurs
See Also:
Reader.read()

close

public void close()
           throws java.io.IOException
Close the stream.

Specified by:
close in class java.io.Reader
Throws:
java.io.IOException - If an I/O error occurs
See Also:
Reader.close()

Enhydra 5.1 API