Created
August 30, 2017 17:35
-
-
Save kevinhooke/0a566b490bf29fe57aca9e51d069efeb to your computer and use it in GitHub Desktop.
Java Annotations on multiple target types
This file contains 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
By default, @Target on one type, eg for properties: | |
@Target(ElementType.FIELD) | |
public @interface ExamplePropertyAnnotation | |
Specifying multiple targets as a List of target types: | |
@Target( { ElementType.FIELD, ElementType.PARAMETER } ) | |
public @interface ExamplePropertyAndParameterAnnotation |
Thanks!
Thanks!!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks!