3.1 Special variable in debugging code (advice code)

Special string in debugging code

The following special string can be used

Special string
Explanation
since



thisJoinPoint  -- String type

Infomation of a debugging code insertion position (line number, file name etc).
1.0.0
thisJoinPoint.location  -- String type

Infomation of a debugging code insertion position od source code
1.0.0
thisJoinPoint.line  -- int type

Line number of a debugging code insertion position. 1.0.0
thisJoinPoint.file  --String type

name of source file of a debugging code insertion position. 1.0.0
thisJoinPoint.filePath  --String type

Path of source file of a debugging code insertion position. 1.4.8
thisJoinPoint.kind  --String type

Kind of a debugging code insertion position. 1.0.0
thisJoinPoint.field

In fieldSet and fieldGet, the value of the field. Others null.
1.0.0
thisJoinPoint.target

In methodCall, fieldSet and@fieldGet, the value of the target object. Others null.B
1.0.0
thisJoinPoint.within  -- String type

name of class which is running at JoinPoint
1.4.4
thisJoinPoint.withincode  -- String type

name of method which is running at JoinPoint
1.4.4
thisJoinPoint.variables  --java.lang.Object[][] type
detail

Map which is all variables of class and local in the debugging code insertion position
Object[index][0] is name of variable (String type) Object[index][1] is value of variable
1.4.4
thisJoinPoint.weavehost  -- String[] type

List of IP address of the host where weaving was executed
1.5.0

   


Special character

Detail is writen in tutorial of javassist

pointcut
special character
Explanation
fieldSet
$0
Express declared object include a accessed field. But if field is static, express null.
$1
The value of substituted.
fieldGet
$0
Express declared object include a accessed field. But if field is static, express null.
$_
The accessed value.
methodCall
$0
Express declared object include a called method. But if field is static, express null.
$1,$2,$3,...
The args of called method.
constructorCall
$_
The created Object.
$1,$2,$3,... The args of constructor.
instanceof
$1
The object on the left-hand side of an instanceof operation.
$r
The class on the right-hand side of an instanceof operation.
$_
The result of an instanceod operation. (boolean type)
cast
$1
The tartget object of a cast operation.
$r
The class of a cast operation. (java.lang.Class type)
handler
$1
The exception object caught in a catch clause statement.
methodExecution
$1,$2,$3,... The args of method.
constructorExecution
$1,$2,$3,... The args of constructor.