Skip to content

Commit 798e7f3

Browse files
authored
Release 0.0.2
* Rename: SXSSFExcelFile -> SXSSFExporter로 파일명 변경 * Rename: ExcelExporter -> DefaultExcelExporter 파일명 변경 * Rename: ExcelFile -> ExcelExporter 파일명 변경 * Rename: 엑셀 exporter 관련 클래스 core -> core.exporter로 패키지 이동 * Rename: ExcelExporterBuilder -> DefaultExcelExporterBuilder * Rename : core에 Exporter관련 클래스 core.exporter로 패키지 이동, meta 패키지 core 패키지로 이동 * Chore : gradle gradle-8.10 에서 gradle-8.14로 버전 up * Chore : java 버전 21로 변경
1 parent f75963f commit 798e7f3

21 files changed

+82
-78
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ List<Product> products = Arrays.asList(
105105
);
106106

107107
// 3. Export to Excel
108-
ExcelExporter<Product> exporter = ExcelExporter.builder(Product.class, products)
108+
DefaultExcelExporter<Product> exporter = DefaultExcelExporter.builder(Product.class, products)
109109
.sheetStrategy(SheetStrategy.MULTI_SHEET) // Optional, MULTI_SHEET is default
110110
.maxRows(100) // Optional, Max row of SpreadsheetVersion.EXCEL2007 is default
111111
.sheetName("Products") // Optional, if not specified sheets will be named Sheet0, Sheet1, etc.

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ repositories {
1919

2020
java {
2121
toolchain {
22-
languageVersion = JavaLanguageVersion.of(23)
22+
languageVersion = JavaLanguageVersion.of(21)
2323
}
2424
withSourcesJar() // 소스 코드도 포함
2525
}

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

src/main/java/io/github/hee9841/excel/annotation/Excel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
*
4242
* // Usage example:
4343
* List{@literal <}UserData{@literal >} users = getUserData();
44-
* ExcelExporter{@literal <}UserData{@literal >} exporter = ExcelExporter.builder(UserData.class, users)
44+
* DefaultExcelExporter{@literal <}UserData{@literal >} exporter = DefaultExcelExporter.builder(UserData.class, users)
4545
* .sheetName("Users")
4646
* .build();
4747
* exporter.write(new FileOutputStream("users.xlsx"));

src/main/java/io/github/hee9841/excel/annotation/ExcelColumn.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package io.github.hee9841.excel.annotation;
22

33
import io.github.hee9841.excel.format.CellFormats;
4-
import io.github.hee9841.excel.meta.ColumnDataType;
4+
import io.github.hee9841.excel.core.meta.ColumnDataType;
55
import java.lang.annotation.ElementType;
66
import java.lang.annotation.Retention;
77
import java.lang.annotation.RetentionPolicy;

src/main/java/io/github/hee9841/excel/core/ExcelExporter.java renamed to src/main/java/io/github/hee9841/excel/core/exporter/DefaultExcelExporter.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
package io.github.hee9841.excel.core;
1+
package io.github.hee9841.excel.core.exporter;
22

33
import io.github.hee9841.excel.exception.ExcelException;
44
import io.github.hee9841.excel.strategy.SheetStrategy;
55
import java.text.MessageFormat;
66
import java.util.List;
77

88
/**
9-
* ExcelExporter is a concrete implementation of {@link SXSSFExcelFile} that provides functionality
9+
* DefaultExcelExporter is a concrete implementation of {@link SXSSFExporter} that provides functionality
1010
* for exporting data to Excel files. This class uses the SXSSFWorkbook from Apache POI for
1111
* efficient
1212
* handling of large datasets by streaming data to disk.
1313
*
14-
* <p>The ExcelExporter supports two sheet management strategies:</p>
14+
* <p>The DefaultExcelExporter supports two sheet management strategies:</p>
1515
* <ul>
1616
* <li>ONE_SHEET - All data is exported to a single sheet (limited by max rows per sheet)</li>
1717
* <li>MULTI_SHEET - Data is split across multiple sheets when exceeding max rows per sheet</li>
1818
* </ul>
1919
*
20-
* <p>Use the {@link ExcelExporterBuilder} to configure and instantiate this class.</p>
20+
* <p>Use the {@link DefaultExcelExporterBuilder} to configure and instantiate this class.</p>
2121
*
2222
* @param <T> The type of data to be exported to Excel. The type must be annotated appropriately
2323
* for Excel column mapping using the library's annotation system.
24-
* @see SXSSFExcelFile
25-
* @see ExcelExporterBuilder
24+
* @see SXSSFExporter
25+
* @see DefaultExcelExporterBuilder
2626
* @see SheetStrategy
2727
*/
28-
public class ExcelExporter<T> extends SXSSFExcelFile<T> {
28+
public class DefaultExcelExporter<T> extends SXSSFExporter<T> {
2929

3030
private static final String EXCEED_MAX_ROW_MSG_2ARGS =
3131
"The data size exceeds the maximum number of rows allowed per sheet. "
@@ -44,18 +44,18 @@ public class ExcelExporter<T> extends SXSSFExcelFile<T> {
4444

4545

4646
/**
47-
* Constructs an ExcelExporter with the specified configuration.
47+
* Constructs an DefaultExcelExporter with the specified configuration.
4848
*
49-
* <p>This constructor is not meant to be called directly. Use {@link ExcelExporterBuilder}
50-
* to create instances of ExcelExporter.</p>
49+
* <p>This constructor is not meant to be called directly. Use {@link DefaultExcelExporterBuilder}
50+
* to create instances of DefaultExcelExporter.</p>
5151
*
5252
* @param type The class type of the data to be exported
5353
* @param data The list of data objects to be exported
5454
* @param sheetStrategy The strategy for sheet management (ONE_SHEET or MULTI_SHEET)
5555
* @param sheetName Base name for sheets (null for default names)
5656
* @param maxRowsPerSheet Maximum number of rows allowed per sheet
5757
*/
58-
ExcelExporter(
58+
DefaultExcelExporter(
5959
Class<T> type,
6060
List<T> data,
6161
SheetStrategy sheetStrategy,
@@ -74,15 +74,15 @@ public class ExcelExporter<T> extends SXSSFExcelFile<T> {
7474

7575

7676
/**
77-
* Creates a new builder for configuring and instantiating an ExcelExporter.
77+
* Creates a new builder for configuring and instantiating an DefaultExcelExporter.
7878
*
7979
* @param <T> The type of data to be exported
8080
* @param type The class of the data type
8181
* @param data The list of data objects to be exported
82-
* @return A new ExcelExporterBuilder instance
82+
* @return A new DefaultExcelExporterBuilder instance
8383
*/
84-
public static <T> ExcelExporterBuilder<T> builder(Class<T> type, List<T> data) {
85-
return new ExcelExporterBuilder<>(type, data, supplyExcelVersion.getMaxRows());
84+
public static <T> DefaultExcelExporterBuilder<T> builder(Class<T> type, List<T> data) {
85+
return new DefaultExcelExporterBuilder<>(type, data, supplyExcelVersion.getMaxRows());
8686
}
8787

8888

src/main/java/io/github/hee9841/excel/core/ExcelExporterBuilder.java renamed to src/main/java/io/github/hee9841/excel/core/exporter/DefaultExcelExporterBuilder.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
package io.github.hee9841.excel.core;
1+
package io.github.hee9841.excel.core.exporter;
22

33
import io.github.hee9841.excel.exception.ExcelException;
44
import io.github.hee9841.excel.strategy.SheetStrategy;
55
import java.util.List;
66

77
/**
8-
* Builder class for creating and configuring {@link ExcelExporter} instances.
8+
* Builder class for creating and configuring {@link DefaultExcelExporter} instances.
99
* This class implements the Builder pattern to provide a fluent interface for
1010
* configuring Excel export settings.
1111
*
@@ -18,7 +18,7 @@
1818
*
1919
* <p>Example usage:</p>
2020
* <pre>
21-
* ExcelExporter&lt;MyData&gt; exporter = ExcelExporter.builder(MyData.class, dataList)
21+
* DefaultExcelExporter&lt;MyData&gt; exporter = DefaultExcelExporter.builder(MyData.class, dataList)
2222
* .sheetStrategy(SheetStrategy.ONE_SHEET)
2323
* .maxRows(10000)
2424
* .sheetName("MySheet")
@@ -27,7 +27,7 @@
2727
*
2828
* @param <T> The type of data to be exported
2929
*/
30-
public class ExcelExporterBuilder<T> {
30+
public class DefaultExcelExporterBuilder<T> {
3131

3232
private final Class<T> type;
3333
private final List<T> data;
@@ -39,13 +39,13 @@ public class ExcelExporterBuilder<T> {
3939
private String sheetName;
4040

4141
/**
42-
* Constructs a new ExcelExporterBuilder with the specified type and data.
42+
* Constructs a new DefaultExcelExporterBuilder with the specified type and data.
4343
*
4444
* @param type The class type of the data to be exported
4545
* @param data The list of data objects to be exported
4646
* @param supplyExcelMaxRows The maximum number of rows supported by the Excel version
4747
*/
48-
ExcelExporterBuilder(
48+
DefaultExcelExporterBuilder(
4949
Class<T> type,
5050
List<T> data,
5151
int supplyExcelMaxRows
@@ -64,7 +64,7 @@ public class ExcelExporterBuilder<T> {
6464
* @param sheetStrategy The strategy to use for sheet management (ONE_SHEET or MULTI_SHEET)
6565
* @return This builder instance for method chaining
6666
*/
67-
public ExcelExporterBuilder<T> sheetStrategy(SheetStrategy sheetStrategy) {
67+
public DefaultExcelExporterBuilder<T> sheetStrategy(SheetStrategy sheetStrategy) {
6868
this.sheetStrategy = sheetStrategy;
6969
return this;
7070
}
@@ -76,7 +76,7 @@ public ExcelExporterBuilder<T> sheetStrategy(SheetStrategy sheetStrategy) {
7676
* @return This builder instance for method chaining
7777
* @throws ExcelException if maxRowsPerSheet exceeds the Excel version's maximum row limit
7878
*/
79-
public ExcelExporterBuilder<T> maxRows(int maxRowsPerSheet) {
79+
public DefaultExcelExporterBuilder<T> maxRows(int maxRowsPerSheet) {
8080
if (maxRowsPerSheet > supplyExcelMaxRows) {
8181
throw new ExcelException(String.format(
8282
"The maximum rows per sheet(%d) cannot exceed the supplied Excel sheet version's maximum row limit(%d).",
@@ -99,18 +99,18 @@ public ExcelExporterBuilder<T> maxRows(int maxRowsPerSheet) {
9999
* @param sheetName The base name for sheets
100100
* @return This builder instance for method chaining
101101
*/
102-
public ExcelExporterBuilder<T> sheetName(String sheetName) {
102+
public DefaultExcelExporterBuilder<T> sheetName(String sheetName) {
103103
this.sheetName = sheetName;
104104
return this;
105105
}
106106

107107
/**
108-
* Builds and returns a new ExcelExporter instance with the configured settings.
108+
* Builds and returns a new DefaultExcelExporter instance with the configured settings.
109109
*
110-
* @return A new ExcelExporter instance
110+
* @return A new DefaultExcelExporter instance
111111
*/
112-
public ExcelExporter<T> build() {
113-
return new ExcelExporter<T>(
112+
public DefaultExcelExporter<T> build() {
113+
return new DefaultExcelExporter<T>(
114114
this.type,
115115
this.data,
116116
this.sheetStrategy,

src/main/java/io/github/hee9841/excel/core/ExcelFile.java renamed to src/main/java/io/github/hee9841/excel/core/exporter/ExcelExporter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package io.github.hee9841.excel.core;
1+
package io.github.hee9841.excel.core.exporter;
22

33
import java.io.IOException;
44
import java.io.OutputStream;
@@ -16,7 +16,7 @@
1616
*
1717
* @param <T> The type of data to be handled in the Excel file
1818
*/
19-
public interface ExcelFile<T> {
19+
public interface ExcelExporter<T> {
2020

2121
/**
2222
* Writes the Excel file content to the specified output stream.

src/main/java/io/github/hee9841/excel/core/SXSSFExcelFile.java renamed to src/main/java/io/github/hee9841/excel/core/exporter/SXSSFExporter.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
package io.github.hee9841.excel.core;
1+
package io.github.hee9841.excel.core.exporter;
22

33
import io.github.hee9841.excel.exception.ExcelException;
4-
import io.github.hee9841.excel.meta.ColumnInfo;
5-
import io.github.hee9841.excel.meta.ColumnInfoMapper;
4+
import io.github.hee9841.excel.core.meta.ColumnInfo;
5+
import io.github.hee9841.excel.core.meta.ColumnInfoMapper;
66
import java.io.IOException;
77
import java.io.OutputStream;
88
import java.lang.reflect.Field;
@@ -36,9 +36,9 @@
3636
*
3737
* @param <T> The type of data to be handled in the Excel file
3838
*/
39-
public abstract class SXSSFExcelFile<T> implements ExcelFile<T> {
39+
public abstract class SXSSFExporter<T> implements ExcelExporter<T> {
4040

41-
protected static final Logger logger = LoggerFactory.getLogger(SXSSFExcelFile.class);
41+
protected static final Logger logger = LoggerFactory.getLogger(SXSSFExporter.class);
4242

4343
protected static final SpreadsheetVersion supplyExcelVersion = SpreadsheetVersion.EXCEL2007;
4444

@@ -49,9 +49,9 @@ public abstract class SXSSFExcelFile<T> implements ExcelFile<T> {
4949
protected String dtoTypeName;
5050

5151
/**
52-
* Constructs a new SXSSFExcelFile with a new SXSSFWorkbook instance.
52+
* Constructs a new SXSSFExporter with a new SXSSFWorkbook instance.
5353
*/
54-
protected SXSSFExcelFile() {
54+
protected SXSSFExporter() {
5555
this.workbook = new SXSSFWorkbook();
5656
}
5757

src/main/java/io/github/hee9841/excel/meta/ColumnDataType.java renamed to src/main/java/io/github/hee9841/excel/core/meta/ColumnDataType.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package io.github.hee9841.excel.meta;
1+
package io.github.hee9841.excel.core.meta;
22

33
import io.github.hee9841.excel.annotation.ExcelColumnStyle;
44
import io.github.hee9841.excel.exception.ExcelException;
@@ -30,10 +30,12 @@ public enum ColumnDataType {
3030
* Automatically determine the cell type based on the field type
3131
*/
3232
AUTO,
33+
3334
/**
3435
* No specific cell type (default)
3536
*/
3637
_NONE,
38+
3739
/**
3840
* Numeric cell type for various number formats
3941
*/
@@ -50,6 +52,7 @@ public enum ColumnDataType {
5052
CellFormats._NONE,
5153
true
5254
),
55+
5356
/**
5457
* Boolean cell type
5558
*/
@@ -61,6 +64,7 @@ public enum ColumnDataType {
6164
CellFormats._NONE,
6265
true
6366
),
67+
6468
/**
6569
* String cell type for text values
6670
*/
@@ -72,6 +76,7 @@ public enum ColumnDataType {
7276
CellFormats._NONE,
7377
true
7478
),
79+
7580
/**
7681
* Enum cell type - uses toString() to get the value
7782
*/
@@ -81,6 +86,7 @@ public enum ColumnDataType {
8186
CellFormats._NONE,
8287
true
8388
),
89+
8490
/**
8591
* Formula cell type - value is treated as an Excel formula
8692
*/

0 commit comments

Comments
 (0)