{"id":18088752,"url":"https://github.com/gunnarmorling/awesome-annotation-processing","last_synced_at":"2025-04-04T18:09:50.631Z","repository":{"id":35424667,"uuid":"184131270","full_name":"gunnarmorling/awesome-annotation-processing","owner":"gunnarmorling","description":"A curated list of resources related to the Java annotation processing API (JSR 269)","archived":false,"fork":false,"pushed_at":"2024-04-09T16:59:34.000Z","size":12,"stargazers_count":448,"open_issues_count":4,"forks_count":46,"subscribers_count":25,"default_branch":"master","last_synced_at":"2024-05-23T04:03:24.565Z","etag":null,"topics":["annotation-processing","annotation-processor","awesome-list","java"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gunnarmorling.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-04-29T19:29:11.000Z","updated_at":"2024-05-19T22:24:59.000Z","dependencies_parsed_at":"2024-04-17T04:00:41.824Z","dependency_job_id":"4bd44cfe-cb41-4154-aff3-743614869843","html_url":"https://github.com/gunnarmorling/awesome-annotation-processing","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gunnarmorling%2Fawesome-annotation-processing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gunnarmorling%2Fawesome-annotation-processing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gunnarmorling%2Fawesome-annotation-processing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gunnarmorling%2Fawesome-annotation-processing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gunnarmorling","download_url":"https://codeload.github.com/gunnarmorling/awesome-annotation-processing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247092377,"owners_count":20882218,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["annotation-processing","annotation-processor","awesome-list","java"],"created_at":"2024-10-31T17:14:36.422Z","updated_at":"2025-04-04T18:09:50.608Z","avatar_url":"https://github.com/gunnarmorling.png","language":null,"funding_links":[],"categories":["Resources","资源"],"sub_categories":["Awesome Lists","Related Awesome Lists","相关的真棒列表"],"readme":"= Awesome Java Annotation Processing\n:toc:\n:toc-placement!:\n\nJava Annotation Processing (defined by https://jcp.org/en/jsr/detail?id=269[JSR 269]) is a standardized API for hooking into the Java compiler, allowing you to validate the code under compilation and generate additional (source or byte) code.\nThis https://github.com/topics/awesome-list[Awesome List] aims at providing an overview of helpful resources around that API,\nincluding existing useful annotation processors, related presentations and blog posts, implementation best practices etc.\n\ntoc::[]\n\n== Existing Annotation Processors\n\n_Existing annotation processors for different purposes_\n\n* https://github.com/avaje/avaje-inject[avaje-inject] - Compile-time dependency injection library.\n* https://github.com/avaje/avaje-jsonb[avaje-jsonb] - JSON mapping using generated source code\n* https://github.com/avaje/avaje-http[avaje-http] - Generates adapter code for Javalin and Helidon SE/Nima from JAX-RS style controllers. \n* https://github.com/Pante/chimera[chimera] - Compile-time static analysis and generation of commands for Spigot plugins.\n* https://github.com/dekorateio/dekorate[dekorate] - Generates manifests for Kubernetes/OpenShift.\n* https://google.github.io/dagger/[Dagger] - Compile-time dependency injection framework for both Java and Android.\n* https://github.com/derive4j/derive4j[derive4j] - Java 8 annotation processor and framework for deriving algebraic data types constructors, pattern-matching, folds, optics and typeclasses.\n* https://github.com/DominoKit/domino-jackson[domino-jackson] - Generates Jackson based JSON mappers where the same mapper can be used on the JVM/android or GWT client Javascript code.\n* https://github.com/DominoKit/domino-rest[domino-rest] - Generates rest clients from JaxRs compatible interfaces.\n* https://github.com/misberner/duzzt[Duzzt] - Duzzt - Annotation-based Embedded DSL Generator for Java.\n* https://github.com/google/auto[Google Auto] - A collection of source code generators for Java.\n* https://github.com/google/error-prone[Google Error Prone] - A static analysis tool for Java that catches common programming mistakes at compile-time.\n* https://github.com/LachlanMcKee/gsonpath[Gson Path] - A Java annotation processor library which generates gson type adapters using basic JsonPath style annotations.\n* http://docs.jboss.org/hibernate/stable/validator/reference/en-US/html_single/#validator-annotation-processor[Hibernate Validator annotation processor] - Compile-time checking of Bean Validation constraints.\n* https://github.com/xmolecules/jmolecules-integrations/tree/main/jmolecules-apt[jMolecules annotation processor] - Verifies rules attached to https://github.com/xmolecules/jmolecules[jMolecules] concepts.\n* https://docs.jboss.org/hibernate/orm/current/topical/html_single/metamodelgen/MetamodelGenerator.html[JPA Static Metamodel Generator] - Creates JPA 2 static metamodel classes.\n* https://immutables.github.io/[Immutables] - Java annotation processors to generate simple, safe and consistent value objects.\n* https://github.com/openjdk/jmh[JMH Generator] - Generates Java Microbenchmark Harness (JMH) benchmarks.\n* https://github.com/jbock-java/jbock[jbock] - Generates command line parsers.\n* https://github.com/jstachio/jstachio[jstachio] - A typesafe Java Mustache templating engine that compiles templates into readable Java code.\n* https://github.com/bowbahdoe/magic-bean[Magic Bean] - A very basic library which will generate POJOs.\n* http://mapstruct.org/[MapStruct] - Compile-time generator for type-safe bean-to-bean mapping code.\n* https://micronaut.io[Micronaut] - A modern full-stack framework for building modular, easily testable microservice and serverless applications.\n* https://github.com/almogtavor/pojo-analyzer[Pojo Analyzer] - A library enables looping over POJOs' fields or access them by their names, and retreive their getters \u0026 setters.\n* https://github.com/Randgalt/record-builder[Record Builder] - Adds Builders and Withers for Java Records (added in Java 16).\n* https://github.com/sundrio/sundrio[Sundrio] - A collection of apt-based code generating tools, including advanced builder generator, dsl generator, velocity transformer and etc.\n* https://github.com/civitz/viper[Viper] - A generator and a framework for injecting configurations via the java EE's CDI. Put all your configuration keys in an enum, and make viper inject the configurations in your beans.\n* https://github.com/cleopatra27/chocotea[chocotea] - Generates postman collection, environment and integration tests from Java code.\n* https://github.com/cuzfrog/sharedtype[sharedtype] - Generates type information from Java source code to Typescript, Rust, Go, and more.\n\n=== Android\n\n_Annotation processors specific to Android development_\n\n* https://github.com/JakeWharton/butterknife[Butter Knife] - Bind Android views and callbacks to fields and methods.\n* https://github.com/johncarl81/parceler[Parceler] - Android Parcelables made easy through code generation.\n\n== Useful Tools\n\n_Useful tools and libraries for implementing annotation processors_\n\n* https://velocity.apache.org[Apache Velocity] - A Java-based template engine\n* https://github.com/toolisticon/aptk[APTK] - A toolbox that helps you to build annotation processors in a more efficient way.\n* https://github.com/avaje/avaje-prisms[Avaje Prisms] - A JDK 11 fork of Hickory with some minor enhancements.\n* https://github.com/google/compile-testing[Compile Testing] - Testing tools for javac and annotation processors.\n* https://github.com/ascopes/java-compiler-testing[Java Compiler Testing] - Library for integration testing annotation processors against javac. Supports testing packages and JPMS modules, uses in-memory file systems, and includes integrations with Junit5 and AssertJ.\n* https://github.com/toolisticon/cute[CUTE] - Testing tools for javac and annotation processors. Allows unit and black box testing.\n* https://github.com/Pante/elementary[Elementary] - A suite of JUnit 5 extensions that provides a real annotation processing environment during testing\n* https://github.com/square/javapoet[JavaPoet] - A Java API for generating .java source files.\n* https://javadoc.io/static/com.jolira/hickory/1.0.0/net/java/dev/hickory/prism/package-summary.html[Hickory] - An annotation processor for generating \"prisms\", allowing to access known annotation types without class references; https://mvnrepository.com/artifact/com.jolira/hickory/1.0.0[Maven coordinates], https://github.com/vietj/hickory[fork repo] (There is no official source repo existing) \n\n\n== Slide Decks and Recordings\n\n* https://speakerdeck.com/rharter/at-eliminate-boilerplate-1[@Eliminate(\"Boilerplate\")]\n* https://jakewharton.com/annotation-processing-boilerplate-destruction-square-waterloo/[Annotation Processing Boilerplate Destruction]\n* https://www.slideshare.net/raphaelbrugier/quickie-annotationsprocessordevoxxfr2015[Annotation Processor, trésor caché de la JVM] (French)\n* https://github.com/fbiville/annotation-processing-ftw[Annotation Processing Hands-on Labs, Devoxx France 2015] (French)\n* https://de.slideshare.net/deors/javaone-2017-con3282-code-generation-with-annotation-processors-state-of-the-art-in-java-9[Code Generation with Annotation Processors: State of the Art in Java 9]\n* https://speakerdeck.com/gunnarmorling/das-annotation-processing-api-use-cases-und-best-practices[Das Annotation Processing API - Use Cases und Best Practices] (German)\n\n== Blog Posts and Articles\n\n* http://hannesdorfmann.com/annotation-processing/annotationprocessing101[Annotation Processing 101]\n* https://medium.com/@iammert/annotation-processing-dont-repeat-yourself-generate-your-code-8425e60c6657[Annotation Processing : Don’t Repeat Yourself, Generate Your Code.]\n* https://blog.jooq.org/2018/12/07/how-to-unit-test-your-annotation-processor-using-joor/[How to Unit Test Your Annotation Processor using jOOR]\n* https://jax.de/blog/core-java-jvm-languages/java-annotation-processing-das-koennte-auch-ein-computer-erledigen/[Java Annotation Processing: Das könnte auch ein Computer erledigen] (German)\n* https://www.baeldung.com/java-annotation-processing-builder[Java Annotation Processing and Creating a Builder]\n* https://dzone.com/articles/the-problem-with-annotation-processors[The Problem with Annotation Processors]\n* https://medium.com/androidiots/writing-your-own-annotation-processors-in-android-1fa0cd96ef11[Writing your own Annotation Processors in Android]\n* https://deors.wordpress.com/2011/09/26/annotation-types[Code Generation using Annotation Processors in the Java language]\n\n== Related Concepts\n\n_APIs and tools going beyond what's doable with JSR 269_\n\n* http://spoon.gforge.inria.fr/[Spoon] - Source Code Analysis and Transformation for Java (allows for AST modifications, too)\n* https://docs.oracle.com/javase/8/docs/jdk/api/javac/tree/com/sun/source/util/Plugin.html[javac Plug-in API] (allows for full AST inspection)\n* https://projectlombok.org/[Project Lombok] - Generates boilerplate Java code like getters/setters and equals/hashCode methods.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgunnarmorling%2Fawesome-annotation-processing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgunnarmorling%2Fawesome-annotation-processing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgunnarmorling%2Fawesome-annotation-processing/lists"}