[
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 ?
|
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
>