[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [aspectj-users] selecting join points using annotations
|
This is easily possible:
pointcut encryptionOp(String data) : execution(@Encrypt void *(String)) && args(data);
void around(String data) : encryption(data) {
proceed(encrypt(data));
}
pointcut decryptionOp() : execution(@Decrypt String *(..));
String around() : decryptionOp() {
String encryptedData = proceed();
return decrypt(encryptedData);
}
-Ramnivas
On Fri, Sep 18, 2009 at 6:47 PM, Robert Taylor
<rtaylor@xxxxxxxxxxxxxx> wrote:
Greetings,
I have a need to leverage AOP to encrypt certain
POJO setter String args prior to persisting them to the database
and to
decrypt certain POJO getter methods return String values after they have
retrieved String data from the database.
I wanted to do this using annotations. For
example:
@Encrypt
public void setCreditCardNumber(String ccn)
...
@Decrypt
public String getCreditCardNumber()...
and it looked promising, however, it can only be
used if you are using Maven to build
your project. Unfortunately, I have no
immediate plans to use Maven.
I haven't found any similar projects which simply
use Ant tags; so I'm attempting to "roll my own" solution.
I've read through the AspectJ language docs and
haven't found any information on selecting join points using
annotations.
I browsed the docs on AspectJ 5 Developers Notebook
regarding annotations, but it doesn't look like what I need.
I only want the methods selected by AspectJ if
they have been properly identified using an annotation.
Is this possible with the current AspectJ
version?
/robert
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users