Skip to content

Commit 90e912e

Browse files
docs: add documentation for the annotations on the website (#793)
* docs: add documentation for annotations - add documentation for annotations - correct punctuation issues * docs: unified parameter header description * docs: replace non-essential English in zh-CN version * docs: fix MD047/single-trailing-newline --------- Co-authored-by: DeleiGuo <delei@apache.org>
1 parent 55861aa commit 90e912e

2 files changed

Lines changed: 149 additions & 2 deletions

File tree

website/docs/sheet/help/annotation.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,78 @@ Number conversion, using `String` to receive data in spreadsheet number format w
5454
### `@ColumnWidth`
5555

5656
Specifies the column width.
57+
58+
### `@HeadRowHeight` & `@ContentRowHeight`
59+
60+
Specifies the height of the header rows (`@HeadRowHeight`) or the content rows (`@ContentRowHeight`). The
61+
parameters are as follows:
62+
63+
| Name | Default Value | Description |
64+
|-------|---------------|----------------------------------------------------------|
65+
| value | -1 | Set the height. `-1` indicates automatic height setting. |
66+
67+
### `@HeadFontStyle` & `@ContentFontStyle`
68+
69+
Customizes the font style for headers (`@HeadFontStyle`) or content data (`@ContentFontStyle`). The
70+
parameters are as follows:
71+
72+
| Name | Default Value | Description |
73+
|--------------------|---------------------|------------------------------------------------------------------------------------------------------------------------------------------------------|
74+
| fontName | Empty | The name for the font (e.g., "Arial"). |
75+
| fontHeightInPoints | -1 | Set font height. |
76+
| italic | BooleanEnum.DEFAULT | Whether to use italics. |
77+
| strikeout | BooleanEnum.DEFAULT | Whether to use a strikeout horizontal line through the text. |
78+
| color | -1 | The color for the font. (See `org.apache.poi.ss.usermodel.IndexedColors` or `org.apache.poi.ss.usermodel.Font`, e.g., `Font.COLOR_NORMAL`). |
79+
| typeOffset | -1 | Set the font type offset to normal, super, or subscript (See `org.apache.poi.ss.usermodel.Font`, e.g., `Font.SS_NONE`). |
80+
| underline | -1 | Set type of text underlining (See `org.apache.poi.ss.usermodel.Font`, e.g., `Font.U_SINGLE`). |
81+
| charset | -1 | Set character-set to use (See `org.apache.poi.common.usermodel.fonts.FontCharset` or `org.apache.poi.ss.usermodel.Font`, e.g., `Font.ANSI_CHARSET`). |
82+
| bold | BooleanEnum.DEFAULT | Whether to apply bold style. |
83+
84+
### `@HeadStyle` & `@ContentStyle`
85+
86+
Customizes the cell style (borders, alignment, colors...) for header data (`@HeadStyle`) or content data (`@ContentStyle`).
87+
The parameters are as follows:
88+
89+
| Name | Default Value | Description |
90+
|---------------------|---------------------------------|-------------------------------------------------------------------------------------------------------|
91+
| dataFormat | -1 | Set the data format (must be a valid format defined at `org.apache.poi.ss.usermodel.BuiltinFormats`). |
92+
| hidden | BooleanEnum.DEFAULT | set the cell to be hidden. **Note: This only takes effect if the sheet is protected.** |
93+
| locked | BooleanEnum.DEFAULT | Set the cell to be locked. **Note: This only takes effect if the sheet is protected.** |
94+
| quotePrefix | BooleanEnum.DEFAULT | Turn on/off "Quote Prefix" (treats numeric/formula as text). |
95+
| horizontalAlignment | HorizontalAlignmentEnum.DEFAULT | Set the horizontal alignment. |
96+
| wrapped | BooleanEnum.DEFAULT | Set whether the text should be wrapped within the cell. |
97+
| verticalAlignment | VerticalAlignmentEnum.DEFAULT | Set the vertical alignment. |
98+
| rotation | -1 | Set the degree of rotation for the text. |
99+
| indent | -1 | Set the number of spaces to indent the text. |
100+
| borderLeft | BorderStyleEnum.DEFAULT | Set the border style for the left border. |
101+
| borderRight | BorderStyleEnum.DEFAULT | Set the border style for the right border. |
102+
| borderTop | BorderStyleEnum.DEFAULT | Set the border style for the top border. |
103+
| borderBottom | BorderStyleEnum.DEFAULT | Set the border style for the bottom border. |
104+
| leftBorderColor | -1 | Set the color for the left border (See `org.apache.poi.ss.usermodel.IndexedColors`). |
105+
| rightBorderColor | -1 | Set the color for the right border (See `org.apache.poi.ss.usermodel.IndexedColors`). |
106+
| topBorderColor | -1 | Set the color for the top border (See `org.apache.poi.ss.usermodel.IndexedColors`). |
107+
| bottomBorderColor | -1 | Set the color for the bottom border (See `org.apache.poi.ss.usermodel.IndexedColors`). |
108+
| fillPatternType | FillPatternTypeEnum.DEFAULT | Set the fill pattern |
109+
| fillBackgroundColor | -1 | Set the background fill color. |
110+
| fillForegroundColor | -1 | Set the foreground fill color. **Note: Ensure Foreground color is set prior to background color.** |
111+
| shrinkToFit | BooleanEnum.DEFAULT | Controls if the Cell should be auto-sized to shrink to fit if text is too long. |
112+
113+
### `@ContentLoopMerge`
114+
115+
Defines a loop merge strategy for content cells. The parameters are as follows:
116+
117+
| Name | Default Value | Description |
118+
|--------------|---------------|---------------------------------------------------|
119+
| eachRow | 1 | The number of rows to include in each merge loop. |
120+
| columnExtend | 1 | The number of columns to extend the merge. |
121+
122+
### `@OnceAbsoluteMerge`
123+
124+
Defines a one-time absolute merge region. The parameters are as follows:
125+
126+
| Name | Default Value | Description |
127+
|------------------|---------------|----------------------------------------------|
128+
| firstRowIndex | -1 | The index of the first row to merge. |
129+
| lastRowIndex | -1 | The index of the last row to merge. |
130+
| firstColumnIndex | -1 | The index of the first column to merge. |
131+
| lastColumnIndex | -1 | The index of the last column to merge. |

website/i18n/zh-cn/docusaurus-plugin-content-docs/current/sheet/help/annotation.md

Lines changed: 74 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ title: '注解'
1717

1818
| 名称 | 默认值 | 描述 |
1919
|-----------|-------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
20-
| value || 用于匹配电子表格中的头,必须全匹配,如果有多行头,会匹配最后一行头 |
20+
| value || 用于匹配电子表格中的头,必须全匹配如果有多行头,会匹配最后一行头 |
2121
| order | Integer.MAX_VALUE | 优先级高于 `value`,会根据 `order` 的顺序来匹配实体和电子表格中数据的顺序 |
2222
| index | &#45;1 | 优先级高于 `value``order`,会根据 `index` 直接指定到电子表格中具体的哪一列 |
2323
| converter | 自动选择 | 指定当前字段用什么转换器,默认会自动选择。读的情况下只要实现 `org.apache.fesod.sheet.converters.Converter#convertToJavaData(org.apache.fesod.sheet.converters.ReadConverterContext<?>)` 方法即可 |
@@ -32,7 +32,7 @@ title: '注解'
3232

3333
### **`@DateTimeFormat`**
3434

35-
日期转换,用 `String` 去接收电子表格日期格式的数据会调用这个注解,参数如下:
35+
日期转换,用 `String` 去接收电子表格日期格式的数据会调用这个注解参数如下:
3636

3737
| 名称 | 默认值 | 描述 |
3838
|------------------|------|--------------------------------------------------------------------|
@@ -51,3 +51,75 @@ title: '注解'
5151
### **`@ColumnWidth`**
5252

5353
指定列宽。
54+
55+
### `@HeadRowHeight` & `@ContentRowHeight`
56+
57+
指定表头行(`@HeadRowHeight`)或内容行(`@ContentRowHeight`)的高度。具体参数如下:
58+
59+
| 名称 | 默认值 | 描述 |
60+
|-------|-----|--------------------|
61+
| value | -1 | 设置高度。`-1` 表示自动设置高度 |
62+
63+
### `@HeadFontStyle` & `@ContentFontStyle`
64+
65+
自定义表头(`@HeadFontStyle`)或内容数据(`@ContentFontStyle`)的字体样式。具体参数如下:
66+
67+
| 名称 | 默认值 | 描述 |
68+
|--------------------|---------------------|---------------------------------------------------------------------------------------------------------------------------|
69+
| fontName || 字体名称(例如 "Arial") |
70+
| fontHeightInPoints | -1 | 设置字体高度 |
71+
| italic | BooleanEnum.DEFAULT | 是否使用斜体 |
72+
| strikeout | BooleanEnum.DEFAULT | 文本是否显示水平删除线 |
73+
| color | -1 | 设置字体颜色(参照 `org.apache.poi.ss.usermodel.IndexedColors``org.apache.poi.ss.usermodel.Font`,例如 `Font.COLOR_NORMAL`|
74+
| typeOffset | -1 | 设置字体的类型偏移,用于控制文本显示为正常、上标或下标(参照 `org.apache.poi.ss.usermodel.Font`,例如 `Font.SS_NONE`|
75+
| underline | -1 | 设置下划线类型(参照 `org.apache.poi.ss.usermodel.Font`,例如 `Font.U_SINGLE`|
76+
| charset | -1 | 设置字符集(参照 `org.apache.poi.common.usermodel.fonts.FontCharset``org.apache.poi.ss.usermodel.Font`,例如 `Font.ANSI_CHARSET`|
77+
| bold | BooleanEnum.DEFAULT | 是否加粗 |
78+
79+
### `@HeadStyle` & `@ContentStyle`
80+
81+
自定义表头数据(`@HeadStyle`)或内容数据(`@ContentStyle`)的单元格样式(边框、对齐、颜色等)。具体参数如下:
82+
83+
| 名称 | 默认值 | 描述 |
84+
|---------------------|---------------------------------|-------------------------------------------------------------------|
85+
| dataFormat | -1 | 设置数据格式(必须是 `org.apache.poi.ss.usermodel.BuiltinFormats` 中定义的有效格式) |
86+
| hidden | BooleanEnum.DEFAULT | 设置单元格为隐藏,**注意:此选项仅在工作表受保护时生效** |
87+
| locked | BooleanEnum.DEFAULT | 设置单元格为锁定,**注意:此选项仅在工作表受保护时生效。** |
88+
| quotePrefix | BooleanEnum.DEFAULT | 开启/关闭前缀引号(将看起来像数字或公式的内容视为文本处理) |
89+
| horizontalAlignment | HorizontalAlignmentEnum.DEFAULT | 设置水平对齐方式 |
90+
| wrapped | BooleanEnum.DEFAULT | 设置文本是否在单元格内自动换行 |
91+
| verticalAlignment | VerticalAlignmentEnum.DEFAULT | 设置垂直对齐方式 |
92+
| rotation | -1 | 设置文本的旋转角度 |
93+
| indent | -1 | 设置文本缩进的空格数 |
94+
| borderLeft | BorderStyleEnum.DEFAULT | 设置左边框的样式 |
95+
| borderRight | BorderStyleEnum.DEFAULT | 设置右边框的样式 |
96+
| borderTop | BorderStyleEnum.DEFAULT | 设置上边框的样式 |
97+
| borderBottom | BorderStyleEnum.DEFAULT | 设置下边框的样式 |
98+
| leftBorderColor | -1 | 设置左边框的颜色(参照 `org.apache.poi.ss.usermodel.IndexedColors`|
99+
| rightBorderColor | -1 | 设置右边框的颜色(参照 `org.apache.poi.ss.usermodel.IndexedColors`|
100+
| topBorderColor | -1 | 设置上边框的颜色(参照 `org.apache.poi.ss.usermodel.IndexedColors`|
101+
| bottomBorderColor | -1 | 设置下边框的颜色(参照 `org.apache.poi.ss.usermodel.IndexedColors`|
102+
| fillPatternType | FillPatternTypeEnum.DEFAULT | 设置填充图案类型 |
103+
| fillBackgroundColor | -1 | 设置背景填充颜色 |
104+
| fillForegroundColor | -1 | 设置前景填充颜色,**注意:请确保在设置背景色之前设置前景色** |
105+
| shrinkToFit | BooleanEnum.DEFAULT | 控制单元格是否自动缩小以适应过长的文本 |
106+
107+
### `@ContentLoopMerge`
108+
109+
定义内容单元格的循环合并策略。具体参数如下:
110+
111+
| 名称 | 默认值 | 描述 |
112+
|--------------|-----|-------------|
113+
| eachRow | 1 | 每次合并循环包含的行数 |
114+
| columnExtend | 1 | 合并需要延伸的列数 |
115+
116+
### `@OnceAbsoluteMerge`
117+
118+
定义一次性的单元格合并区域。具体参数如下:
119+
120+
| 名称 | 默认值 | 描述 |
121+
|------------------|-----|-------------|
122+
| firstRowIndex | -1 | 合并区域的第一行索引 |
123+
| lastRowIndex | -1 | 合并区域的最后一行索引 |
124+
| firstColumnIndex | -1 | 合并区域的第一列索引 |
125+
| lastColumnIndex | -1 | 合并区域的最后一列索引 |

0 commit comments

Comments
 (0)