Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Is @DeclareParents the only way to make inter-type field declaration in @AspectJ notation

Greetings, I have a small doubt.
In AspectJ's "traditional" notation, it is possible to declare a new field for a type this way:
public aspect A {
    private FieldType  TargetType.field = <something>;
}
In @AspectJ notation do I have to create an interface (mixin) that has that field and use @DeclareParents/@DeclareMixin to make all instances of the type TargetType have that field.
Is there a simpler way?
Thanks

Back to the top