Introduction: In Kotlin, data classes are widely used for modeling data in applications due to their concise syntax and built-in functionalities. However, ensuring data integrity and validity within these classes can be challenging, especially when it comes to validating field values against specific criteria such as regular expressions. Manually validating each field upon assignment or object initialization can lead to…
#annotations
4 posts
16 May 2024
9 May 2016
Java 8 introduced JSR-308, which added new annotation capabilities to the Java language. Most importantly: Type annotations. It is now possible to design monsters like the below: The code displayed in that tweet really compiles. Every type can be annotated now, in order to enhance the type system in any custom way. Why, you may … Continue reading JSR-308 and…
20 Jan 2016
Sometimes, when we get pull requests for jOOQ or our other libraries, people change the code in our unit tests to be more “idiomatic JUnit”. In particular, this means that they tend to change this (admittedly not so pretty code): … into this, “better” and “cleaner” version: What have we gained? Nothing! Sure, we already … Continue reading Use JUnit’s…
12 Jan 2013
Today I implemented the last feature of my bachelor thesis and struggled upon a small problem: My DSL makes use of XAnnotation to annotate various grammar elements. The generators can extend the DSL by introducing new annotations which can be used for modifying the generation process of the resulting fragments. […] The post Accessing the values of an annotation inside…