Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Using Annotation style to introduce members

Hi,

I'm new to Aspectj - so I hope this is not a silly question.

I've got an aspect which introduces some members in a class and works perfectly fine:

public aspect MyAspect {

  private long MyClass._timestamp;

  public void MyClass.initTimestamp() {
    _timestamp = System.currentTimeMillis();
  }

  after(MyClass example) : execution(mypackage.MyClass.new(..)) && this(example) {
    example.initTimestamp();
  }
}

I would like to rewrite the aspect using annotation style (as my other aspects use annotation style) - but couldn't find any examples in the documentation. Any help on where I can find examples or how to achieve this appreciated.

Thanks
/Mike

Back to the top