According to error-setting-a-default-null-value-for-an-annotations-field
its not possible to affect null to an optional default value, here my case
having
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface SubView {
Class EntityType();
String[] Listing();
}
how to encode the default value for the optional SubView property?
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface SubTab {
String name();
String[] Fields() default {};
SubView SubView() default ??? ; //this is optional how to code it?
}
trial and error
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface SubTab {
String name();
String[] Fields() default {};
SubView SubView() default @SubView(Listing={}, EntityType=Object.class);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With