Skip to content

feat: add composable annotations support - #920

Open
bengbengbalabalabeng wants to merge 12 commits into
apache:mainfrom
bengbengbalabalabeng:feat-composable-annotations
Open

feat: add composable annotations support#920
bengbengbalabalabeng wants to merge 12 commits into
apache:mainfrom
bengbengbalabalabeng:feat-composable-annotations

Conversation

@bengbengbalabalabeng

@bengbengbalabalabeng bengbengbalabalabeng commented May 24, 2026

Copy link
Copy Markdown
Contributor

Purpose of the pull request

Related: #918

Added composable annotations support. For more usage examples, please refer to #918.

What's changed?

  1. Introduce two meta-annotations, @FesodMarked and @FesodMarked.AliasFor, to expand the Target - ElementType#ANNOTATION_TYPE restriction scope for other internal annotations except @ExcelIgnore and @ExcelIgnoreUnannotated, making it convenient for users to define custom combined annotations.
  2. Added enableMetaMarked to selectively enable composite annotation analysis. (Disabled by default)
  3. Defines AnnotatedElementDescriptor to encapsulate the class/field-level element types and (composable) annotations in ExcelHeadProperty.
  4. Define AnnotationMetadataReader to refactor the internal annotation parsing and storage approach.
  5. New AnnotatedClassUtils utility class (similar to ClassUtils) added to handle field parsing (read/write).
  6. Added unit tests and integration tests, covering scenarios such as field-level annotations, class-level annotations, and class + field - level annotations.

Unresolved: #919
My handling: Delete this part of the logic in AnnotatedClassUtils.

Checklist

  • I have read the Contributor Guide.
  • I have written the necessary doc or comment.
  • I have added the necessary unit tests and all cases have passed.

bengbengbalabalabeng and others added 8 commits May 17, 2026 23:06
Task-1: Collect all annotation (include composite) map when initializing the read/write head property.
Task-2:

-  Introduced `AnnotatedTypeDescriptor` and `AnnotatedFieldDescriptor` abstract models to carry metadata parsing logic at the class and field dimensions, respectively.
-  Encapsulated the `AnnotatedClassUtils`, rewriting part of the `ClassUtils` logic based on `AnnotatedElementDescriptor`.
-  Introduced the `enableMetaMarked` configuration flag to ensure read/write stability when handling legacy ClassUtils logic (such as `declaredExcelContentProperty` and `declaredFields`).
@bengbengbalabalabeng
bengbengbalabalabeng marked this pull request as ready for review July 27, 2026 10:54
# Conflicts:
#	fesod-sheet/src/test/java/org/apache/fesod/sheet/cache/CacheDataTest.java
#	fesod-sheet/src/test/java/org/apache/fesod/sheet/style/AnnotatedFieldDescriptorTest.java
#	fesod-sheet/src/test/java/org/apache/fesod/sheet/style/AnnotatedTypeDescriptorTest.java
#	fesod-sheet/src/test/java/org/apache/fesod/sheet/style/AnnotationAttributesTest.java
#	fesod-sheet/src/test/java/org/apache/fesod/sheet/style/AnnotationMapTest.java
#	fesod-sheet/src/test/java/org/apache/fesod/sheet/style/AnnotationMetadataReaderTest.java
#	fesod-sheet/src/test/java/org/apache/fesod/sheet/style/AnnotationMetadataResolverTest.java
#	fesod-sheet/src/test/java/org/apache/fesod/sheet/style/AnnotationMetadataTest.java
#	fesod-sheet/src/test/java/org/apache/fesod/sheet/style/composite/AnnotatedDescriptorAssertions.java
#	fesod-sheet/src/test/java/org/apache/fesod/sheet/style/composite/CompositeAnnotationTest.java
#	fesod-sheet/src/test/java/org/apache/fesod/sheet/style/composite/DirectAnnotationTest.java
#	fesod-sheet/src/test/java/org/apache/fesod/sheet/style/composite/IntegrationAnnotations.java
#	fesod-sheet/src/test/java/org/apache/fesod/sheet/style/composite/IntegrationCompositeAnnotationTest.java
#	fesod-sheet/src/test/java/org/apache/fesod/sheet/style/composite/IntegrationExcelDatas.java
#	fesod-sheet/src/test/java/org/apache/fesod/sheet/style/composite/WorkbookAsserts.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant