Java Aspectj Usage unWrapJoinPoint(final JoinPoint point)

Here you can find the source of unWrapJoinPoint(final JoinPoint point)

Description

Unwraps a join point that may be nested due to layered proxies.

License

Apache License

Parameter

Parameter Description
point Join point to unwrap.

Return

Innermost join point; if not nested, simply returns the argument.

Declaration

public static JoinPoint unWrapJoinPoint(final JoinPoint point) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import org.aspectj.lang.JoinPoint;

public class Main {
    /**//from   w  w w  .j a va2 s .c o  m
     * Unwraps a join point that may be nested due to layered proxies.
     *
     * @param point Join point to unwrap.
     * @return Innermost join point; if not nested, simply returns the argument.
     */
    public static JoinPoint unWrapJoinPoint(final JoinPoint point) {
        JoinPoint naked = point;
        while (naked.getArgs().length > 0
                && naked.getArgs()[0] instanceof JoinPoint) {
            naked = (JoinPoint) naked.getArgs()[0];
        }
        return naked;
    }
}

Related

  1. resolveFileName(final String fileName)
  2. setSourceLine(InstructionHandle ih, int lineNumber)
  3. strip(String[] src, String[] toStrip)
  4. type(final JoinPoint joinPoint)
  5. typeName(final JoinPoint joinPoint)