AnnotationProcessor
From APIDesign
Line 3: | Line 3: | ||
[[NetBeans]] uses this style to convert nicely looking [[Annotations]] into a bit messy, yet powerful, [[NetBeansLayers|layer XML file systems]]. This feature is available since version 6.7 [[TheYearOfAnnotations2009|released in 2009]]. Get more details about [[CompileTimeCache]]s! | [[NetBeans]] uses this style to convert nicely looking [[Annotations]] into a bit messy, yet powerful, [[NetBeansLayers|layer XML file systems]]. This feature is available since version 6.7 [[TheYearOfAnnotations2009|released in 2009]]. Get more details about [[CompileTimeCache]]s! | ||
- | Where is the limit? As [[LiveDB]] essay shows, there is none - download your database schema and include it | + | Where is the limit? As [[LiveDB]] essay shows, there is none - download your database schema and include it as [[LiveDB|metadata of your compilation]! |
There are very interesting aspects for [[BackwardCompatibility]]. By having own processor code running during compilation, one can keep own annotation unchanged across multiple releases, yet each of the new releases can generate something different during the compilation. As a result, one can deliver performance improvements, or even slightly shift mean of the [[API]] just by letting people compile their applications against new version of own libraries. | There are very interesting aspects for [[BackwardCompatibility]]. By having own processor code running during compilation, one can keep own annotation unchanged across multiple releases, yet each of the new releases can generate something different during the compilation. As a result, one can deliver performance improvements, or even slightly shift mean of the [[API]] just by letting people compile their applications against new version of own libraries. |
Revision as of 16:39, 22 February 2019
Since JDK 1.6, its JavaC comes with standardized API for compile time processing of Annotations. Just by writing and registering a Processor in a JAR file of the API containing also the Annotations, one can effectively extend the compile time semantics of the Java language. By hooking into the compilation process of everyone using the JAR library, one can analyse all the Annotations usages, process them and generate additional files that can be then consumed during runtime.
NetBeans uses this style to convert nicely looking Annotations into a bit messy, yet powerful, layer XML file systems. This feature is available since version 6.7 released in 2009. Get more details about CompileTimeCaches!
Where is the limit? As LiveDB essay shows, there is none - download your database schema and include it as [[LiveDB|metadata of your compilation]!
There are very interesting aspects for BackwardCompatibility. By having own processor code running during compilation, one can keep own annotation unchanged across multiple releases, yet each of the new releases can generate something different during the compilation. As a result, one can deliver performance improvements, or even slightly shift mean of the API just by letting people compile their applications against new version of own libraries.