diff --git a/README.md b/README.md
index 9edcc142..6c255fa4 100644
--- a/README.md
+++ b/README.md
@@ -28,10 +28,11 @@ Java解析、生成Excel比较有名的框架有Apache poi、jxl。但他们都
* 2+ 版本支持 Java7和Java6
* 3+ 版本至少 Java8
### 关于版本升级
-* 不建议夸大版本升级 尤其夸2个大版本
-* 2+ 升级到 3+
- * 使用了自定义拦截器去修改样式的会出问题
- * 读的时候`invoke`里面抛出异常,不会再额外封装一层`ExcelAnalysisException`
+* 不建议跨大版本升级 尤其跨2个大版本
+* 2+ 升级到 3+ 一些不兼容的地方
+ * 使用了自定义拦截器去修改样式的会出问题(不会编译报错)
+ * 读的时候`invoke`里面抛出异常,不会再额外封装一层`ExcelAnalysisException` (不会编译报错)
+ * 样式等注解涉及到 `boolean` or 一些枚举 值的 有变动,新增默认值(会编译报错,注解改就行)
* 大版本升级后建议相关内容重新测试下
## 人员招募
diff --git a/pom.xml b/pom.xml
index 3f29ad91..2fb651aa 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
4.0.0com.alibabaeasyexcel
- 3.0.0-beta1
+ 3.0.0-beta2jareasyexcel
diff --git a/src/main/java/com/alibaba/excel/annotation/format/DateTimeFormat.java b/src/main/java/com/alibaba/excel/annotation/format/DateTimeFormat.java
index 96aff229..fefceded 100644
--- a/src/main/java/com/alibaba/excel/annotation/format/DateTimeFormat.java
+++ b/src/main/java/com/alibaba/excel/annotation/format/DateTimeFormat.java
@@ -6,6 +6,8 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+import com.alibaba.excel.enums.BooleanEnum;
+
/**
* Convert date format.
*
@@ -34,5 +36,5 @@ public @interface DateTimeFormat {
*
* @return True if date uses 1904 windowing, or false if using 1900 date windowing.
*/
- boolean use1904windowing() default false;
+ BooleanEnum use1904windowing() default BooleanEnum.DEFAULT;
}
diff --git a/src/main/java/com/alibaba/excel/annotation/write/style/ContentFontStyle.java b/src/main/java/com/alibaba/excel/annotation/write/style/ContentFontStyle.java
index 533ae6aa..fd890d48 100644
--- a/src/main/java/com/alibaba/excel/annotation/write/style/ContentFontStyle.java
+++ b/src/main/java/com/alibaba/excel/annotation/write/style/ContentFontStyle.java
@@ -6,6 +6,8 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+import com.alibaba.excel.enums.BooleanEnum;
+
import org.apache.poi.common.usermodel.fonts.FontCharset;
import org.apache.poi.hssf.usermodel.HSSFPalette;
import org.apache.poi.ss.usermodel.Font;
@@ -34,12 +36,12 @@ public @interface ContentFontStyle {
/**
* Whether to use italics or not
*/
- boolean italic() default false;
+ BooleanEnum italic() default BooleanEnum.DEFAULT;
/**
* Whether to use a strikeout horizontal line through the text or not
*/
- boolean strikeout() default false;
+ BooleanEnum strikeout() default BooleanEnum.DEFAULT;
/**
* The color for the font
@@ -85,5 +87,5 @@ public @interface ContentFontStyle {
/**
* Bold
*/
- boolean bold() default false;
+ BooleanEnum bold() default BooleanEnum.DEFAULT;
}
diff --git a/src/main/java/com/alibaba/excel/annotation/write/style/ContentStyle.java b/src/main/java/com/alibaba/excel/annotation/write/style/ContentStyle.java
index 9ef3f47e..bfa8aa4f 100644
--- a/src/main/java/com/alibaba/excel/annotation/write/style/ContentStyle.java
+++ b/src/main/java/com/alibaba/excel/annotation/write/style/ContentStyle.java
@@ -6,13 +6,16 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
-import org.apache.poi.ss.usermodel.BorderStyle;
+import com.alibaba.excel.enums.BooleanEnum;
+import com.alibaba.excel.enums.poi.BorderStyleEnum;
+import com.alibaba.excel.enums.poi.FillPatternTypeEnum;
+import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
+import com.alibaba.excel.enums.poi.VerticalAlignmentEnum;
+
import org.apache.poi.ss.usermodel.BuiltinFormats;
import org.apache.poi.ss.usermodel.FillPatternType;
-import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.IgnoredErrorType;
import org.apache.poi.ss.usermodel.IndexedColors;
-import org.apache.poi.ss.usermodel.VerticalAlignment;
/**
* Custom content styles
@@ -31,36 +34,36 @@ public @interface ContentStyle {
/**
* Set the cell's using this style to be hidden
*/
- boolean hidden() default false;
+ BooleanEnum hidden() default BooleanEnum.DEFAULT;
/**
* Set the cell's using this style to be locked
*/
- boolean locked() default false;
+ BooleanEnum locked() default BooleanEnum.DEFAULT;
/**
* Turn on or off "Quote Prefix" or "123 Prefix" for the style, which is used to tell Excel that the thing which
* looks like a number or a formula shouldn't be treated as on. Turning this on is somewhat (but not completely, see
* {@link IgnoredErrorType}) like prefixing the cell value with a ' in Excel
*/
- boolean quotePrefix() default false;
+ BooleanEnum quotePrefix() default BooleanEnum.DEFAULT;
/**
* Set the type of horizontal alignment for the cell
*/
- HorizontalAlignment horizontalAlignment() default HorizontalAlignment.GENERAL;
+ HorizontalAlignmentEnum horizontalAlignment() default HorizontalAlignmentEnum.DEFAULT;
/**
* Set whether the text should be wrapped. Setting this flag to true make all content visible within a
* cell by displaying it on multiple lines
*
*/
- boolean wrapped() default false;
+ BooleanEnum wrapped() default BooleanEnum.DEFAULT;
/**
* Set the type of vertical alignment for the cell
*/
- VerticalAlignment verticalAlignment() default VerticalAlignment.CENTER;
+ VerticalAlignmentEnum verticalAlignment() default VerticalAlignmentEnum.DEFAULT;
/**
* Set the degree of rotation for the text in the cell.
@@ -80,22 +83,22 @@ public @interface ContentStyle {
/**
* Set the type of border to use for the left border of the cell
*/
- BorderStyle borderLeft() default BorderStyle.NONE;
+ BorderStyleEnum borderLeft() default BorderStyleEnum.DEFAULT;
/**
* Set the type of border to use for the right border of the cell
*/
- BorderStyle borderRight() default BorderStyle.NONE;
+ BorderStyleEnum borderRight() default BorderStyleEnum.DEFAULT;
/**
* Set the type of border to use for the top border of the cell
*/
- BorderStyle borderTop() default BorderStyle.NONE;
+ BorderStyleEnum borderTop() default BorderStyleEnum.DEFAULT;
/**
* Set the type of border to use for the bottom border of the cell
*/
- BorderStyle borderBottom() default BorderStyle.NONE;
+ BorderStyleEnum borderBottom() default BorderStyleEnum.DEFAULT;
/**
* Set the color to use for the left border
@@ -133,7 +136,7 @@ public @interface ContentStyle {
*
* @see FillPatternType#SOLID_FOREGROUND
*/
- FillPatternType fillPatternType() default FillPatternType.NO_FILL;
+ FillPatternTypeEnum fillPatternType() default FillPatternTypeEnum.DEFAULT;
/**
* Set the background fill color.
@@ -154,6 +157,6 @@ public @interface ContentStyle {
/**
* Controls if the Cell should be auto-sized to shrink to fit if the text is too long
*/
- boolean shrinkToFit() default false;
+ BooleanEnum shrinkToFit() default BooleanEnum.DEFAULT;
}
diff --git a/src/main/java/com/alibaba/excel/annotation/write/style/HeadFontStyle.java b/src/main/java/com/alibaba/excel/annotation/write/style/HeadFontStyle.java
index d25dad77..e7f0e1ba 100644
--- a/src/main/java/com/alibaba/excel/annotation/write/style/HeadFontStyle.java
+++ b/src/main/java/com/alibaba/excel/annotation/write/style/HeadFontStyle.java
@@ -6,6 +6,8 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+import com.alibaba.excel.enums.BooleanEnum;
+
import org.apache.poi.common.usermodel.fonts.FontCharset;
import org.apache.poi.hssf.usermodel.HSSFPalette;
import org.apache.poi.ss.usermodel.Font;
@@ -24,22 +26,22 @@ public @interface HeadFontStyle {
/**
* The name for the font (i.e. Arial)
*/
- String fontName() default "宋体";
+ String fontName() default "";
/**
* Height in the familiar unit of measure - points
*/
- short fontHeightInPoints() default 14;
+ short fontHeightInPoints() default -1;
/**
* Whether to use italics or not
*/
- boolean italic() default false;
+ BooleanEnum italic() default BooleanEnum.DEFAULT;
/**
* Whether to use a strikeout horizontal line through the text or not
*/
- boolean strikeout() default false;
+ BooleanEnum strikeout() default BooleanEnum.DEFAULT;
/**
* The color for the font
@@ -85,5 +87,5 @@ public @interface HeadFontStyle {
/**
* Bold
*/
- boolean bold() default true;
+ BooleanEnum bold() default BooleanEnum.DEFAULT;
}
diff --git a/src/main/java/com/alibaba/excel/annotation/write/style/HeadStyle.java b/src/main/java/com/alibaba/excel/annotation/write/style/HeadStyle.java
index 5bc3ffc6..85900eac 100644
--- a/src/main/java/com/alibaba/excel/annotation/write/style/HeadStyle.java
+++ b/src/main/java/com/alibaba/excel/annotation/write/style/HeadStyle.java
@@ -6,13 +6,16 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
-import org.apache.poi.ss.usermodel.BorderStyle;
+import com.alibaba.excel.enums.BooleanEnum;
+import com.alibaba.excel.enums.poi.BorderStyleEnum;
+import com.alibaba.excel.enums.poi.FillPatternTypeEnum;
+import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
+import com.alibaba.excel.enums.poi.VerticalAlignmentEnum;
+
import org.apache.poi.ss.usermodel.BuiltinFormats;
import org.apache.poi.ss.usermodel.FillPatternType;
-import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.IgnoredErrorType;
import org.apache.poi.ss.usermodel.IndexedColors;
-import org.apache.poi.ss.usermodel.VerticalAlignment;
/**
* Custom header styles
@@ -31,35 +34,35 @@ public @interface HeadStyle {
/**
* Set the cell's using this style to be hidden
*/
- boolean hidden() default false;
+ BooleanEnum hidden() default BooleanEnum.DEFAULT;
/**
* Set the cell's using this style to be locked
*/
- boolean locked() default true;
+ BooleanEnum locked() default BooleanEnum.DEFAULT;
/**
* Turn on or off "Quote Prefix" or "123 Prefix" for the style, which is used to tell Excel that the thing which
* looks like a number or a formula shouldn't be treated as on. Turning this on is somewhat (but not completely, see
* {@link IgnoredErrorType}) like prefixing the cell value with a ' in Excel
*/
- boolean quotePrefix() default false;
+ BooleanEnum quotePrefix() default BooleanEnum.DEFAULT;
/**
* Set the type of horizontal alignment for the cell
*/
- HorizontalAlignment horizontalAlignment() default HorizontalAlignment.CENTER;
+ HorizontalAlignmentEnum horizontalAlignment() default HorizontalAlignmentEnum.DEFAULT;
/**
* Set whether the text should be wrapped. Setting this flag to true make all content visible within a
* cell by displaying it on multiple lines
*/
- boolean wrapped() default true;
+ BooleanEnum wrapped() default BooleanEnum.DEFAULT;
/**
* Set the type of vertical alignment for the cell
*/
- VerticalAlignment verticalAlignment() default VerticalAlignment.CENTER;
+ VerticalAlignmentEnum verticalAlignment() default VerticalAlignmentEnum.DEFAULT;
/**
* Set the degree of rotation for the text in the cell.
@@ -79,22 +82,22 @@ public @interface HeadStyle {
/**
* Set the type of border to use for the left border of the cell
*/
- BorderStyle borderLeft() default BorderStyle.THIN;
+ BorderStyleEnum borderLeft() default BorderStyleEnum.DEFAULT;
/**
* Set the type of border to use for the right border of the cell
*/
- BorderStyle borderRight() default BorderStyle.THIN;
+ BorderStyleEnum borderRight() default BorderStyleEnum.DEFAULT;
/**
* Set the type of border to use for the top border of the cell
*/
- BorderStyle borderTop() default BorderStyle.THIN;
+ BorderStyleEnum borderTop() default BorderStyleEnum.DEFAULT;
/**
* Set the type of border to use for the bottom border of the cell
*/
- BorderStyle borderBottom() default BorderStyle.THIN;
+ BorderStyleEnum borderBottom() default BorderStyleEnum.DEFAULT;
/**
* Set the color to use for the left border
@@ -129,7 +132,7 @@ public @interface HeadStyle {
*
* @see FillPatternType#SOLID_FOREGROUND
*/
- FillPatternType fillPatternType() default FillPatternType.SOLID_FOREGROUND;
+ FillPatternTypeEnum fillPatternType() default FillPatternTypeEnum.DEFAULT;
/**
* Set the background fill color.
@@ -148,6 +151,6 @@ public @interface HeadStyle {
/**
* Controls if the Cell should be auto-sized to shrink to fit if the text is too long
*/
- boolean shrinkToFit() default false;
+ BooleanEnum shrinkToFit() default BooleanEnum.DEFAULT;
}
diff --git a/src/main/java/com/alibaba/excel/constant/OrderConstant.java b/src/main/java/com/alibaba/excel/constant/OrderConstant.java
index 54d438e5..309b6297 100644
--- a/src/main/java/com/alibaba/excel/constant/OrderConstant.java
+++ b/src/main/java/com/alibaba/excel/constant/OrderConstant.java
@@ -7,6 +7,16 @@ package com.alibaba.excel.constant;
*/
public class OrderConstant {
+ /**
+ * The system's own style
+ */
+ public static int DEFAULT_DEFINE_STYLE = -70000;
+
+ /**
+ * Annotation style definition
+ */
+ public static int ANNOTATION_DEFINE_STYLE = -60000;
+
/**
* Define style.
*/
@@ -15,10 +25,10 @@ public class OrderConstant {
/**
* default order.
*/
- public static final int DEFAULT_ORDER = 0;
+ public static int DEFAULT_ORDER = 0;
/**
* Sorting of styles written to cells.
*/
- public static final int FILL_STYLE = 50000;
+ public static int FILL_STYLE = 50000;
}
diff --git a/src/main/java/com/alibaba/excel/enums/BooleanEnum.java b/src/main/java/com/alibaba/excel/enums/BooleanEnum.java
new file mode 100644
index 00000000..ee5274d2
--- /dev/null
+++ b/src/main/java/com/alibaba/excel/enums/BooleanEnum.java
@@ -0,0 +1,33 @@
+package com.alibaba.excel.enums;
+
+import lombok.Getter;
+
+/**
+ * Default values cannot be used for annotations.
+ * So an additional an enumeration to determine whether the user has added the enumeration.
+ *
+ * @author Jiaju Zhuang
+ */
+@Getter
+public enum BooleanEnum {
+ /**
+ * NULL
+ */
+ DEFAULT(null),
+ /**
+ * TRUE
+ */
+ TRUE(Boolean.TRUE),
+ /**
+ * FALSE
+ */
+ FALSE(Boolean.FALSE),
+ ;
+
+ Boolean booleanValue;
+
+ BooleanEnum(Boolean booleanValue) {
+ this.booleanValue = booleanValue;
+ }
+
+}
diff --git a/src/main/java/com/alibaba/excel/enums/poi/BorderStyleEnum.java b/src/main/java/com/alibaba/excel/enums/poi/BorderStyleEnum.java
new file mode 100644
index 00000000..1033ef1a
--- /dev/null
+++ b/src/main/java/com/alibaba/excel/enums/poi/BorderStyleEnum.java
@@ -0,0 +1,95 @@
+package com.alibaba.excel.enums.poi;
+
+import lombok.Getter;
+import org.apache.poi.ss.usermodel.BorderStyle;
+
+/**
+ * The enumeration value indicating the line style of a border in a cell,
+ * i.e., whether it is bordered dash dot, dash dot dot, dashed, dotted, double, hair, medium,
+ * medium dash dot, medium dash dot dot, medium dashed, none, slant dash dot, thick or thin.
+ *
+ * @author Jiaju Zhuang
+ */
+@Getter
+public enum BorderStyleEnum {
+ /**
+ * null
+ */
+ DEFAULT(null),
+
+ /**
+ * No border (default)
+ */
+ NONE(BorderStyle.NONE),
+
+ /**
+ * Thin border
+ */
+ THIN(BorderStyle.THIN),
+
+ /**
+ * Medium border
+ */
+ MEDIUM(BorderStyle.MEDIUM),
+
+ /**
+ * dash border
+ */
+ DASHED(BorderStyle.DASHED),
+
+ /**
+ * dot border
+ */
+ DOTTED(BorderStyle.DOTTED),
+
+ /**
+ * Thick border
+ */
+ THICK(BorderStyle.THICK),
+
+ /**
+ * double-line border
+ */
+ DOUBLE(BorderStyle.DOUBLE),
+
+ /**
+ * hair-line border
+ */
+ HAIR(BorderStyle.HAIR),
+
+ /**
+ * Medium dashed border
+ */
+ MEDIUM_DASHED(BorderStyle.MEDIUM_DASHED),
+
+ /**
+ * dash-dot border
+ */
+ DASH_DOT(BorderStyle.DASH_DOT),
+
+ /**
+ * medium dash-dot border
+ */
+ MEDIUM_DASH_DOT(BorderStyle.MEDIUM_DASH_DOT),
+
+ /**
+ * dash-dot-dot border
+ */
+ DASH_DOT_DOT(BorderStyle.DASH_DOT_DOT),
+
+ /**
+ * medium dash-dot-dot border
+ */
+ MEDIUM_DASH_DOT_DOT(BorderStyle.MEDIUM_DASH_DOT_DOT),
+
+ /**
+ * slanted dash-dot border
+ */
+ SLANTED_DASH_DOT(BorderStyle.SLANTED_DASH_DOT);
+
+ BorderStyle poiBorderStyle;
+
+ BorderStyleEnum(BorderStyle poiBorderStyle) {
+ this.poiBorderStyle = poiBorderStyle;
+ }
+}
diff --git a/src/main/java/com/alibaba/excel/enums/poi/FillPatternTypeEnum.java b/src/main/java/com/alibaba/excel/enums/poi/FillPatternTypeEnum.java
new file mode 100644
index 00000000..26fb8b32
--- /dev/null
+++ b/src/main/java/com/alibaba/excel/enums/poi/FillPatternTypeEnum.java
@@ -0,0 +1,119 @@
+package com.alibaba.excel.enums.poi;
+
+import lombok.Getter;
+import org.apache.poi.ss.usermodel.FillPatternType;
+
+/**
+ * The enumeration value indicating the style of fill pattern being used for a cell format.
+ *
+ * @author Jiaju Zhuang
+ */
+@Getter
+public enum FillPatternTypeEnum {
+
+ /**
+ * null
+ */
+ DEFAULT(null),
+
+ /**
+ * No background
+ */
+ NO_FILL(FillPatternType.NO_FILL),
+
+ /**
+ * Solidly filled
+ */
+ SOLID_FOREGROUND(FillPatternType.SOLID_FOREGROUND),
+
+ /**
+ * Small fine dots
+ */
+ FINE_DOTS(FillPatternType.FINE_DOTS),
+
+ /**
+ * Wide dots
+ */
+ ALT_BARS(FillPatternType.ALT_BARS),
+
+ /**
+ * Sparse dots
+ */
+ SPARSE_DOTS(FillPatternType.SPARSE_DOTS),
+
+ /**
+ * Thick horizontal bands
+ */
+ THICK_HORZ_BANDS(FillPatternType.THICK_HORZ_BANDS),
+
+ /**
+ * Thick vertical bands
+ */
+ THICK_VERT_BANDS(FillPatternType.THICK_VERT_BANDS),
+
+ /**
+ * Thick backward facing diagonals
+ */
+ THICK_BACKWARD_DIAG(FillPatternType.THICK_BACKWARD_DIAG),
+
+ /**
+ * Thick forward facing diagonals
+ */
+ THICK_FORWARD_DIAG(FillPatternType.THICK_FORWARD_DIAG),
+
+ /**
+ * Large spots
+ */
+ BIG_SPOTS(FillPatternType.BIG_SPOTS),
+
+ /**
+ * Brick-like layout
+ */
+ BRICKS(FillPatternType.BRICKS),
+
+ /**
+ * Thin horizontal bands
+ */
+ THIN_HORZ_BANDS(FillPatternType.THIN_HORZ_BANDS),
+
+ /**
+ * Thin vertical bands
+ */
+ THIN_VERT_BANDS(FillPatternType.THIN_VERT_BANDS),
+
+ /**
+ * Thin backward diagonal
+ */
+ THIN_BACKWARD_DIAG(FillPatternType.THIN_BACKWARD_DIAG),
+
+ /**
+ * Thin forward diagonal
+ */
+ THIN_FORWARD_DIAG(FillPatternType.THIN_FORWARD_DIAG),
+
+ /**
+ * Squares
+ */
+ SQUARES(FillPatternType.SQUARES),
+
+ /**
+ * Diamonds
+ */
+ DIAMONDS(FillPatternType.DIAMONDS),
+
+ /**
+ * Less Dots
+ */
+ LESS_DOTS(FillPatternType.LESS_DOTS),
+
+ /**
+ * Least Dots
+ */
+ LEAST_DOTS(FillPatternType.LEAST_DOTS);
+
+ FillPatternType poiFillPatternType;
+
+ FillPatternTypeEnum(FillPatternType poiFillPatternType) {
+ this.poiFillPatternType = poiFillPatternType;
+ }
+}
diff --git a/src/main/java/com/alibaba/excel/enums/poi/HorizontalAlignmentEnum.java b/src/main/java/com/alibaba/excel/enums/poi/HorizontalAlignmentEnum.java
new file mode 100644
index 00000000..2c0b3511
--- /dev/null
+++ b/src/main/java/com/alibaba/excel/enums/poi/HorizontalAlignmentEnum.java
@@ -0,0 +1,94 @@
+package com.alibaba.excel.enums.poi;
+
+import lombok.Getter;
+import org.apache.poi.ss.usermodel.HorizontalAlignment;
+
+/**
+ * The enumeration value indicating horizontal alignment of a cell,
+ * i.e., whether it is aligned general, left, right, horizontally centered, filled (replicated),
+ * justified, centered across multiple cells, or distributed.
+ * @author Jiaju Zhuang
+ */
+@Getter
+public enum HorizontalAlignmentEnum {
+ /**
+ * null
+ */
+ DEFAULT(null),
+ /**
+ * The horizontal alignment is general-aligned. Text data is left-aligned.
+ * Numbers, dates, and times are rightaligned. Boolean types are centered.
+ * Changing the alignment does not change the type of data.
+ */
+ GENERAL(HorizontalAlignment.GENERAL),
+
+ /**
+ * The horizontal alignment is left-aligned, even in Rightto-Left mode.
+ * Aligns contents at the left edge of the cell. If an indent amount is specified, the contents of
+ * the cell is indented from the left by the specified number of character spaces. The character spaces are
+ * based on the default font and font size for the workbook.
+ */
+ LEFT(HorizontalAlignment.LEFT),
+
+ /**
+ * The horizontal alignment is centered, meaning the text is centered across the cell.
+ */
+ CENTER(HorizontalAlignment.CENTER),
+
+ /**
+ * The horizontal alignment is right-aligned, meaning that cell contents are aligned at the right edge of the cell,
+ * even in Right-to-Left mode.
+ */
+ RIGHT(HorizontalAlignment.RIGHT),
+
+ /**
+ * Indicates that the value of the cell should be filled
+ * across the entire width of the cell. If blank cells to the right also have the fill alignment,
+ * they are also filled with the value, using a convention similar to centerContinuous.
+ *
+ * Additional rules:
+ *
+ *
Only whole values can be appended, not partial values.
+ *
The column will not be widened to 'best fit' the filled value
+ *
If appending an additional occurrence of the value exceeds the boundary of the cell
+ * left/right edge, don't append the additional occurrence of the value.
+ *
The display value of the cell is filled, not the underlying raw number.
+ *
+ *
+ */
+ FILL(HorizontalAlignment.FILL),
+
+ /**
+ * The horizontal alignment is justified (flush left and right).
+ * For each line of text, aligns each line of the wrapped text in a cell to the right and left
+ * (except the last line). If no single line of text wraps in the cell, then the text is not justified.
+ */
+ JUSTIFY(HorizontalAlignment.JUSTIFY),
+
+ /**
+ * The horizontal alignment is centered across multiple cells.
+ * The information about how many cells to span is expressed in the Sheet Part,
+ * in the row of the cell in question. For each cell that is spanned in the alignment,
+ * a cell element needs to be written out, with the same style Id which references the centerContinuous alignment.
+ */
+ CENTER_SELECTION(HorizontalAlignment.CENTER_SELECTION),
+
+ /**
+ * Indicates that each 'word' in each line of text inside the cell is evenly distributed
+ * across the width of the cell, with flush right and left margins.
+ *
+ * When there is also an indent value to apply, both the left and right side of the cell
+ * are padded by the indent value.
+ *
+ *
A 'word' is a set of characters with no space character in them.
+ *
Two lines inside a cell are separated by a carriage return.
+ */
+ DISTRIBUTED(HorizontalAlignment.DISTRIBUTED);
+
+ HorizontalAlignment poiHorizontalAlignment;
+
+ HorizontalAlignmentEnum(HorizontalAlignment poiHorizontalAlignment) {
+ this.poiHorizontalAlignment = poiHorizontalAlignment;
+ }
+
+}
diff --git a/src/main/java/com/alibaba/excel/enums/poi/VerticalAlignmentEnum.java b/src/main/java/com/alibaba/excel/enums/poi/VerticalAlignmentEnum.java
new file mode 100644
index 00000000..d980beca
--- /dev/null
+++ b/src/main/java/com/alibaba/excel/enums/poi/VerticalAlignmentEnum.java
@@ -0,0 +1,71 @@
+package com.alibaba.excel.enums.poi;
+
+import lombok.Getter;
+import org.apache.poi.ss.usermodel.VerticalAlignment;
+
+/**
+ * This enumeration value indicates the type of vertical alignment for a cell, i.e.,
+ * whether it is aligned top, bottom, vertically centered, justified or distributed.
+ *
+ *
+ *
+ * @author Jiaju Zhuang
+ */
+@Getter
+public enum VerticalAlignmentEnum {
+ /**
+ * null
+ */
+ DEFAULT(null),
+ /**
+ * The vertical alignment is aligned-to-top.
+ */
+ TOP(VerticalAlignment.TOP),
+
+ /**
+ * The vertical alignment is centered across the height of the cell.
+ */
+ CENTER(VerticalAlignment.CENTER),
+
+ /**
+ * The vertical alignment is aligned-to-bottom. (typically the default value)
+ */
+ BOTTOM(VerticalAlignment.BOTTOM),
+
+ /**
+ *
+ * When text direction is horizontal: the vertical alignment of lines of text is distributed vertically,
+ * where each line of text inside the cell is evenly distributed across the height of the cell,
+ * with flush top and bottom margins.
+ *
+ *
+ * When text direction is vertical: similar behavior as horizontal justification.
+ * The alignment is justified (flush top and bottom in this case). For each line of text, each
+ * line of the wrapped text in a cell is aligned to the top and bottom (except the last line).
+ * If no single line of text wraps in the cell, then the text is not justified.
+ *
+ * When text direction is horizontal: the vertical alignment of lines of text is distributed vertically,
+ * where each line of text inside the cell is evenly distributed across the height of the cell,
+ * with flush top
+ *
+ *
+ * When text direction is vertical: behaves exactly as distributed horizontal alignment.
+ * The first words in a line of text (appearing at the top of the cell) are flush
+ * with the top edge of the cell, and the last words of a line of text are flush with the bottom edge of the cell,
+ * and the line of text is distributed evenly from top to bottom.
+ *