• Stars
    star
    445
  • Rank 98,085 (Top 2 %)
  • Language
  • License
    Other
  • Created over 5 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A curated list of resources related to the Java annotation processing API (JSR 269)

Awesome Java Annotation Processing

Java Annotation Processing (defined by 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. This Awesome List aims at providing an overview of helpful resources around that API, including existing useful annotation processors, related presentations and blog posts, implementation best practices etc.

Existing Annotation Processors

Existing annotation processors for different purposes

  • avaje-inject - Compile-time dependency injection library.

  • avaje-jsonb - JSON mapping using generated source code

  • chimera - Compile-time static analysis and generation of commands for Spigot plugins.

  • dekorate - Generates manifests for Kubernetes/OpenShift.

  • Dagger - Compile-time dependency injection framework for both Java and Android.

  • derive4j - Java 8 annotation processor and framework for deriving algebraic data types constructors, pattern-matching, folds, optics and typeclasses.

  • domino-jackson - Generates Jackson based JSON mappers where the same mapper can be used on the JVM/android or GWT client Javascript code.

  • domino-rest - Generates rest clients from JaxRs compatible interfaces.

  • Duzzt - Duzzt - Annotation-based Embedded DSL Generator for Java.

  • Google Auto - A collection of source code generators for Java.

  • Google Error Prone - A static analysis tool for Java that catches common programming mistakes at compile-time.

  • Gson Path - A Java annotation processor library which generates gson type adapters using basic JsonPath style annotations.

  • Hibernate Validator annotation processor - Compile-time checking of Bean Validation constraints.

  • JPA Static Metamodel Generator - Creates JPA 2 static metamodel classes.

  • Immutables - Java annotation processors to generate simple, safe and consistent value objects.

  • JMH Generator - Generates Java Microbenchmark Harness (JMH) benchmarks.

  • jbock - Generates command line parsers.

  • jstachio - A typesafe Java Mustache templating engine that compiles templates into readable Java code.

  • Magic Bean - A very basic library which will generate POJOs.

  • MapStruct - Compile-time generator for type-safe bean-to-bean mapping code.

  • Micronaut - A modern full-stack framework for building modular, easily testable microservice and serverless applications.

  • Pojo Analyzer - A library enables looping over POJOs' fields or access them by their names, and retreive their getters & setters.

  • Record Builder - Adds Builders and Withers for Java Records (added in Java 16).

  • Sundrio - A collection of apt-based code generating tools, including advanced builder generator, dsl generator, velocity transformer and etc.

  • 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.

  • chocotea - Generates postman collection, environment and integration tests from Java code.

Android

Annotation processors specific to Android development

  • Butter Knife - Bind Android views and callbacks to fields and methods.

  • Parceler - Android Parcelables made easy through code generation.

Useful Tools

Useful tools and libraries for implementing annotation processors

  • Apache Velocity - A Java-based template engine

  • APTK - A toolbox that helps you to build annotation processors in a more efficient way.

  • Avaje Prisms - A JDK 11 fork of Hickory with some minor enhancements.

  • Compile Testing - Testing tools for javac and annotation processors.

  • CUTE - Testing tools for javac and annotation processors. Allows unit and black box testing.

  • Elementary - A suite of JUnit 5 extensions that provides a real annotation processing environment during testing

  • JavaPoet - A Java API for generating .java source files.

  • Hickory - An annotation processor for generating "prisms", allowing to access known annotation types without class references; Maven coordinates, fork repo (There is no official source repo existing)

APIs and tools going beyond what’s doable with JSR 269

  • Spoon - Source Code Analysis and Transformation for Java (allows for AST modifications, too)

  • javac Plug-in API (allows for full AST inspection)

  • Project Lombok - Generates boilerplate Java code like getters/setters and equals/hashCode methods.

More Repositories

1

1brc

1️⃣🐝🏎️ The One Billion Row Challenge -- A fun exploration of how quickly 1B rows from a text file can be aggregated with Java
Java
5,179
star
2

awesome-opensource-data-engineering

An Awesome List of Open-Source Data Engineering Projects
1,913
star
3

jfr-custom-events

Demo of Java Flight Recorder custom events and event streaming
Java
76
star
4

search.morling.dev

Serverless website search for morling.dev
Java
34
star
5

jdkapidiff

NOTE: This project has been migrated to https://github.com/AdoptOpenJDK/jdk-api-diff
Java
32
star
6

quarkus-qute

Java
30
star
7

quarkus-pdf-extract

Quarkus-based microservice to extract text from PDF files
Java
24
star
8

methodvalidation-integration

This project is the a playground for prototyping the integration of the method-level validation feature new in Hibernate Validator 4.2 and frameworks providing adequate AOP/interception facilities such as CDI or Spring AOP.
Java
21
star
9

records-bean-validation

Example showing how to apply Bean Validation constraints to the components of Java 14 record types
Java
17
star
10

kafka-knative-demo

Demo for DevNation Tech Talk 2020 (Debezium/Kafka Streams/Quarkus/Knative)
JavaScript
14
star
11

scriptable-dataset

A scriptable dataset for DBUnit
Java
13
star
12

simd-fizzbuzz

Simple demo for using the Java 16 Vector API, using the well-known "FizzBuzz" example
Java
11
star
13

kcetcd

An example source connector for Kafka Connect, ingesting data from etcd
Java
10
star
14

run-detached

A shell script for running tasks on a git repo in a detached branch, allowing to continue with other tasks in parallel
Shell
10
star
15

lazy-constants

Lazy constants via JDK 11's CONSTANT_Dynamic (JEP 309)
Java
10
star
16

morling.dev

Source code for Gunnar Morling's website.
CSS
9
star
17

pgoutput-cli

A command line client for consuming Postgres logical decoding events in the pgoutput format
Python
9
star
18

musings-of-a-programming-addict

Source code for posts from Gunnar Morling's blog
Java
8
star
19

quarkus-cds

Exploration of using CDS (class-data sharing) with Quarkus
HTML
6
star
20

zip-gatherer

Proof-of-concept for a Java 22 gatherer for zipping two streams
Java
6
star
21

kafka-testing

A container image for starting up Apache Kafka and ZooKeeper for testing
Java
5
star
22

unix-domain-socket-poc

A PoC for using Java 16's Unix domain socket support (JEP 380) with the Vert.x Postgres driver
Java
5
star
23

quarkus-with-jib

Exploration of using Quarkus with Jib
HTML
4
star
24

scripting-extension

A CDI portable extension allowing to retrieve JSR 223 scripting engines via dependency injection
Java
4
star
25

jx-binding

Advanced data binding and validation for JavaFX
Java
3
star
26

modular-resource-bundles

Demo for loading resources on module path and classpath
Java
3
star
27

concurrency-utilities-cdi

Java
3
star
28

cloud-boxes

Terraform scripts for provisioning nodes in the Hetzner cloud
HCL
3
star
29

script-assert

A JSR 303 ("Bean Validation") constraint, that allows to use script languages for constraint definitions. NOTE: This project is abandoned. The @ScriptAssert annotation is now part of Hibernate Validator 4.1
Java
3
star
30

bridge-methods-demo

Example for injecting bridge methods using Bridger
Java
2
star
31

hidden-classes

An example for Java 15 hidden classes
Java
2
star
32

postgres-ivm-demo

Exploration of pg_ivm (a Postgres extension for incrementally updated materialized views)
Dockerfile
2
star
33

scenicview-mvp

Java
2
star
34

gunnarmorling

My personal README
2
star
35

discussions.morling.dev

Discussions forum for morling.dev
Java
2
star
36

bv-tools

A set of Eclipse plug-ins for the Bean Validation API
Java
1
star
37

quarkus-on-render

Demo for deploying a native Quarkus application on render.com
HTML
1
star
38

hibernate-orm-on-java9-modules

Java
1
star
39

decodable-webhook-demo

A demo for processing GitHub web hooks with the Decodable REST connector
Java
1
star
40

loom-web

Explorations of Project Loom
Java
1
star
41

eventful

An exploration for implementing an event sourcing event store with SQLite
HTML
1
star
42

money-validation

Validation support for javax.money
Java
1
star
43

hyperfoil-playground

Experimentations with Hyperfoil
HTML
1
star
44

quarkus-with-sqlite

Example project demonstrating the usage of SQLite with Quarkus
HTML
1
star
45

signature-check-jlink-plugin

A proof-of-concept for a jlink plug-in for detecting API signature mismatches between modules
Java
1
star
46

postgres-publication-filtering

A demo of using column lists and row filters from Postgres 15 with Debezium
Dockerfile
1
star
47

jfr-blocking-analysis

Playground for analysing blocked queue producers with JFR Analytics
Java
1
star
48

solar-watch

Scripts and configuration for retrieving the data from a GoodWe solar inverter, storing it in InfluxDB and visualizing it via Grafana.
Python
1
star