Skip to content

Instantly share code, notes, and snippets.

@hokkun-dayo
Created November 7, 2019 03:43
Show Gist options
  • Save hokkun-dayo/a7bab9e4a3b970ad07c929ab09aeed13 to your computer and use it in GitHub Desktop.
Save hokkun-dayo/a7bab9e4a3b970ad07c929ab09aeed13 to your computer and use it in GitHub Desktop.
annotation test
package net.hokkun;
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
public class TestTarget {
@TestAnnotation1 private final String foo;
@TestAnnotation2 private final String bar;
@TestAnnotation3 private final String baz;
public TestTarget(String foo, String bar, String baz) {
this.foo = foo;
this.bar = bar;
this.baz = baz;
}
public String getFoo() {
return foo;
}
public String getBar() {
return bar;
}
public String getBaz() {
return baz;
}
@Target(ElementType.FIELD)
public @interface TestAnnotation1 {
}
@Target({ElementType.FIELD, ElementType.TYPE_USE})
public @interface TestAnnotation2 {
}
@Target({ElementType.TYPE_USE, ElementType.FIELD})
public @interface TestAnnotation3 {
}
}
@hokkun-dayo
Copy link
Author

Screen Shot 2019-11-07 at 12 44 16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment