Using type

The type signature is used to match the join point having the specified types. We can use the following syntax to specify the type:

within(type_to_specify) 

Here, the type will be either the package or the class name. The following are some of the expressions that can be written to specify the join points:

  • within(com.packt.ch04.*): This specifies all the methods from all the classes belonging to the com.packt.ch04 package.
  • within(com.packt.ch04..*): This specifies all the methods from all the classes belonging to the com.packt.ch04 package and its sub packages. We specified two dots instead of one to track the sub packages as well.
  • within(com.packt.ch04.MyClass): This specifies all the methods from MyClass belonging to the com.packt.ch04 package.
  • within(MyInterface+): This specifies all the methods from all the classes that implement MyInterface.
..................Content has been hidden....................

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