Skip to content

feat: add composable annotations support#920

Draft
bengbengbalabalabeng wants to merge 3 commits into
apache:mainfrom
bengbengbalabalabeng:feat-composable-annotations
Draft

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

Conversation

@bengbengbalabalabeng
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

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.

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`).
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