Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] aspects on org.w3c.dom classes

I'm trying to intercept calls on a org.w3c.dom.Document and its Elements.
For this, I use the aspect fragment below.

public aspect MutationInterceptor {

    public String org.w3c.dom.Document.configuration;

    pointcut intercept() : call(* org.w3c.dom.Element.setAttribute(..));


    pointcut create() : call(* DocumentBuilder.newDocument(..));

    after(): intercept() {

        // do something

    }

    after() returning (Document doc) : create() {

        // do something

    }

}

Using a small test program which uses JAXP to create a new document and set
an attribute on the document's root element, I can see that:

1) Both advises are executed; they work as expected.

2) The configuration inter-type declaration does not work as expected. I get
a NoSuchMethodException.

I'm using AspectJ1.1.1 with Eclipse 2.1/AJDE1.1.4, Sun JRE1.4.1_01.

Can anyone give me a clue to what is going wrong?




Back to the top