Class ParagraphStylesInTableFix.StyleRenamer
java.lang.Object
org.docx4j.TraversalUtil.CallbackImpl
org.docx4j.convert.out.common.preprocess.ParagraphStylesInTableFix.StyleRenamer
- All Implemented Interfaces:
TraversalUtil.Callback
- Enclosing class:
- ParagraphStylesInTableFix
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate Styleprotected static org.slf4j.Logger(package private) CTCompatSettingprivate PropertyResolverprivate LinkedList<Tbl> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionVisits a node in pre order (before its children have been visited).private StringgetCellPStyle(String styleVal, boolean pStyleIsDefault) In a cell, a paragraph uses the table's paragraph properties, plus the relevant paragraph style (Normal, by default).private booleanisFalse(CTCompatSetting overrideTableStyleFontSizeAndJustification) voidsetDefaultParagraphStyle(String defaultParagraphStyle) voidsetDefaultTableStyle(Style defaultTableStyle) voidvoidwalkJAXBElements(Object parent) Methods inherited from class org.docx4j.TraversalUtil.CallbackImpl
getChildren, shouldTraverse
-
Field Details
-
log
protected static org.slf4j.Logger log -
overrideTableStyleFontSizeAndJustification
CTCompatSetting overrideTableStyleFontSizeAndJustification -
propertyResolver
-
defaultParagraphStyle
-
defaultTableStyle
-
tblStack
-
allStyles
-
cellPStyles
-
-
Constructor Details
-
StyleRenamer
public StyleRenamer()
-
-
Method Details
-
setDefaultParagraphStyle
-
setDefaultTableStyle
-
setStyles
-
isFalse
-
getCellPStyle
In a cell, a paragraph uses the table's paragraph properties, plus the relevant paragraph style (Normal, by default). The relevant paragraph style trumps the values from the table's paragraph properties, so that would mean giving the doc defaults (which we've made part of our styles) priority over the table's paragraph properties, which is wrong. TO avoid this, we create a new style, which encapsulates the paragraph style, with DocDefaults given lower priority than table style. This created style has no w:basedOn setting. -
apply
Description copied from class:TraversalUtil.CallbackImplVisits a node in pre order (before its children have been visited). A node is visited only if all its parents have been traversed (TraversalUtil.CallbackImpl.shouldTraverse(Object)).Implementations can have side effects.
- Specified by:
applyin interfaceTraversalUtil.Callback- Specified by:
applyin classTraversalUtil.CallbackImpl
-
walkJAXBElements
- Specified by:
walkJAXBElementsin interfaceTraversalUtil.Callback- Overrides:
walkJAXBElementsin classTraversalUtil.CallbackImpl
-