Base class for all elements of an RTF file.
close
public final void close()
throws IOException
Does nothing, meant to allow elements to write themselves without waiting
for write(), but not implemented yet
getRtfAttributes
public RtfAttributes getRtfAttributes()
Added by Normand Masse
Used for attribute inheritance
isEmpty
public abstract boolean isEmpty()
- true if this element would generate no "useful" RTF content
newLine
public void newLine()
throws IOException
Starts a new line in the RTF file being written. This is only to format
the RTF file itself (for easier debugging), not its content.
okToWriteRtf
protected boolean okToWriteRtf()
can be overridden to suppress all RTF output
- true if this object can be written into the RTF
toString
public String toString()
minimal debugging display
- String representation of object
writeAttributes
protected void writeAttributes(RtfAttributes attr,
String[] nameList)
throws IOException
Write given attribute values to our Writer
attr
- RtfAttributes to be writtennameList
- if given, only attribute names from this list are considered
writeControlWord
protected final void writeControlWord(String word)
throws IOException
Write an RTF control word to our Writer
word
- RTF control word to write
writeControlWordNS
protected final void writeControlWordNS(String word)
throws IOException
Write rtf control word without the space behind it
word
- RTF control word to write
writeExceptionInRtf
protected void writeExceptionInRtf(Exception ie)
throws IOException
Make a visible entry in the RTF for an exception
writeGroupMark
protected final void writeGroupMark(boolean isStart)
throws IOException
Write a start or end group mark
isStart
- set to true if this is a start mark
writeOneAttribute
protected void writeOneAttribute(String name,
Object value)
throws IOException
Write one attribute to our Writer
name
- name of attribute to writevalue
- value of attribute to be written
writeOneAttributeNS
protected void writeOneAttributeNS(String name,
Object value)
throws IOException
Write one attribute to our Writer without a space
name
- name of attribute to writevalue
- value of attribute to be written
writeRtf
public final void writeRtf()
throws IOException
Write the RTF code of this element to our Writer
writeRtfContent
protected abstract void writeRtfContent()
throws IOException
Must be implemented to write RTF content to m_writer
writeRtfPrefix
protected void writeRtfPrefix()
throws IOException
Called before writeRtfContent()
writeRtfSuffix
protected void writeRtfSuffix()
throws IOException
Called after writeRtfContent()
writeStarControlWord
protected final void writeStarControlWord(String word)
throws IOException
Write an RTF control word to our Writer, preceeded by a star '*'
meaning "ignore this if you don't know what it means"
word
- RTF control word to write
writeStarControlWordNS
protected final void writeStarControlWordNS(String word)
throws IOException
Same as writeStarControlWord(String word), except with no space behind it
word
- RTF control word to write