BAEL-5140 Retrieve field's annotations (#11254)

This commit is contained in:
polomos
2021-10-11 03:30:06 +02:00
committed by GitHub
parent e04657748f
commit 92ad02ae77
6 changed files with 82 additions and 2 deletions

View File

@@ -0,0 +1,9 @@
package com.baeldung.readannotations;
public class ClassWithAnnotations {
@FirstAnnotation
@SecondAnnotation
@ThirdAnnotation
private String classMember;
}

View File

@@ -0,0 +1,8 @@
package com.baeldung.readannotations;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
public @interface FirstAnnotation {
}

View File

@@ -0,0 +1,8 @@
package com.baeldung.readannotations;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
public @interface SecondAnnotation {
}

View File

@@ -0,0 +1,8 @@
package com.baeldung.readannotations;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.SOURCE)
public @interface ThirdAnnotation {
}