Learn to inspect annotations with Java reflection.
- [Instructor] In the Annotations video…of the Object Oriented Java chapter…we wrote this annotation.…If you're building tools,…you can use custom annotations to transfer information…from code written by your tools users to your tool itself.…Let's annotate the student class using our new annotation.…Since this is a silly annotation,…let's give it a silly string.…What does untesting mean?…Now, we'll learn how to access…custom annotations via Reflection.…
If you were writing a tool,…you could control the customs annotations for that tool.…However, you will need to find instances…of your custom annotations within your user's code.…You can do this via the get annotations method.…As before, we create a class object,…assert that it's not null,…and we use the class to get annotations.…After you have obtained an array of annotations,…you can search the array for particular annotations.…An alternative to obtaining an array is…to use reflections API to search…for a particular annotation.…
I'm using an array search in this example…
- The IMQAV model
- Downloading software
- Installing and setting up a Java coding environment
- Mock tests
- Code coverage
- Using windows, views, and modes in IntelliJ IDEA
- Creating classes and attributes
- Creating constructors
- Casting variables
- Matching literals with regular expressions
- Regular expressions
- Design patterns
Skill Level Intermediate
Java: Database Integration with JDBCwith David Gassner2h 51m Intermediate
NumPy Data Science Essential Trainingwith Charles Kelly3h 54m Intermediate
1. Getting Started with Java
2. Test-Driven Development
3. IntelliJ IDEA
4. Object-Oriented Java
6. Regular Expressions (Regex)
8. Design Patterns
9. Applying Data Science
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.