Class RtfDestination
java.lang.Object
com.lowagie.text.rtf.parser.destinations.RtfDestination
- Direct Known Subclasses:
RtfDestinationColorTable, RtfDestinationDocument, RtfDestinationFontTable, RtfDestinationInfo, RtfDestinationListTable, RtfDestinationNull, RtfDestinationShppict, RtfDestinationStylesheetTable
RtfDestination is the base class for destinations according
to the RTF Specification. All destinations must extend from this class.- Since:
- 2.0.8
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected RtfCtrlWordDataThe last control word handled by this destinationprivate static final List<RtfDestinationListener> TheRtfDestinationListener.protected booleanIs data in destination modified?protected RtfParserParser object -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddListener(RtfDestinationListener listener) Adds aRtfDestinationListenerto theRtfDestinationMgr.protected intafterCharacter(int ch) protected RtfCtrlWordDataafterCtrlWord(RtfCtrlWordData ctrlWordData) protected intbeforeCharacter(int ch) protected RtfCtrlWordDatabeforeCtrlWord(RtfCtrlWordData ctrlWordData) abstract booleanClean up when destination is closed.intabstract booleanhandleCharacter(int ch) Handle text for this destinationabstract booleanClean up when group is closed.abstract booleanhandleControlWord(RtfCtrlWordData ctrlWordData) Handle control word for this destinationabstract booleanSetup when group is opened.abstract booleanHandle a new subgroup contained within this groupbooleanMethod to indicate if data in this destination has changed.protected intonCharacter(int ch) protected booleanprotected RtfCtrlWordDataonCtrlWord(RtfCtrlWordData ctrlWordData) protected booleanbooleanremoveListener(RtfDestinationListener listener) Removes aRtfDestinationListenerfrom theRtfDestinationMgr.voidSet the parser to use with the RtfDestination object.abstract voidMethod to set this object to the default values.
-
Field Details
-
rtfParser
Parser object -
modified
protected boolean modifiedIs data in destination modified? -
lastCtrlWord
The last control word handled by this destination -
listeners
TheRtfDestinationListener.
-
-
Constructor Details
-
RtfDestination
public RtfDestination()Constructor. -
RtfDestination
-
-
Method Details
-
setParser
Set the parser to use with the RtfDestination object.- Parameters:
parser- The RtfParser object.
-
closeDestination
public abstract boolean closeDestination()Clean up when destination is closed.- Returns:
- true if handled, false if not handled
-
handleOpeningSubGroup
public abstract boolean handleOpeningSubGroup()Handle a new subgroup contained within this group- Returns:
- true if handled, false if not handled
-
handleCloseGroup
public abstract boolean handleCloseGroup()Clean up when group is closed.- Returns:
- true if handled, false if not handled
-
handleOpenGroup
public abstract boolean handleOpenGroup()Setup when group is opened.- Returns:
- true if handled, false if not handled
-
handleCharacter
public abstract boolean handleCharacter(int ch) Handle text for this destination- Returns:
- true if handled, false if not handled
-
handleControlWord
Handle control word for this destination- Parameters:
ctrlWordData- The control word and parameter information object- Returns:
- true if handled, false if not handled
-
setToDefaults
public abstract void setToDefaults()Method to set this object to the default values. Must be implemented in child class. -
isModified
public boolean isModified()Method to indicate if data in this destination has changed.- Returns:
- true if modified, false if not modified.
-
addListener
Adds aRtfDestinationListenerto theRtfDestinationMgr.- Parameters:
listener- the new RtfDestinationListener.
-
removeListener
Removes aRtfDestinationListenerfrom theRtfDestinationMgr.- Parameters:
listener- the RtfCtrlWordListener that has to be removed.
-
beforeCtrlWord
-
onCtrlWord
-
afterCtrlWord
-
beforeCharacter
protected int beforeCharacter(int ch) -
onCharacter
protected int onCharacter(int ch) -
afterCharacter
protected int afterCharacter(int ch) -
onOpenGroup
protected boolean onOpenGroup()- Returns:
- true if all goes well
-
onCloseGroup
protected boolean onCloseGroup()- Returns:
- true if all goes well
-
getNewTokeniserState
public int getNewTokeniserState()
-