get Target
Returns JoinPoint.target cast to T.
Useful when advice code needs to interact with the receiver beyond the generic Any? type.
Example
@Before(target = [Audited::class])
fun doBefore(jp: JoinPoint) {
val service = jp.getTarget<UserService>()
service.recordAccess()
}Content copied to clipboard
Throws
if the target cannot be cast to T.
if the target is null (top-level or companion-object function).