We create our own annotations. We study what the annotation consists of, what they are for and how to process them. Nikolai Bunis, senior engineer, will tell you about the main components of an annotation, its life cycle and scope. Using the Reflection API, let's figure out how to create our own annotation and write our annotation handler.undefined
As an example, let's take a familiar situation when you need to validate class fields for the minimum and maximum length, match the email template, and so on. There are 2 main options for how to do this. The first is to write the validation logic for each specific class every time. Well, the second option is to make an annotation processor and annotate the class fields. Thus, the logic will be written once. It is this example that we will analyze in our video.
Like, write in the comments what other examples with annotations you would like to analyze.
________
An example from the video can be found at the link below:
Bitbucket: https://bitbucket.org/nbu-team-one/ex...
________
Subscribe to our social networks:
Instagram: / mjc.talks
MJC Telegram Chat: https://t.me/mjcby
Community page: https://mjc.by
Watch video Creating annotation in java [Java AnnotationsundefinedReflection API] online without registration, duration hours minute second in high quality. This video was added by user MJC 17 June 2020, don't forget to share it with your friends and acquaintances, it has been viewed on our site 8,163 once and liked it 183 people.