Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
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:
@Target({ElementType.TYPE, ElementType.METHOD})
To see a list of all your options, check out the official docs for the ElementType enum.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up