A simple demonstration of using the Java annotation processor to give compilation errors for annotated types. See output by running:
./compile.sh
-target 1.8 -source 1.8 -Aunits=org.hsrinara.typechecker.custom.Price,org.hsrinara.typechecker.custom.Quantity
Enable annotation processor by ticking the checkbox
org.checkerframework.checker.units.UnitsChecker
- The official documentation on the unit-checker.
- The google groups on the unit-checker
- A clear blog post with a section on annotation processors.