Class CoreNodeDocxRenderer
- java.lang.Object
-
- com.vladsch.flexmark.docx.converter.internal.CoreNodeDocxRenderer
-
- All Implemented Interfaces:
NodeDocxRenderer
,PhasedNodeDocxRenderer
public class CoreNodeDocxRenderer extends java.lang.Object implements PhasedNodeDocxRenderer
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
INPUT_CLASS_CHECKBOX
static java.lang.String
INPUT_CLASS_DROPDOWN
static java.lang.String
INPUT_CLASS_TEXT
static java.lang.String
INPUT_TYPE_CHECKBOX
static java.lang.String
INPUT_TYPE_DROPDOWN
static java.lang.String
INPUT_TYPE_TEXT
protected boolean
linebreakOnInlineHtmlBr
static DataKey<java.lang.Integer>
LIST_ITEM_NUMBER
static NullableDataKey<ListSpacing>
LIST_ITEM_SPACING
protected boolean
recheckUndefinedReferences
protected ReferenceRepository
referenceRepository
static java.util.HashSet<DocxRendererPhase>
RENDERING_PHASES
protected boolean
repositoryNodesDone
protected boolean
tableCaptionBeforeTable
protected boolean
tableCaptionToParagraph
protected int
tableLeftIndent
protected int
tablePreferredWidthPct
protected java.lang.String
tableStyle
-
Constructor Summary
Constructors Constructor Description CoreNodeDocxRenderer(DataHolder options)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<java.lang.Class<?>>
getBookmarkWrapsChildrenClasses()
Return mapping of all nodes whose children should be wrapped in a bookmark if the parent node has an id attribute.java.util.Set<DocxRendererPhase>
getFormattingPhases()
java.util.Set<java.lang.Class<?>>
getNodeClasses()
Collect nodes of given type so that they can be quickly accessed without traversing the AST by all formatting extensions.java.util.Set<NodeDocxRendererHandler<?>>
getNodeFormattingHandlers()
ReferenceRepository
getRepository(DataHolder options)
org.docx4j.wml.R
newImage(DocxRendererContext docx, java.awt.image.BufferedImage image, java.lang.String filenameHint, Attributes attributes, int id1, int id2, double scale)
void
renderDocument(DocxRendererContext docx, Document document, DocxRendererPhase phase)
Render the specified node.void
renderHtmlBlock(HtmlBlockBase node, DocxRendererContext docx, boolean suppress, boolean escape)
void
renderInlineHtml(HtmlInlineBase node, DocxRendererContext docx, boolean suppress, boolean escape)
void
renderList(ListBlock node, DocxRendererContext docx)
-
-
-
Field Detail
-
LIST_ITEM_NUMBER
public static final DataKey<java.lang.Integer> LIST_ITEM_NUMBER
-
LIST_ITEM_SPACING
public static final NullableDataKey<ListSpacing> LIST_ITEM_SPACING
-
RENDERING_PHASES
public static final java.util.HashSet<DocxRendererPhase> RENDERING_PHASES
-
INPUT_TYPE_DROPDOWN
public static final java.lang.String INPUT_TYPE_DROPDOWN
- See Also:
- Constant Field Values
-
INPUT_TYPE_CHECKBOX
public static final java.lang.String INPUT_TYPE_CHECKBOX
- See Also:
- Constant Field Values
-
INPUT_TYPE_TEXT
public static final java.lang.String INPUT_TYPE_TEXT
- See Also:
- Constant Field Values
-
INPUT_CLASS_TEXT
public static final java.lang.String INPUT_CLASS_TEXT
- See Also:
- Constant Field Values
-
INPUT_CLASS_DROPDOWN
public static final java.lang.String INPUT_CLASS_DROPDOWN
- See Also:
- Constant Field Values
-
INPUT_CLASS_CHECKBOX
public static final java.lang.String INPUT_CLASS_CHECKBOX
- See Also:
- Constant Field Values
-
referenceRepository
protected final ReferenceRepository referenceRepository
-
recheckUndefinedReferences
protected boolean recheckUndefinedReferences
-
repositoryNodesDone
protected boolean repositoryNodesDone
-
linebreakOnInlineHtmlBr
protected final boolean linebreakOnInlineHtmlBr
-
tableCaptionToParagraph
protected final boolean tableCaptionToParagraph
-
tableCaptionBeforeTable
protected final boolean tableCaptionBeforeTable
-
tablePreferredWidthPct
protected final int tablePreferredWidthPct
-
tableLeftIndent
protected final int tableLeftIndent
-
tableStyle
protected final java.lang.String tableStyle
-
-
Constructor Detail
-
CoreNodeDocxRenderer
public CoreNodeDocxRenderer(DataHolder options)
-
-
Method Detail
-
getFormattingPhases
public java.util.Set<DocxRendererPhase> getFormattingPhases()
- Specified by:
getFormattingPhases
in interfacePhasedNodeDocxRenderer
-
renderDocument
public void renderDocument(DocxRendererContext docx, Document document, DocxRendererPhase phase)
Description copied from interface:PhasedNodeDocxRenderer
Render the specified node.- Specified by:
renderDocument
in interfacePhasedNodeDocxRenderer
- Parameters:
docx
- docx renderer context instancedocument
- the document node to renderphase
- rendering phase for which to generate the output. Will be any ofDocxRendererPhase
exceptDocxRendererPhase.DOCUMENT
because this phase is used for the non-phased node rendering
-
getNodeClasses
public java.util.Set<java.lang.Class<?>> getNodeClasses()
Description copied from interface:NodeDocxRenderer
Collect nodes of given type so that they can be quickly accessed without traversing the AST by all formatting extensions.- Specified by:
getNodeClasses
in interfaceNodeDocxRenderer
- Returns:
- the nodes of interest to this formatter during formatting.
-
getBookmarkWrapsChildrenClasses
public java.util.Set<java.lang.Class<?>> getBookmarkWrapsChildrenClasses()
Description copied from interface:NodeDocxRenderer
Return mapping of all nodes whose children should be wrapped in a bookmark if the parent node has an id attribute. Default for block nodes to have a bookmark before the node element and for inline nodes to have a bookmark around the element.CAUTION: final classes need to be returned, not super classes. Comparison is done by hash on class
- Specified by:
getBookmarkWrapsChildrenClasses
in interfaceNodeDocxRenderer
- Returns:
- the nodes of interest to this formatter during formatting.
-
getRepository
public ReferenceRepository getRepository(DataHolder options)
-
getNodeFormattingHandlers
public java.util.Set<NodeDocxRendererHandler<?>> getNodeFormattingHandlers()
- Specified by:
getNodeFormattingHandlers
in interfaceNodeDocxRenderer
- Returns:
- the mapping of nodes this renderer handles to rendering function
-
renderList
public void renderList(ListBlock node, DocxRendererContext docx)
-
renderHtmlBlock
public void renderHtmlBlock(HtmlBlockBase node, DocxRendererContext docx, boolean suppress, boolean escape)
-
renderInlineHtml
public void renderInlineHtml(HtmlInlineBase node, DocxRendererContext docx, boolean suppress, boolean escape)
-
newImage
public org.docx4j.wml.R newImage(DocxRendererContext docx, java.awt.image.BufferedImage image, java.lang.String filenameHint, Attributes attributes, int id1, int id2, double scale)
-
-