Finishing the Annotation - Targets and Elements4:01 with Chris Ramacciotti
During this video we will continue writing our annotation, first by specifying the targets. These configure which Java components can be "decorated" with our annotation, for example classes, methods, fields, etc. We'll wrap up the annotation by defining elements or attributes. Think of these elements as instance fields for the Java component that's been annotated.
Valid Locations for Annotations
While creating our annotation, we used the following to indicate that we want developers to be able to apply the
@Doc annotation to classes and methods:
To see a list of all your options, check out the official docs for the ElementType enum.
You need to sign up for Treehouse in order to download course files.Sign up