com.lowagie.text.rtf.parser.destinations

Class RtfDestination

public abstract class RtfDestination extends Object

RtfDestination is the base class for destinations according to the RTF Specification. All destinations must extend from this class.

Since: 2.0.8

Author: Howard Shank (hgshank@yahoo.com

Field Summary
protected RtfCtrlWordDatalastCtrlWord
The last control word handled by this destination
static ArrayListlisteners
The RtfDestinationListener.
protected booleanmodified
Is data in destination modified?
protected RtfParserrtfParser
Parser object
Constructor Summary
RtfDestination()
Constructor.
RtfDestination(RtfParser parser)
Constructor
Method Summary
booleanaddListener(RtfDestinationListener listener)
Adds a RtfDestinationListener to the RtfDestinationMgr.
protected intafterCharacter(int ch)
protected RtfCtrlWordDataafterCtrlWord(RtfCtrlWordData ctrlWordData)
protected intbeforeCharacter(int ch)
protected RtfCtrlWordDatabeforeCtrlWord(RtfCtrlWordData ctrlWordData)
abstract booleancloseDestination()
Clean up when destination is closed.
intgetNewTokeniserState()
abstract booleanhandleCharacter(int ch)
Handle text for this destination
abstract booleanhandleCloseGroup()
Clean up when group is closed.
abstract booleanhandleControlWord(RtfCtrlWordData ctrlWordData)
Handle control word for this destination
abstract booleanhandleOpenGroup()
Setup when group is opened.
abstract booleanhandleOpeningSubGroup()
Handle a new subgroup contained within this group
booleanisModified()
Method to indicate if data in this destination has changed.
protected intonCharacter(int ch)
protected booleanonCloseGroup()
protected RtfCtrlWordDataonCtrlWord(RtfCtrlWordData ctrlWordData)
protected booleanonOpenGroup()
booleanremoveListener(RtfDestinationListener listener)
Removes a RtfDestinationListener from the RtfDestinationMgr.
voidsetParser(RtfParser parser)
Set the parser to use with the RtfDestination object.
abstract voidsetToDefaults()
Method to set this object to the default values.

Field Detail

lastCtrlWord

protected RtfCtrlWordData lastCtrlWord
The last control word handled by this destination

listeners

private static ArrayList listeners
The RtfDestinationListener.

modified

protected boolean modified
Is data in destination modified?

rtfParser

protected RtfParser rtfParser
Parser object

Constructor Detail

RtfDestination

public RtfDestination()
Constructor.

RtfDestination

public RtfDestination(RtfParser parser)
Constructor

Parameters: parser RtfParser object.

Method Detail

addListener

public boolean addListener(RtfDestinationListener listener)
Adds a RtfDestinationListener to the RtfDestinationMgr.

Parameters: listener the new RtfDestinationListener.

afterCharacter

protected int afterCharacter(int ch)

afterCtrlWord

protected RtfCtrlWordData afterCtrlWord(RtfCtrlWordData ctrlWordData)

beforeCharacter

protected int beforeCharacter(int ch)

beforeCtrlWord

protected RtfCtrlWordData beforeCtrlWord(RtfCtrlWordData ctrlWordData)

closeDestination

public abstract boolean closeDestination()
Clean up when destination is closed.

Returns: true if handled, false if not handled

getNewTokeniserState

public int getNewTokeniserState()

handleCharacter

public abstract boolean handleCharacter(int ch)
Handle text for this destination

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

handleControlWord

public abstract boolean handleControlWord(RtfCtrlWordData ctrlWordData)
Handle control word for this destination

Parameters: ctrlWordData The control word and parameter information object

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

handleOpeningSubGroup

public abstract boolean handleOpeningSubGroup()
Handle a new subgroup contained within this group

Returns: true if handled, false if not handled

isModified

public boolean isModified()
Method to indicate if data in this destination has changed.

Returns: true if modified, false if not modified.

onCharacter

protected int onCharacter(int ch)

onCloseGroup

protected boolean onCloseGroup()

Returns: true if all goes well

onCtrlWord

protected RtfCtrlWordData onCtrlWord(RtfCtrlWordData ctrlWordData)

onOpenGroup

protected boolean onOpenGroup()

Returns: true if all goes well

removeListener

public boolean removeListener(RtfDestinationListener listener)
Removes a RtfDestinationListener from the RtfDestinationMgr.

Parameters: listener the RtfCtrlWordListener that has to be removed.

setParser

public void setParser(RtfParser parser)
Set the parser to use with the RtfDestination object.

Parameters: parser The RtfParser object.

setToDefaults

public abstract void setToDefaults()
Method to set this object to the default values. Must be implemented in child class.