Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

javax.swing.text.rtf
Class RTFScanner  view RTFScanner download RTFScanner.java

java.lang.Object
  extended byjavax.swing.text.rtf.RTFScanner

class RTFScanner
extends java.lang.Object

Provides a scanner that scans an java.io.InputStream for tokens of the RTF syntax. This scanner is based upon the RTF specification 1.6 available at: RTF specification at MSDN


Field Summary
private  java.lang.StringBuffer buffer
          This is used to constuct strings from the read in chars.
private  java.io.Reader in
          The reader from which we read the RTF data.
 
Constructor Summary
private RTFScanner()
          Constructs a new RTFScanner without initializing the java.io.Reader.
  RTFScanner(java.io.InputStream stream)
          Constructs a new RTFScanner for the given java.io.InputStream.
  RTFScanner(java.io.Reader reader)
          Constructs a new RTFScanner for the given java.io.Reader.
 
Method Summary
private  Token readControlWord()
          Reads in a control word and optional parameter.
private  Token readText()
          Reads in a block of text.
 Token readToken()
          Reads in the next Token from the stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

in

private java.io.Reader in
The reader from which we read the RTF data.


buffer

private java.lang.StringBuffer buffer
This is used to constuct strings from the read in chars.

Constructor Detail

RTFScanner

private RTFScanner()
Constructs a new RTFScanner without initializing the java.io.Reader.


RTFScanner

public RTFScanner(java.io.InputStream stream)
Constructs a new RTFScanner for the given java.io.InputStream. The stream is wrapped into an java.io.InputStreamReader and if it's not yet buffered then the Reader is wrapped in a java.io.BufferedReader


RTFScanner

public RTFScanner(java.io.Reader reader)
Constructs a new RTFScanner for the given java.io.Reader. If the reader is not an instance of java.io.BufferedReader then it is wrapped into a BufferedReader.

Method Detail

readToken

public Token readToken()
                throws java.io.IOException
Reads in the next Token from the stream.


readControlWord

private Token readControlWord()
                       throws java.io.IOException
Reads in a control word and optional parameter.


readText

private Token readText()
                throws java.io.IOException
Reads in a block of text.