Why am I getting an error \"Attribute value must be constant\". Isn\'t null constant???
@Target(ElementType.TYPE)
@Retention(RetentionPolicy
It seem there is one other way of doing it.
I don't like this either, but it might work.
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface SomeInterface {
Class<? extends Foo>[] bar() default {};
}
So basically you create an empty Array instead. This seems to allow a default value.