I have my Custom Annotation MyAnnotation.
I wanted to access the parameter passed to MyAnnotation.
MyAnnotation.java
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface MyAnnotation {
public String value() default 0;
}
myClient.java
public class myClient{
@MyAnnotation(value=10)
public int someMethod(int addition){
//Wanted to Access the Value Of Value here which is 10
}
}
我们如何在someMethod()中访问Value的值。