Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Help with pointcut on constructor for class with field of certain annotation

Hello,

Please how can I specify a pointcut that would match any constructor
of any class that has at least one instance varible of certain
annotation?

For example if the annotation is @B then:

class A {
 @B int field;

  A() {}
  A(int a) {}
}
//matches both constructors


class A {
 int field;

  A() {}
  A(int a) {}
}
//no match

class A {
 @B int field1;
 @B int field2;

  A() {}
  A(int a) {}
}
//matches both constructors

Thank you,
Pavel Kusch


Back to the top