|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lowagie.text.rtf.direct.RtfParser
public class RtfParser
The RtfParser allows the importing of RTF documents or RTF document fragments. The RTF document or fragment is tokenised, font and color definitions corrected and then added to the document being written.
Field Summary | |
---|---|
private RtfColorTableParser |
colorTableParser
The RtfColorTableParser to use for parsing the color table. |
private RtfFontTableParser |
fontTableParser
The RtfFontTableParser to use for parsing the font table. |
private RtfImportHeader |
importHeader
The RtfImportHeader to store imported font and color mappings in. |
private static int |
PARSER_IN_COLOR_TABLE
Currently the RTF color table is being parsed. |
private static int |
PARSER_IN_DOCUMENT
Currently the RTF document content is being parsed. |
private static int |
PARSER_IN_FONT_TABLE
Currently the RTF font table is being parsed. |
private static int |
PARSER_IN_HEADER
Currently the RTF document header is being parsed. |
private static int |
PARSER_IN_INFO_GROUP
Currently the RTF info group is being parsed. |
private RtfDocument |
rtfDoc
The RtfDocument to add the RTF document or fragment to. |
private int |
state
The current parser state. |
private RtfTokeniser |
tokeniser
The RtfTokeniser to use for tokenising the RTF document or fragment. |
Constructor Summary | |
---|---|
RtfParser()
|
Method Summary | |
---|---|
void |
handleCloseGroup(int groupLevel)
Handles close group tokens. |
void |
handleCtrlCharacter(String ctrlCharacter,
int groupLevel)
Handles single control character tokens. |
void |
handleCtrlWord(String ctrlWord,
int groupLevel)
Handles control word tokens. |
private void |
handleImportMappings(RtfImportMappings importMappings)
Imports the mappings defined in the RtfImportMappings into the RtfImportHeader of this RtfParser. |
void |
handleOpenGroup(int groupLevel)
Handles open group tokens. |
void |
handleText(String text,
int groupLevel)
Handles text tokens. |
void |
importRtfDocument(Reader reader,
RtfDocument rtfDoc)
Imports a complete RTF document. |
void |
importRtfFragment(Reader reader,
RtfDocument rtfDoc,
RtfImportMappings importMappings)
Imports an RTF fragment. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int PARSER_IN_HEADER
private static final int PARSER_IN_FONT_TABLE
private static final int PARSER_IN_COLOR_TABLE
private static final int PARSER_IN_INFO_GROUP
private static final int PARSER_IN_DOCUMENT
private RtfDocument rtfDoc
private RtfTokeniser tokeniser
private RtfImportHeader importHeader
private RtfFontTableParser fontTableParser
private RtfColorTableParser colorTableParser
private int state
Constructor Detail |
---|
public RtfParser()
Method Detail |
---|
public void importRtfDocument(Reader reader, RtfDocument rtfDoc) throws IOException
reader
- The Reader to read the RTF document from.rtfDoc
- The RtfDocument to add the imported document to.
IOException
- On I/O errors.public void importRtfFragment(Reader reader, RtfDocument rtfDoc, RtfImportMappings importMappings) throws IOException
reader
- The Reader to read the RTF fragment from.rtfDoc
- The RTF document to add the RTF fragment to.importMappings
- The RtfImportMappings defining font and color mappings for the fragment.
IOException
- On I/O errors.private void handleImportMappings(RtfImportMappings importMappings)
importMappings
- The RtfImportMappings to import.public void handleOpenGroup(int groupLevel)
groupLevel
- The current group nesting level.public void handleCloseGroup(int groupLevel)
groupLevel
- The current group nesting level.public void handleCtrlCharacter(String ctrlCharacter, int groupLevel)
ctrlCharacter
- The control character to handle.groupLevel
- The current group nesting level.public void handleCtrlWord(String ctrlWord, int groupLevel)
ctrlWord
- The control word to handle.groupLevel
- The current group nesting level.public void handleText(String text, int groupLevel)
text
- The text token to handle.groupLevel
- The current group nesting level.
|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |