Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] how to use Introduction in aspect

Could you help me to use "Introduction" ?
For example: I have class Point:

public class Point{
    int x,y;
}

I have an aspect to add the function to set the X value (just use as a simple example):

public aspect SetXValueAspect{
    public void Point.setX(int val){
        x = val;
    }
}

How can I use this function out side the aspect ? Assume that I have a main function outside the aspect:

public class TestAspect{
    public static void main(String[] args){
        Point p;
       --> How can I call the function setX() in aspect SetXValueAspect ?
    }
}

Thank you.
MH.
 

Back to the top