1 2 3 4 5 6 7 8 9 10 11
import org.aspectj.lang.*; import org.aspectj.lang.reflect.*; aspect Aspect { before() : execution(public * (!java..*).*(..)) { SourceLocation sl = thisJoinPointStaticPart.getSourceLocation(); String s = thisJoinPoint + "@" + sl.getFileName() + ":" + sl.getLine(); System.err.println(s); } }