Announcement Announcement Module
Collapse
No announcement yet.
How to catch classes that extends some class .. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to catch classes that extends some class ..

    Hi

    Is there a way to create a pointcut that will catch all the classes that extends some class , or implement some interface .. ?

    I know that I might be asking for too much ..

    Thanks in advance

  • #2
    I think it's possible if you use a correct name declartions for your class.

    example
    class flowers

    class flowersRoses extend flowers

    ....

    annotaions on : flowers...

    Comment


    • #3
      If you prefix your classname in your pointcut with + it will mean or any of its subclasses (or implementations when it is an interface).

      So if we take the following classes.

      Code:
      package com.myorg.flowers
      
      public abstract class Flower {}
      
      public class Rose extends Flower {}
      
      public class Tulip extends Flower {}
      The following pointcut woud match all flowers or its subclasses.

      Code:
      execution (* flowers.Flowers+.*(..));

      Comment

      Working...
      X