Created
November 7, 2019 03:43
-
-
Save hokkun-dayo/a7bab9e4a3b970ad07c929ab09aeed13 to your computer and use it in GitHub Desktop.
annotation test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { | |
} | |
} |
Author
hokkun-dayo
commented
Nov 7, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment