Home » openjdk-7 » javax » swing » text » rtf » [javadoc | source]
abstract class: RTFParser [javadoc | source]

All Implemented Interfaces:
    Flushable, Closeable

Direct Known Subclasses:

RTFParser is a subclass of AbstractFilter which understands basic RTF syntax and passes a stream of control words, text, and begin/end group indications to its subclass. Normally programmers will only use RTFFilter, a subclass of this class that knows what to do with the tokens this class parses.
Field Summary
public  int level    The current RTF group nesting level. 
 ByteArrayOutputStream binaryBuf     
protected  PrintStream warnings    A stream to which to write warnings and debugging information while parsing. This is set to System.out to log any anomalous information to stdout. 
static final  boolean[] rtfSpecialsTable     
Fields inherited from javax.swing.text.rtf.AbstractFilter:
translationTable,  specialsTable,  latin1TranslationTable,  noSpecialsTable,  allSpecialsTable
 public RTFParser() 
Method from javax.swing.text.rtf.RTFParser Summary:
begingroup,   close,   endgroup,   flush,   handleBinaryBlob,   handleKeyword,   handleKeyword,   handleText,   handleText,   warning,   write,   write,   writeSpecial
Methods from javax.swing.text.rtf.AbstractFilter:
readFromReader,   readFromStream,   write,   write,   write,   write,   writeSpecial
Methods from java.io.OutputStream:
close,   flush,   write,   write,   write
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.swing.text.rtf.RTFParser Detail:
 abstract public  void begingroup()
    Implemented by subclasses to react to an increase in the nesting level.
 public  void close() throws IOException 
    Closes the parser. Currently, this simply does a flush(), followed by some minimal consistency checks.
 abstract public  void endgroup()
    Implemented by subclasses to react to the end of a group.
 public  void flush() throws IOException 
    Flushes any buffered but not yet written characters. Subclasses which override this method should call this method before flushing any of their own buffers.
 abstract public  void handleBinaryBlob(byte[] data)
    Implemented by subclasses to handle the contents of the \bin keyword.
 abstract public boolean handleKeyword(String keyword)
    Implemented by subclasses to interpret a parameter-less RTF keyword. The keyword is passed without the leading '/' or any delimiting whitespace.
 abstract public boolean handleKeyword(String keyword,
    int parameter)
    Implemented by subclasses to interpret a keyword with a parameter.
 abstract public  void handleText(String text)
    Implemented by subclasses to interpret text from the RTF stream.
 public  void handleText(char ch) 
 protected  void warning(String s) 
 public  void write(String s) throws IOException 
 public  void write(char ch) throws IOException 
 public  void writeSpecial(int b) throws IOException