Class DataConvertUtil
java.lang.Object
io.keikai.doc.io.schema.docx.utils.DataConvertUtil
Internal Use Only.
A utility class to convert data between docx and plate.js.
- Author:
- Jamson Chan
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleA constant representing the default border width in docx (unit in twip), default 4 twip (1/2 pt).static final doubleA constant representing the default font size in docx (unit in half-point), default 24 half pt ( = 12 pt).static final doubleA constant representing docx's default value of w:spacing -> w:line's, this value divide by the base, will be the default line height ratio 1.15.static final doubleA constant representing the width of each paragraph indent-left of docx (unit in twip), will use it to multiply the indent count in plate.js.static final doubleA constant representing the base of docx's w:spacing -> w:line's base, w:line's value divide by this value, will be the line height ratio.static final Map<org.openxmlformats.schemas.wordprocessingml.x2006.main.STBorder.Enum,io.keikai.doc.api.impl.node.style.TableCellStyle.Border.Style> A map to convert docx's border style to plate's.static final Map<org.openxmlformats.schemas.wordprocessingml.x2006.main.STJc.Enum,io.keikai.doc.api.impl.node.style.ParagraphStyle.Align> A map to convert docx's paragraph alignment to plate's.static final Map<org.openxmlformats.schemas.wordprocessingml.x2006.main.STHighlightColor.Enum,String> A map to convert docx highlight color(font background color) to the format #RRGGBB.static final Map<io.keikai.doc.api.impl.node.style.TableCellStyle.Border.Style,org.openxmlformats.schemas.wordprocessingml.x2006.main.STBorder.Enum> A map to convert plate's border style to docx's.static final Map<io.keikai.doc.api.impl.node.style.ParagraphStyle.Align,org.openxmlformats.schemas.wordprocessingml.x2006.main.STJc.Enum> A map to convert plate's paragraph alignment to docx's.static final Map<String,org.openxmlformats.schemas.wordprocessingml.x2006.main.STHighlightColor.Enum> A map to convert the format #RRGGBB to docx highlight color(font background color). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic io.keikai.doc.api.impl.node.style.ParagraphStyle.ListStyleTypedocxNumFmtToListStyleType(org.openxmlformats.schemas.wordprocessingml.x2006.main.STNumberFormat.Enum numFmt, String lvlText) Converts a DOCX numbering format and level text to a corresponding list style type.static doublelineHeightToLineSpacing(double height, double minFontSizeOfRuns) static org.openxmlformats.schemas.wordprocessingml.x2006.main.STNumberFormat.EnumlistStyleTypeToDocxNumFmt(io.keikai.doc.api.impl.node.style.ParagraphStyle.ListStyleType listStyleType) Converts a list style type to a corresponding DOCX numbering format.static StringlistStyleTypeToDocxNumLvlText(io.keikai.doc.api.impl.node.style.ParagraphStyle.ListStyleType listStyleType) Converts a list style type to a corresponding DOCX level text and ASCII font.
-
Field Details
-
DOCX_P_IND_LEFT
public static final double DOCX_P_IND_LEFTA constant representing the width of each paragraph indent-left of docx (unit in twip), will use it to multiply the indent count in plate.js.- See Also:
-
DOCX_DEF_FS
public static final double DOCX_DEF_FSA constant representing the default font size in docx (unit in half-point), default 24 half pt ( = 12 pt).- See Also:
-
DOCX_DEF_BORDER_WIDTH
public static final double DOCX_DEF_BORDER_WIDTHA constant representing the default border width in docx (unit in twip), default 4 twip (1/2 pt).- See Also:
-
DOCX_SPACING_LINE_BASE
public static final double DOCX_SPACING_LINE_BASEA constant representing the base of docx's w:spacing -> w:line's base, w:line's value divide by this value, will be the line height ratio.- See Also:
-
DOCX_DEFAULT_LINE_VALUE
public static final double DOCX_DEFAULT_LINE_VALUEA constant representing docx's default value of w:spacing -> w:line's, this value divide by the base, will be the default line height ratio 1.15.- See Also:
-
DOCX_TO_PLATE_PARAGRAPH_ALIGN
public static final Map<org.openxmlformats.schemas.wordprocessingml.x2006.main.STJc.Enum,io.keikai.doc.api.impl.node.style.ParagraphStyle.Align> DOCX_TO_PLATE_PARAGRAPH_ALIGNA map to convert docx's paragraph alignment to plate's.- See Also:
-
STJc.EnumParagraphStyle.Type
-
PLATE_TO_DOCX_PARAGRAPH_ALIGN
public static final Map<io.keikai.doc.api.impl.node.style.ParagraphStyle.Align,org.openxmlformats.schemas.wordprocessingml.x2006.main.STJc.Enum> PLATE_TO_DOCX_PARAGRAPH_ALIGNA map to convert plate's paragraph alignment to docx's.- See Also:
-
ParagraphStyle.TypeSTJc.Enum
-
DOCX_TO_PLATE_TEXT_BG_COLOR
public static final Map<org.openxmlformats.schemas.wordprocessingml.x2006.main.STHighlightColor.Enum,String> DOCX_TO_PLATE_TEXT_BG_COLORA map to convert docx highlight color(font background color) to the format #RRGGBB.- See Also:
-
STHighlightColor.Enum
-
PLATE_TO_DOCX_TEXT_BG_COLOR
public static final Map<String,org.openxmlformats.schemas.wordprocessingml.x2006.main.STHighlightColor.Enum> PLATE_TO_DOCX_TEXT_BG_COLORA map to convert the format #RRGGBB to docx highlight color(font background color).- See Also:
-
STHighlightColor.Enum
-
DOCX_TO_PLATE_BORDER_STYLE
public static final Map<org.openxmlformats.schemas.wordprocessingml.x2006.main.STBorder.Enum,io.keikai.doc.api.impl.node.style.TableCellStyle.Border.Style> DOCX_TO_PLATE_BORDER_STYLEA map to convert docx's border style to plate's.- See Also:
-
STBorder.EnumTableCellStyle.Border.Style
-
PLATE_TO_DOCX_BORDER_STYLE
public static final Map<io.keikai.doc.api.impl.node.style.TableCellStyle.Border.Style,org.openxmlformats.schemas.wordprocessingml.x2006.main.STBorder.Enum> PLATE_TO_DOCX_BORDER_STYLEA map to convert plate's border style to docx's.- See Also:
-
TableCellStyle.Border.StyleSTBorder.Enum
-
-
Constructor Details
-
DataConvertUtil
public DataConvertUtil()
-
-
Method Details
-
lineHeightToLineSpacing
public static double lineHeightToLineSpacing(double height, double minFontSizeOfRuns) -
docxNumFmtToListStyleType
public static io.keikai.doc.api.impl.node.style.ParagraphStyle.ListStyleType docxNumFmtToListStyleType(org.openxmlformats.schemas.wordprocessingml.x2006.main.STNumberFormat.Enum numFmt, String lvlText) Converts a DOCX numbering format and level text to a corresponding list style type.- Parameters:
numFmt- the DOCX numbering formatlvlText- the level text- Returns:
- the corresponding list style type
-
listStyleTypeToDocxNumFmt
public static org.openxmlformats.schemas.wordprocessingml.x2006.main.STNumberFormat.Enum listStyleTypeToDocxNumFmt(io.keikai.doc.api.impl.node.style.ParagraphStyle.ListStyleType listStyleType) Converts a list style type to a corresponding DOCX numbering format.- Parameters:
listStyleType- the list style type- Returns:
- the corresponding DOCX numbering format
-
listStyleTypeToDocxNumLvlText
public static String listStyleTypeToDocxNumLvlText(io.keikai.doc.api.impl.node.style.ParagraphStyle.ListStyleType listStyleType) Converts a list style type to a corresponding DOCX level text and ASCII font.- Parameters:
listStyleType- the list style type- Returns:
- an array containing the DOCX level text and ASCII font
-