BAEL-5140 Retrieve field's annotations (#11254)
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
package com.baeldung.readannotations;
|
||||
|
||||
public class ClassWithAnnotations {
|
||||
|
||||
@FirstAnnotation
|
||||
@SecondAnnotation
|
||||
@ThirdAnnotation
|
||||
private String classMember;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.baeldung.readannotations;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface FirstAnnotation {
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.baeldung.readannotations;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface SecondAnnotation {
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.baeldung.readannotations;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface ThirdAnnotation {
|
||||
}
|
||||
Reference in New Issue
Block a user