當前位置: 首頁>>代碼示例>>Java>>正文


Java JoinPoint.getTarget方法代碼示例

本文整理匯總了Java中org.aspectj.lang.JoinPoint.getTarget方法的典型用法代碼示例。如果您正苦於以下問題:Java JoinPoint.getTarget方法的具體用法?Java JoinPoint.getTarget怎麽用?Java JoinPoint.getTarget使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.aspectj.lang.JoinPoint的用法示例。


在下文中一共展示了JoinPoint.getTarget方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: loggingAdvice

import org.aspectj.lang.JoinPoint; //導入方法依賴的package包/類
@After("allAppMethodswithin()")
// Try allAppMethodswithin
public void loggingAdvice(JoinPoint jp) {
	
	System.out.println("JoinPoint  -> " + jp.toString());
	
	System.out.println("Target  -> " + jp.getTarget());
	
	if (jp.getTarget() instanceof StatementService) {
		System.out
				.println("logging code inserted after StatementService method execution");
	} else if (jp.getTarget() instanceof PaymentService) {
		System.out
				.println("logging code inserted after PaymentService method execution");
	}

}
 
開發者ID:Illusionist80,項目名稱:SpringTutorial,代碼行數:18,代碼來源:LoggingAdvice.java

示例2: onWebViewLoadUrl

import org.aspectj.lang.JoinPoint; //導入方法依賴的package包/類
@Before("call(* android.webkit.WebView+.loadUrl(..))")
public void onWebViewLoadUrl(JoinPoint joinPoint) {
    if (!Configuration.httpMonitorEnable || !Configuration.webviewEnable) {
        return;
    }
    try {
        if (joinPoint.getTarget() instanceof WebView) {
            WebView web = (WebView) joinPoint.getTarget();
            synchronized (webviews) {
                for (int i = webviews.size() - 1; i >= 0; i--) {
                    WebView item = webviews.get(i).get();
                    if (item == null) {
                        webviews.remove(i);
                    } else if (item.equals(web)) {
                        return;
                    }
                }
                webviews.add(new WeakReference<>(web));
            }

            web.setWebViewClient(ProbeWebClient.instance);
        }
    } catch (Throwable e) {
        e.printStackTrace();
    }
}
 
開發者ID:pre-dem,項目名稱:pre-dem-android,代碼行數:27,代碼來源:WebViewProbe.java

示例3: updateTestCase

import org.aspectj.lang.JoinPoint; //導入方法依賴的package包/類
private void updateTestCase(final JoinPoint joinPoint) {
    final MethodSignature signature = (MethodSignature) joinPoint.getSignature();
    final Object[] args = joinPoint.getArgs();
    final Object target = joinPoint.getTarget();
    final Allure1Annotations annotations = new Allure1Annotations(target, signature, args);
    getLifecycle().getCurrentTestCase().ifPresent(uuid -> {
        getLifecycle().updateTestCase(uuid, annotations::updateTitle);
        getLifecycle().updateTestCase(uuid, annotations::updateDescription);
        getLifecycle().updateTestCase(uuid, annotations::updateParameters);
        getLifecycle().updateTestCase(uuid, annotations::updateLabels);
        getLifecycle().updateTestCase(uuid, annotations::updateLinks);
    });
}
 
開發者ID:allure-framework,項目名稱:allure-java,代碼行數:14,代碼來源:Allure1TestCaseAspects.java

示例4: getLog

import org.aspectj.lang.JoinPoint; //導入方法依賴的package包/類
protected Logger getLog(final JoinPoint joinPoint) {
    final Object target = joinPoint.getTarget();

    if (target != null) {
        return LoggerFactory.getLogger(target.getClass());
    }

    return LoggerFactory.getLogger(getClass());
}
 
開發者ID:luotuo,項目名稱:cas4.0.x-server-wechat,代碼行數:10,代碼來源:LogAspect.java

示例5: checkStart

import org.aspectj.lang.JoinPoint; //導入方法依賴的package包/類
/**
 * 判斷玩家準備是否要開始遊戲
 *
 * @param point 切點
 */
@After(value = "execution(* telemarketer.skittlealley.model.game.drawguess.DrawGuessContext.addPlayer(..))",
        argNames = "point")
public void checkStart(JoinPoint point) {
    DrawGuessContext ctx = (DrawGuessContext) point.getTarget();
    service.checkStart(ctx);
}
 
開發者ID:csdbianhua,項目名稱:telemarket-skittle-alley,代碼行數:12,代碼來源:DrawGuessAspect.java

示例6: checkStop

import org.aspectj.lang.JoinPoint; //導入方法依賴的package包/類
/**
 * 判斷玩家退出是否終止遊戲
 *
 * @param point 切點
 * @param info  退出玩家信息
 */
@AfterReturning(value = "execution(* telemarketer.skittlealley.model.game.drawguess.DrawGuessContext.removePlayer(..)) ",
        returning = "info", argNames = "point,info")
public void checkStop(JoinPoint point, DrawPlayerInfo info) {
    DrawGuessContext ctx = (DrawGuessContext) point.getTarget();
    if (info == null) { // 並不在準備玩家中
        // 如果需要所有未準備玩家退出時開始遊戲 可進行checkStart
        return;
    }
    service.checkStop(ctx);
}
 
開發者ID:csdbianhua,項目名稱:telemarket-skittle-alley,代碼行數:17,代碼來源:DrawGuessAspect.java

示例7: checkPause

import org.aspectj.lang.JoinPoint; //導入方法依賴的package包/類
/**
 * 判斷玩家答對是否要停止這輪遊戲
 *
 * @param point  切點
 * @param number 答對人數
 */
@AfterReturning(value = "execution(* telemarketer.skittlealley.model.game.drawguess.DrawGuessContext.incrRightNumber(..)) ",
        returning = "number", argNames = "point,number")
public void checkPause(JoinPoint point, Integer number) {
    DrawGuessContext ctx = (DrawGuessContext) point.getTarget();
    service.checkPause(ctx, number);
}
 
開發者ID:csdbianhua,項目名稱:telemarket-skittle-alley,代碼行數:13,代碼來源:DrawGuessAspect.java

示例8: onViewCreatedProcess

import org.aspectj.lang.JoinPoint; //導入方法依賴的package包/類
@After("onViewCreated()")
public void onViewCreatedProcess(JoinPoint joinPoint) throws Throwable {
  Object puppet = joinPoint.getTarget();
  //Only inject the class that marked by Puppet annotation.
  Object[] args = joinPoint.getArgs();

  Method onCreate = getRiggerMethod("onViewCreated", Object.class, View.class, Bundle.class);
  onCreate.invoke(getRiggerInstance(), puppet, args[0], args[1]);
}
 
開發者ID:JustKiddingBaby,項目名稱:FragmentRigger,代碼行數:10,代碼來源:FragmentInjection.java

示例9: lkConstructor

import org.aspectj.lang.JoinPoint; //導入方法依賴的package包/類
@After("execution(net.lemonsoft.lemonkit.ui.view.LK*.new(..))")
public void lkConstructor(JoinPoint joinPoint) throws Throwable {
    if (!(joinPoint.getTarget() instanceof LKUIView))
        return;
    Object[] args = joinPoint.getArgs();
    LKUIExtensionModel model = new LKUIExtensionModel();
    if (args.length >= 2)
        model = LKUIAttrsParser.parse((View) joinPoint.getTarget(), (AttributeSet) args[1]);
    lkPool.put(getLKKey(joinPoint), model);
    applyLKComplete(model, (LKUIView) joinPoint.getTarget());
}
 
開發者ID:LemonAppCN,項目名稱:LemonKit4Android,代碼行數:12,代碼來源:LKUIViewAspect.java


注:本文中的org.aspectj.lang.JoinPoint.getTarget方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。