[aspectwerkz-user] RE: Pb with annotations and constructor selection
"Olivier Mallassi" <[email protected]> Tue, 19 Jul 2005 17:10:12 +0200
| Newsgroups | gmane.comp.java.aspectwerkz.user |
|---|---|
| Message-ID | <[email protected]> |
Hi all,
I have a field with an annotation like this
...
@Authorization(authorization = { AuthorizationEnum.PROFILE_ONE })
private Action _action;
...
the action is instantiated later in the code by this way:
_action = new AbstractAction("the action..."){
...
};
I am trying to define a pointcut that could select the construction of
_action
So I tried the following expression...
execution(@org.annotations.Authorization * *..*.new(..))
...which respects, I guess, the pattern <annotations> <modifiers>
<className>.<new>(<parameter_types>)
when I run the app., the "weave phase" fail with the following error
AspectWerkz - INFO - Pre-processor
org.codehaus.aspectwerkz.transform.AspectWerk
zPreProcessor loaded and initialized
org.codehaus.aspectwerkz.exception.DefinitionException: expression is
not well-f
ormed [execution(@org.annotations.Authorization * *..*.new(..))]: Using
a c
onstructor pattern with an explicit return type is not allowed
at
org.codehaus.aspectwerkz.expression.ExpressionInfo.<init>(ExpressionI
nfo.java:96)
at
org.codehaus.aspectwerkz.definition.DefinitionParserHelper.createAndA
ddPointcutDefToAspectDef(DefinitionParserHelper.java:62)
at
org.codehaus.aspectwerkz.definition.DocumentParser.parsePointcutEleme
nts(DocumentParser.java:631)
......
I have certainly misunderstood something but I really don't know
what......
Thanks for your help.
Olivier
PS: the following expression works well but I am not sure to get only
the construction of the field:
set(@org.annotations.Authorization private * *..*.*)