Tim Eck wrote: Moving this to tc-dev as per Steve's suggestion... > I think have part of this working now (bunch of things to clean up, and > still have to deal with config)... > > I'm using an AW expression like this: > > hasfield(@com.tctest.AnnotationTestApp$Root * *) > > which seems to work, but I just tried something at random. Any idea if > that is the right thing to use? :-) > Oh I already started to forget how it works. :-) hasfield(<field pattern>) is an expression for the class level, so not quite what we need here.
Field access is matching on pointcuts get(<field pattern>) and set(<field pattern>) See http://aspectwerkz.codehaus.org/definition_issues.html#Pointcut_definition You probably will have to use the FieldInfo and pass it trough access get(@com.tctest.AnnotationTestApp$Root * *..*.*) or set(..) pointcuts, depends if it is a GETFIELD or PUTFIELD opcode. regards, Eugene >> -----Original Message----- >> From: Eugene Kuleshov [mailto:[EMAIL PROTECTED] >> Sent: Thursday, July 12, 2007 4:11 PM >> To: Tim Eck >> Subject: matching root fields based on annotations >> >> >> You'll need something like this: >> >> @Retention(RetentionPolicy.RUNTIME) >> @Target(ElementType.FIELD) >> public @interface Root { >> } >> >> public class Timmy { >> @Root >> private Object root; >> } >> >> You could extend the com.tctest.AnnotationTestApp and add test case >> for roots. >> >> AW's expression for matching fields by annotations would look >> something like this: >> >> @full.packagename.Root * *..*.* >> >> "*" in the middle stands for field type (I think modifier is optional, >> but you may have to confirm that). See >> >> > http://docs.terracotta.org/confluence/display/docs1/AspectWerkz+Pattern+La > >> nguage#AspectWerkzPatternLanguage-Fieldselections >> >> We have some difference with the current DSO declaration for roots, >> which only has <full_field_name> part of the expression. I am not sure >> what would be the best option, but maybe you will have to introduce new >> element like field-expression in addition to the current field-name >> element: >> >> <root> >> <!-- <field-name>...</field-name> --> >> <field-expression>@full.packagename.Root * >> *..*.*</field-expression> >> </root> >> >> unless you could handle the content of the current field-name element >> directly to the expression matcher... >> >> regards, >> Eugene >> >> _______________________________________________ tc-dev mailing list [email protected] http://lists.terracotta.org/mailman/listinfo/tc-dev
