/** * Gets the caller class by examing the stacktrace. * * @param excluded * a list of filters which should be not considered as caller * @return the caller of */ public static Class<?> getCallerClass(final Pattern... excluded) { return getCallerClass(excluded, new Class<?>[0]); }
/** * Gets the caller class by examing the stacktrace. * * @return the caller class */ public static Class<?> getCallerClass() { return getCallerClass(new Pattern[0]); }
/** * Gets the caller class by examing the stacktrace. * <p> * Sometime the caller of the method is an aspect. With this method you have * the chance to list the aspects which should be ignored. * </p> * * @param excluded * the excluded * @return the caller of a joinpoint */ public static Class<?> getCallerClass(final Class<?>... excluded) { return StackTraceScanner.getCallerClass(ADVICE_PATTERNS, excluded); }
/** * Gets the caller class by examing the stacktrace. * <p> * Sometime the caller of the method is an aspect. Because normally you do * not want the aspect it is filtered out. If you really want it call * {@link #getCallerOf(JoinPoint, Pattern...)} direct with an empty pattern * argument. * </p> * * @return the caller of a joinpoint * @see #getCallerOf(JoinPoint, Pattern...) */ public static Class<?> getCallerClass() { return StackTraceScanner.getCallerClass(ADVICE_PATTERNS, JoinPointHelper.class); }