Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CodeSignature aspectJ

Tags:

java

aspectj

What is the CodeSignature in aspectJ? I tried to find JavaDocs but didn't find anything useful. For Instance, thy is the following signature is a CodeSignature:

pointcut log() : execution(@Log * *(..));

before() : log() {
    String[] names = ((CodeSignature) thisJoinPoint.getSignature()).getParameterNames();
}

Is there a JoinPoint such that thisJoinPoint.getSignature() that is not a CodeSignature?

like image 901
user3663882 Avatar asked Oct 31 '22 22:10

user3663882


1 Answers

CodeSignature represents a code block captured by a join point. It may be a method, constructor, initializer (static or non-static) or an advise. There are join points where the signature is not a CodeSignature. For example join points for field set and field get where the signature is a FieldSignature and join point for a catch clause has a CatchClauseSignature.

Signatures provide access to information on which join point is called upon.

like image 185
Aleksi Yrttiaho Avatar answered Nov 13 '22 05:11

Aleksi Yrttiaho