Get Bounce at SourceForge.net. Fast secure and Free Open Source software downloads

org.bounce.text
Class DocumentInputReader

java.lang.Object
  extended by java.io.Reader
      extended by org.bounce.text.DocumentInputReader
All Implemented Interfaces:
java.io.Closeable, java.lang.Readable

public class DocumentInputReader
extends java.io.Reader

A Reader for XML input, which can handle escape characters.

Note: The XML Editor package is based on the JavaEditorKit example as described in the article 'Customizing a Text Editor' by Timothy Prinzing . See: http://java.sun.com/products/jfc/tsc/articles/text/editor_kit/

Version:
$Revision: 1.4 $, $Date: 2008/01/28 21:02:14 $
Author:
Edwin Dankert

Field Summary
 long pos
           
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
DocumentInputReader(javax.swing.text.Document document)
          Constructs the new input stream reader out of the Xml input strem.
 
Method Summary
 void close()
           
 int getLastChar()
          Returns the last read character.
 int read()
          Reads one character from the stream and increases the index.
 int read(char[] ac, int i, int j)
           
 void setRange(int start, int end)
          Sets the scan range of the reader.
 
Methods inherited from class java.io.Reader
mark, markSupported, read, read, ready, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pos

public long pos
Constructor Detail

DocumentInputReader

public DocumentInputReader(javax.swing.text.Document document)
Constructs the new input stream reader out of the Xml input strem.

Parameters:
inputstream - the XML input stream.
Throws:
java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
Method Detail

setRange

public void setRange(int start,
                     int end)
              throws java.io.IOException
Sets the scan range of the reader.

Parameters:
start - the start position.
end - the end position.
Throws:
java.io.IOException

read

public int read()
         throws java.io.IOException
Reads one character from the stream and increases the index.

Overrides:
read in class java.io.Reader
Returns:
the character or -1 for an eof.
Throws:
java.io.IOException

getLastChar

public int getLastChar()
Returns the last read character.

Returns:
the last read character or -1 for an eof.

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Specified by:
close in class java.io.Reader
Throws:
java.io.IOException

read

public int read(char[] ac,
                int i,
                int j)
         throws java.io.IOException
Specified by:
read in class java.io.Reader
Throws:
java.io.IOException

Get Bounce at SourceForge.net. Fast secure and Free Open Source software downloads

Copyright 2002-2002-2009 Edwin Dankert. All Rights Reserved.