Using reflection

Now that you have learnt how to declare annotations and how to attach them to classes and methods, we can return to our ProductInformation class. Recall that we wanted to specify the type of products in this class and that each product type is represented by an @interface annotation. We have already listed it in the previous few pages, the one we will implement in our  @PoweredDevice example. We will develop the code assuming that later there will be many such annotations, product types, and consistency checkers that are annotated with @Component and with one or more of our annotations.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.60.63