I have the following custom annotation:
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface CustomAnnotation {
public String value() default "";
}
and the following class:
public class CustomClass {
@CustomAnnotation
private String name;
}
Is it possible to set the CustomAnnotation's default value() to be equal to field variable name in specified class, instead of being hardcoded to an empty String as in this example - that is, to adapt dynamically when applied to a certain field in Class, unless explicitly specified otherwise? E.g. in this case it would be "name" in CustomClass.
"".