bengbengbalabalabeng commented on issue #854:
URL: https://github.com/apache/fesod/issues/854#issuecomment-3998036959
Or try this approach:
```java
@ExcelProperty(
// Old
// groups = Class<?>[]
// New
groups = Object[]
)
enum SheetGroupView {
BY_MARKER_INTERFACE, // Or BY_TYPE_BASED
BY_STRING_BASED
}
```
Usage example:
```java
FesodSheet.write(fileName)
.head(OrderData.class)
// .view(SheetGroupView.BY_MARKER_INTERFACE, DetailGroup.class)
.group(DetailGroup.class)
.sheet()
.doWrite(dataList);
FesodSheet.write(fileName)
.head(OrderData.class)
// .view(SheetGroupView.BY_STRING_BASED, "base", "detail")
.tag("base", "detail")
.sheet()
.doWrite(dataList);
```
With this design, `SheetGroupView` acts as an explicit switch that
determines how the grouping values should be interpreted.
This approach supporting both marker‑interface grouping and lightweight
string‑based tags. while avoiding the need to introduce multiple annotations.
WDYT? @delei
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]