StyledDocument (the target).
The RTF is lexed
from the character stream by the RTFParser which is this class's
superclass.
This class is an indirect subclass of OutputStream. It must be closed
in order to guarantee that all of the text has been sent to
the text acceptor.
RTFParser, java.io.OutputStream
| Modifier and Type | Class and Description |
|---|---|
| pack-priv abstract class | RTFReader.
RTFReader.TextHandlingDestination is an abstract RTF destination which simply tracks the attributes specified by the RTF control words in internal form and can produce acceptable AttributeSets for the current character, paragraph, and section attributes. |
| pack-priv class | RTFReader.
Reads the colortbl group. |
| pack-priv static interface | RTFReader.
An interface (could be an entirely abstract class) describing a destination. |
| pack-priv static class | RTFReader.
This data-sink class is used to implement ignored destinations (e.g. {\*\blegga blah blah blah} ) It accepts all keywords and text but does nothing with them. |
| pack-priv class | RTFReader.
RTFReader.DocumentDestination is a concrete subclass of
TextHandlingDestination which appends the text to the
StyledDocument given by the |
| pack-priv class | RTFReader.
Reads the fonttbl group, inserting fonts into the RTFReader's fontTable dictionary. |
| pack-priv static class | RTFReader.
Handles the info group. |
| pack-priv class | RTFReader.
Handles the stylesheet keyword. |
| pack-priv abstract class | RTFReader.
RTFReader.TextHandlingDestination provides basic text handling functionality. |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | ANSI_CHARSET
Windows font charset |
| private static final int | |
| private static final int | |
| pack-priv static Dictionary | |
| pack-priv Map | characterStyles
This Map maps character style numbers to Style objects. |
| private static final int | |
| pack-priv Color[] | colorTable
This array maps color indices to Color objects. |
| private static final int | |
| pack-priv MutableAttributeSet | documentAttributes
This holds the current document attributes. |
| private static final int | |
| pack-priv Dictionary | fcharsetTable
This Dictionary maps Integer font numbers to Charset font charset. |
| pack-priv static Dictionary | fcharsetToCP
This Dictionary maps String font charset to String code page. |
| pack-priv Dictionary | fontTable
This Dictionary maps Integer font numbers to String font names. |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| pack-priv boolean | ignoreGroupIfUnknownKeyword
|
| private static final int | |
| private static final int | |
| private MockAttributeSet | |
| private static final int | |
| pack-priv Map | paragraphStyles
This Map maps paragraph style numbers to Style objects. |
| pack-priv Dictionary | parserState
Miscellaneous information about the parser's state. |
| private static final String | |
| pack-priv RTFReader. | rtfDestination
This is the "dst" item from parserState. |
| pack-priv int | rtfversion
This is the RTF version number, extracted from the \rtf keyword. |
| private static final int | |
| pack-priv Map | sectionStyles
This Map maps section style numbers to Style objects. |
| private static final int | |
| pack-priv int | skippingCharacters
The parameter of the most recently parsed \\ucN keyword, used for skipping alternative representations after a Unicode character. |
| private static Dictionary | |
| private static final int | |
| pack-priv static final String | |
| pack-priv static final String | |
| pack-priv StyledDocument | target
The object to which the parsed text is sent. |
| pack-priv static Dictionary | textKeywords
textKeywords maps RTF keywords to single-character strings, for those keywords which simply insert some text. |
| private static final int | |
| private static final int | |
| pack-priv static boolean | |
| private static final int |
| Access | Constructor and Description |
|---|---|
| public | RTFReader(StyledDocument
The TextAcceptor which is to receive the text. destination)Creates a new RTFReader instance. |
| Modifier and Type | Method and Description |
|---|---|
| public void | begingroup()
Implements abstract javax. Called by the superclass when a new RTF group is begun. |
| public void | close()
Overrides javax. Implements java. Called by the user when there is no more input (i.e., at the end of the RTF file.) |
| pack-priv Color | |
| public static void | defineCharacterSet(String name, char[] table)
Adds a character set to the RTFReader's list of known character sets |
| public void | endgroup()
Implements abstract javax. Called by the superclass when the current RTF group is closed. |
| public static Object | |
| public void | handleBinaryBlob(byte[] data)
Implements abstract javax. Called when the RTFParser encounters a bin keyword in the RTF stream. |
| public boolean | Returns: true if the keyword is recognized and handled; false otherwiseImplements abstract javax. Handles a parameterless RTF keyword. |
| public boolean | Returns: true if the keyword is recognized and handled; false otherwiseImplements abstract javax. Handles an RTF keyword and its integer parameter. |
| public void | handleText(String text)
Implements abstract javax. Handles any pure text (containing no control characters) in the input stream. |
| pack-priv static char[] | Returns: the newly read character setParses a character set from an InputStream. |
| pack-priv static char[] | |
| public void | setCharacterSet(String name)
setCharacterSet sets the current translation table to correspond with the named character set. |
| protected void | |
| private void |