Class BuilderContext
java.lang.Object
org.apache.fop.render.rtf.rtflib.tools.BuilderContext
A BuilderContext holds context information when building an RTF document.
This class was originally developed by Bertrand Delacretaz bdelacretaz@codeconsult.ch for the JFOR project and is now integrated into FOP.This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch), Andreas Putz (a.putz@skynamics.com), and Peter Herweg (pherweg@web.de).
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final org.apache.commons.logging.Log
Static logging instance -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetContainer
(Class containerClass, boolean required, Object forWhichBuilder) Find the "nearest" container that implements the given interface on our stack.void
popContainer
(Class containerClass, RTFHandler handler) pop the topmost RtfContainer from our stackvoid
popPart
(Class part, RTFHandler handler) pop the topmost part class from our stackvoid
Pop a TableContext from our stack.void
Push an RtfContainer on our stack.void
Push a Class representing a non-writeable section of the FO treevoid
Push a TableContext to our stack.void
replaceContainer
(RtfContainer oldC, RtfContainer newC) In some cases an RtfContainer must be replaced by another one on the stack.
-
Field Details
-
LOG
protected static final org.apache.commons.logging.Log LOGStatic logging instance
-
-
Constructor Details
-
BuilderContext
Construct a builder context.- Parameters:
rtfOptions
- some options
-
-
Method Details
-
getContainer
public RtfContainer getContainer(Class containerClass, boolean required, Object forWhichBuilder) throws RtfException Find the "nearest" container that implements the given interface on our stack.- Parameters:
containerClass
- class of containerrequired
- if true, ConverterException is thrown if no container foundforWhichBuilder
- used in error message if container not found- Returns:
- the container
- Throws:
RtfException
- if not caught
-
pushContainer
Push an RtfContainer on our stack.- Parameters:
c
- the container
-
pushPart
Push a Class representing a non-writeable section of the FO tree- Parameters:
part
- the part
-
replaceContainer
In some cases an RtfContainer must be replaced by another one on the stack. This happens when handling nested fo:blocks for example: after handling a nested block the enclosing block must switch to a new paragraph container to handle what follows the nested block. TODO: what happens to elements that are "more on top" than oldC on the stack? shouldn't they be closed or something?- Parameters:
oldC
- old containernewC
- new container- Throws:
Exception
- if not caught
-
popContainer
pop the topmost RtfContainer from our stack -
popPart
pop the topmost part class from our stack -
getTableContext
- Returns:
- the current TableContext
-
pushTableContext
Push a TableContext to our stack.- Parameters:
tc
- the table context
-
popTableContext
public void popTableContext()Pop a TableContext from our stack.
-