Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-dev] @method

Hello again,

I attach @Logged to all getter methods in the Rechnung class:

    declare @method: public * Rechnung.get*(..): @Logged;

Depending on this annotation I define a pointcut:

    after() : execution(@Logged * *..*(..)) {
        log.info(thisJoinPoint);
    }

It works as expected. But when I try to access the annotation I get a
null result. Here the access:

    public void testMethodAnnoation() throws SecurityException,
            NoSuchMethodException {
        Method m = Rechnung.class.getMethod("getSumme", (Class[]) null);
        Annotation a = m.getAnnotation(Logged.class);
        assertNotNull(a);
    }

When I put the @Logged annotation manually before the getSumme()-method
I get the Logged-annotation in the test method. Is this normal?

regards
Oliver


Back to the top