Class RtfElement
java.lang.Object
org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement
- Direct Known Subclasses:
RtfBookmark
,RtfContainer
,RtfExternalGraphic
,RtfGenerator
,RtfLineBreak
,RtfPageBreak
,RtfParagraphBreak
,RtfString
,RtfText
Base class for all elements of an RTF file.
This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch) and Andreas Putz (a.putz@skynamics.com).
-
Field Summary
Modifier and TypeFieldDescriptionprotected final RtfAttributes
attributes of the elementprotected final RtfContainer
parent elementprotected final Writer
Writer to be used -
Method Summary
Modifier and TypeMethodDescriptionfinal void
close()
Does nothing, meant to allow elements to write themselves without waiting for write(), but not implemented yetfind the first parent where c.isAssignableFrom(parent.getClass()) is trueAdded by Normand Masse Used for attribute inheritanceabstract boolean
isEmpty()
void
newLine()
Starts a new line in the RTF file being written.protected boolean
can be overridden to suppress all RTF outputtoString()
minimal debugging displayprotected void
writeAttributes
(RtfAttributes attr, String[] nameList) Write given attribute values to our Writerprotected final void
writeControlWord
(String word) Write an RTF control word to our Writerprotected final void
writeControlWordNS
(String word) Write rtf control word without the space behind itprotected void
Make a visible entry in the RTF for an exceptionprotected final void
writeGroupMark
(boolean isStart) Write a start or end group markprotected void
writeOneAttribute
(String name, Object value) Write one attribute to our Writerprotected void
writeOneAttributeNS
(String name, Object value) Write one attribute to our Writer without a spacefinal void
writeRtf()
Write the RTF code of this element to our Writerprotected abstract void
Must be implemented to write RTF content to m_writerprotected void
Called before writeRtfContent()protected void
Called after writeRtfContent()protected final void
writeStarControlWord
(String word) Write an RTF control word to our Writer, preceeded by a star '*' meaning "ignore this if you don't know what it means"protected final void
writeStarControlWordNS
(String word) Same as writeStarControlWord(String word), except with no space behind it
-
Field Details
-
writer
Writer to be used -
parent
parent element -
attrib
attributes of the element
-
-
Method Details
-
close
Does nothing, meant to allow elements to write themselves without waiting for write(), but not implemented yet- Throws:
IOException
- for I/O problems
-
writeRtf
Write the RTF code of this element to our Writer- Throws:
IOException
- for I/O problems
-
newLine
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.- Throws:
IOException
- in case of an I/O problem
-
writeControlWord
Write an RTF control word to our Writer- Parameters:
word
- RTF control word to write- Throws:
IOException
- for I/O problems
-
writeStarControlWord
Write an RTF control word to our Writer, preceeded by a star '*' meaning "ignore this if you don't know what it means"- Parameters:
word
- RTF control word to write- Throws:
IOException
- for I/O problems
-
writeStarControlWordNS
Same as writeStarControlWord(String word), except with no space behind it- Parameters:
word
- RTF control word to write- Throws:
IOException
- for I/O problems
-
writeControlWordNS
Write rtf control word without the space behind it- Parameters:
word
- RTF control word to write- Throws:
IOException
- for I/O problems
-
writeRtfPrefix
Called before writeRtfContent()- Throws:
IOException
- for I/O problems
-
writeRtfContent
Must be implemented to write RTF content to m_writer- Throws:
IOException
- for I/O problems
-
writeRtfSuffix
Called after writeRtfContent()- Throws:
IOException
- for I/O problems
-
writeGroupMark
Write a start or end group mark- Parameters:
isStart
- set to true if this is a start mark- Throws:
IOException
- for I/O problems
-
writeAttributes
Write given attribute values to our Writer- Parameters:
attr
- RtfAttributes to be writtennameList
- if given, only attribute names from this list are considered- Throws:
IOException
- for I/O problems
-
writeOneAttribute
Write one attribute to our Writer- Parameters:
name
- name of attribute to writevalue
- value of attribute to be written- Throws:
IOException
- for I/O problems
-
writeOneAttributeNS
Write one attribute to our Writer without a space- Parameters:
name
- name of attribute to writevalue
- value of attribute to be written- Throws:
IOException
- for I/O problems
-
okToWriteRtf
protected boolean okToWriteRtf()can be overridden to suppress all RTF output- Returns:
- true if this object can be written into the RTF
-
toString
minimal debugging display -
getParentOfClass
find the first parent where c.isAssignableFrom(parent.getClass()) is true- Returns:
- null if not found
-
isEmpty
public abstract boolean isEmpty()- Returns:
- true if this element would generate no "useful" RTF content
-
writeExceptionInRtf
Make a visible entry in the RTF for an exception- Parameters:
ie
- Exception to flag- Throws:
IOException
- for I/O problems
-
getRtfAttributes
Added by Normand Masse Used for attribute inheritance- Returns:
- RtfAttributes
-