Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] A way to generate a static arrays of annoted classes.


Le 14/08/2012 09:42, Romain Muller a écrit :
In a way, that looks a bit like a problem that may be better solved using APT (Annotation Processing Toolkit) and Java SPI (Service Provider Interfaces).

Essentially, you'd use APT tools to compile-time list all classes with your annotation and dump their names in the appropriate file in META-INF for java.util.ServiceLoader to pick up all the classes.

AFAIK, there isn't a way to achieve what you're trying to do with AspectJ.
In this case I prefer Reflexion.
Thanks you.

Le 14 août 2012 à 09:16, Jean-Jacques Peyronel a écrit :

Hi all,

I would like to generate a static arrays of annoted classes.

For exemple :

@PutInArray
Class A

@PutInArray
Class B

@PutInArray
Class C

Class Tools{
    static Class<?>  getAllClasses() {
        throw new runtimeException("Not yet implemented");
    }
}

Do you have an idea how to make it by aspectj ?

Best regards.
Jean-Jacques.

<jjpeyronel.vcf>_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users



_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users
begin:vcard
fn:Jean-Jacques Peyronel
n:Peyronel;Jean-Jacques
org:TOWA France;Informatique
adr:Ch de la bastide blanche;;Parc GVIO Bat A5;Vitrolles;;13127;France
email;internet:jjpeyronel@xxxxxxxxxxxxxx
title;quoted-printable:D=C3=A9veloppeur
tel;work:04 42 34 01 37
tel;fax:04 42 34 01 45
url:http://www.towa-france.fr
version:2.1
end:vcard

Attachment: signature.asc
Description: OpenPGP digital signature


Back to the top