You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/docs/help/annotation.md
+32-28Lines changed: 32 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,47 +3,51 @@ id: 'annotation'
3
3
title: 'Annotation'
4
4
---
5
5
6
-
# 注解
7
-
本章节介绍读取 FastExcel 中提供的注解。
6
+
# Annotation
8
7
9
-
## 实体类注解
8
+
This section describes how to read annotations provided in FastExcel.
10
9
11
-
实体类是读写操作的基础。FastExcel 提供了多种注解,帮助开发者轻松定义字段和格式。
10
+
## Entity Class Annotations
12
11
13
-
### **`@ExcelProperty`**
14
-
定义 Excel 列名和映射的字段名。 具体参数如下:
12
+
Entity classes are the foundation of read and write operations. FastExcel provides various annotations to help developers easily define fields and formats.
| value | Empty | Used to match the header in Excel, must be fully matched. If there are multiple header rows, it will match the last row header. |
21
+
| order | Integer.MAX_VALUE | Higher priority than `value`, will match the order of entities and data in Excel according to the order of `order`. |
22
+
| index | -1 | Higher priority than `value` and `order`, will directly specify which column in Excel to match based on `index`. |
23
+
| converter | Automatically selected | Specifies which converter the current field uses. By default, it will be automatically selected. <br> For reading, as long as the `cn.idev.excel.converters.Converter#convertToJavaData(com.idev.excel.converters.ReadConverterContext<?>)` method is implemented, it is sufficient. |
22
24
23
25
### `@ExcelIgnore`
24
26
25
-
默认所有字段都会和 Excel 去匹配,加了这个注解会忽略该字段。
27
+
By default, all fields will match Excel. Adding this annotation will ignore the field.
26
28
27
29
### `@ExcelIgnoreUnannotated`
28
30
29
-
默认不加 `@ExcelProperty` 的注解的都会参与读写,加了不会参与读写。
31
+
By default, all properties without the `@ExcelProperty` annotation are involved in read/write operations. Properties with this annotation are not involved in read/write operations.
32
+
33
+
### `@DateTimeFormat`
34
+
35
+
Date conversion: When using `String` to receive data in Excel date format, this annotation will be called. The parameters are as follows:
| value | Empty | Refer to `java.text.SimpleDateFormat` . |
40
+
| use1904windowing | Automatically selected | In Excel, time is stored as a double-precision floating-point number starting from 1900, but sometimes the default start date is 1904, so set this value to change the default start date to 1904. |
0 commit comments