Annotation default "null" value
try that:
Config value() default @Config();
No, you can't use null
for an annotation attribute value. However you can use an array type and provide an empty array.
public @interface Foo {
Config[] value();
}
...
@Foo(value = {})
or
public @interface Foo {
Config[] value() default {};
}
...
@Foo