[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] How do we declare multilple class in @DeclareParents ?

I'm using AJDT  Eclipse 3.6 as we use RAD 8.0.0.4 from IBM.

From : http://www.eclipse.org/ajdt/whatsnew213/ - http://download.eclipse.org/tools/ajdt/36/update

 - org.eclipse.ajdt_2.1.3.e36x-20110622-1300.jar
 - org.eclipse.contribution.weaving_2.1.3.e36x-20110622-1300.jar
 - /org.eclipse.equinox.weaving.sdk_1.0.0.v20090817.jar






De :        Andy Clement <andrew.clement@xxxxxxxxx>
A :        aspectj-users@xxxxxxxxxxx
Date :        2012-05-02 13:44
Objet :        Re: [aspectj-users] How do we declare multilple class in @DeclareParents ?
Envoyé par :        aspectj-users-bounces@xxxxxxxxxxx




Hi,

What version of AspectJ are you using?

I just tried this (basically the same as yours) on 1.7.0 dev builds
and it was OK:


===== 8<==== Code2.java ===
package com;
import org.aspectj.lang.annotation.*;


class B {}
class C {}

@Aspect
class MoodIndicator {
 interface Moody {
   String getMood();
 };

 static class MoodyImpl implements Moody {
   public String getMood() { return "happy"; }
 }

 @DeclareParents(value="com.B || com.C", defaultImpl = MoodyImpl.class)
 private Moody implementedInterface;
}
===== 8<==== Code2.java ===
ajc -1.5 Code2.java -showWeaveInfo
Extending interface set for type 'com.B' (Code2.java) to include
'com.MoodIndicator$Moody' (Code2.java)
               
Type 'com.B' (Code2.java) has intertyped method from
'com.MoodIndicator' (Code2.java:'java.lang.String
com.MoodIndicator$Moody.getMood()')
               
Extending interface set for type 'com.C' (Code2.java) to include
'com.MoodIndicator$Moody' (Code2.java)
               
Type 'com.C' (Code2.java) has intertyped method from
'com.MoodIndicator' (Code2.java:'java.lang.String
com.MoodIndicator$Moody.getMood()')

I got exceptions (unexpected) when using it on 1.6.12/1.7.0.M1.

Are you getting exceptions or is it just not working?

cheers,
Andy

On 2 May 2012 06:22, Jean Andre <Jean.Andre@xxxxxxxxxx> wrote:
> How do we declare multilple class in @DeclareParents ?
>
> This syntaxe does not work :  @DeclareParents(value="com.c1 ||
> com.c2",defaultImpl=Implclass.class)
>
> Thank you
>
>
> _______________________________________________
> 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