Class RtfFile
- java.lang.Object
-
- org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement
-
- org.apache.fop.render.rtf.rtflib.rtfdoc.RtfContainer
-
- org.apache.fop.render.rtf.rtflib.rtfdoc.RtfFile
-
public class RtfFile extends RtfContainer
Models the top-level structure of an RTF file.
This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch), Andreas Putz (a.putz@skynamics.com), and Christopher Scott (scottc@westinghouse.com).
-
-
Field Summary
Fields Modifier and Type Field Description private RtfDocumentArea
docArea
private RtfHeader
header
private int
listNum
private RtfListTable
listTable
private RtfContainer
listTableContainer
private RtfPageArea
pageArea
-
Fields inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement
attrib, parent, writer
-
-
Constructor Summary
Constructors Constructor Description RtfFile(java.io.Writer w)
Create an RTF file that outputs to the given Writer
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
flush()
must be called when done creating the documentRtfDocumentArea
getDocumentArea()
Call startDocumentArea if needed and return the document area object.RtfListTable
getListTable()
Get the list table.RtfPageArea
getPageArea()
Call startPageArea if needed and return the page area object.static void
main(java.lang.String[] args)
minimal test and usage exampleRtfDocumentArea
startDocumentArea()
Closes the RtfHeader if not done yet, and starts the document area.RtfHeader
startHeader()
If called, must be called before startDocumentAreaRtfListTable
startListTable(RtfAttributes attr)
Creates the list table.RtfPageArea
startPageArea()
Closes the RtfHeader if not done yet, and starts the docment area.protected void
writeRtfPrefix()
overridden to write RTF prefix code, what comes before our childrenprotected void
writeRtfSuffix()
overridden to write RTF suffix code, what comes after our children-
Methods inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfContainer
addChild, containsText, dump, findChildren, getChildCount, getChildren, getOptions, isEmpty, okToWriteRtf, setChildren, setOptions, toString, writeRtfContent
-
Methods inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement
close, getParentOfClass, getRtfAttributes, getRtfFile, isClosed, newLine, writeAttributes, writeControlWord, writeControlWordNS, writeExceptionInRtf, writeGroupMark, writeOneAttribute, writeOneAttributeNS, writeRtf, writeStarControlWord, writeStarControlWordNS
-
-
-
-
Field Detail
-
header
private RtfHeader header
-
pageArea
private RtfPageArea pageArea
-
listTable
private RtfListTable listTable
-
docArea
private RtfDocumentArea docArea
-
listTableContainer
private RtfContainer listTableContainer
-
listNum
private int listNum
-
-
Method Detail
-
startHeader
public RtfHeader startHeader() throws java.io.IOException, RtfStructureException
If called, must be called before startDocumentArea- Returns:
- the new RtfHeader
- Throws:
java.io.IOException
- for I/O problemsRtfStructureException
- for illegal RTF structure
-
startListTable
public RtfListTable startListTable(RtfAttributes attr) throws java.io.IOException
Creates the list table.- Parameters:
attr
- attributes for the RtfListTable- Returns:
- the new RtfListTable
- Throws:
java.io.IOException
- for I/O problems
-
getListTable
public RtfListTable getListTable()
Get the list table.- Returns:
- the RtfListTable
-
startPageArea
public RtfPageArea startPageArea() throws java.io.IOException, RtfStructureException
Closes the RtfHeader if not done yet, and starts the docment area. Like startDocumentArea, is only called once. This is not optimal, must be able to have multiple page definition, and corresponding Document areas- Returns:
- the RtfPageArea
- Throws:
java.io.IOException
- for I/O problemsRtfStructureException
- for illegal RTF structure
-
getPageArea
public RtfPageArea getPageArea() throws java.io.IOException, RtfStructureException
Call startPageArea if needed and return the page area object.- Returns:
- the RtfPageArea
- Throws:
java.io.IOException
- for I/O problemsRtfStructureException
- for illegal RTF structure
-
startDocumentArea
public RtfDocumentArea startDocumentArea() throws java.io.IOException, RtfStructureException
Closes the RtfHeader if not done yet, and starts the document area. Must be called once only.- Returns:
- the RtfDocumentArea
- Throws:
java.io.IOException
- for I/O problemsRtfStructureException
- for illegal RTF structure
-
getDocumentArea
public RtfDocumentArea getDocumentArea() throws java.io.IOException, RtfStructureException
Call startDocumentArea if needed and return the document area object.- Returns:
- the RtfDocumentArea
- Throws:
java.io.IOException
- for I/O problemsRtfStructureException
- for illegal RTF structure
-
writeRtfPrefix
protected void writeRtfPrefix() throws java.io.IOException
overridden to write RTF prefix code, what comes before our children- Overrides:
writeRtfPrefix
in classRtfElement
- Throws:
java.io.IOException
- for I/O problems
-
writeRtfSuffix
protected void writeRtfSuffix() throws java.io.IOException
overridden to write RTF suffix code, what comes after our children- Overrides:
writeRtfSuffix
in classRtfElement
- Throws:
java.io.IOException
- for I/O problems
-
flush
public void flush() throws java.io.IOException
must be called when done creating the document- Throws:
java.io.IOException
- for I/O problems
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception
minimal test and usage example- Parameters:
args
- command-line arguments- Throws:
java.lang.Exception
- for problems
-
-