I'm pondering using java reflection to look for the NotNull / Nullable annotations that the kotlin compiler adds. The purpose is to implicitly determine properties on ORM entity beans that must not be not null db columns.
Is it safe to expect those annotations to always be present (always added to the associated fields by the Kotin compiler)?
Thanks, Rob.
Example:
Size(max = 100)
public var subject: String? = null;
// NotNull ... no need to explictly add separate NotNull annotation
// because Kotlin compiler will always add one for us
Size(max = 100) public var code: String = "";
// access flags 0x2 private Ljava/lang/String; subject @Ljavax/validation/constraints/Size;(max=100) // invisible @Lorg/jetbrains/annotations/Nullable;() // invisible
// access flags 0x2
private Ljava/lang/String; code
@Ljavax/validation/constraints/Size;(max=100) // invisible
@Lorg/jetbrains/annotations/NotNull;() // invisible