Skip to content

feat(java): annotation processor for android serialization#3670

Open
chaokunyang wants to merge 52 commits into
apache:mainfrom
chaokunyang:android_annotation_processor
Open

feat(java): annotation processor for android serialization#3670
chaokunyang wants to merge 52 commits into
apache:mainfrom
chaokunyang:android_annotation_processor

Conversation

@chaokunyang
Copy link
Copy Markdown
Collaborator

@chaokunyang chaokunyang commented May 11, 2026

Why?

Java runtime code generation is disabled on Android and unavailable in GraalVM native images, so @ForyStruct users need a build-time serializer path that preserves schema metadata, compatible reads, and the same wire protocol without falling back to reflective object serializers.

What does this PR do?

  • Adds the fory-annotation-processor Maven module and processor for generating same-package static serializers for Java @ForyStruct classes and records.
  • Adds static serializer runtime support, including deterministic lookup, descriptor metadata exposure, copy/read/write paths, and compatible-mode reads for generated serializers.
  • Extends Java descriptor, generic type, type annotation, and type definition handling so generated descriptors can carry nested TypeRef, TypeExtMeta, @ForyField, and @ArrayType metadata without runtime annotated-field reflection.
  • Documents static struct serializers and clarifies Android, configuration, and GraalVM behavior for build-time serializers versus runtime codegen/native-image generation.
  • Adds annotation processor tests, updates xlang test fixture construction, and adds an Android Go xlang CI job.

Related issues

#1017
#3405
#1101
#2435
#3667

AI Contribution Checklist

  • Substantial AI assistance was used in this PR: yes / no
  • If yes, I included a completed AI Contribution Checklist in this PR description and the required AI Usage Disclosure.
  • If yes, my PR description includes the required ai_review summary and screenshot evidence of the final clean AI review results from both fresh reviewers on the current PR diff or current HEAD after the latest code changes.

Does this PR introduce any user-facing change?

  • Does this PR introduce any public API change?
  • Does this PR introduce any binary protocol compatibility change?

Benchmark

@chaokunyang chaokunyang changed the title feat(java): implement annotation processor for android serialization feat(java): annotation processor for android serialization May 11, 2026
@chaokunyang chaokunyang force-pushed the android_annotation_processor branch from 9c17111 to 7c3d32c Compare May 12, 2026 23:58
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.

2 participants