本文整理匯總了Java中org.aspectj.lang.ProceedingJoinPoint.getTarget方法的典型用法代碼示例。如果您正苦於以下問題:Java ProceedingJoinPoint.getTarget方法的具體用法?Java ProceedingJoinPoint.getTarget怎麽用?Java ProceedingJoinPoint.getTarget使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.aspectj.lang.ProceedingJoinPoint
的用法示例。
在下文中一共展示了ProceedingJoinPoint.getTarget方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: toStatementStringAround
import org.aspectj.lang.ProceedingJoinPoint; //導入方法依賴的package包/類
@Around("execution(java.lang.String org.hibernate.sql.*.toStatementString(..))")
public String toStatementStringAround(ProceedingJoinPoint joinPoint) throws Throwable {
Dialect dialect = getDialect(joinPoint.getTarget());
if (!(dialect instanceof PhoenixDialect)) {
// Nothing to deal with
return (String) joinPoint.proceed();
}
String statement = (String) joinPoint.proceed();
if (joinPoint.getTarget() instanceof Insert || joinPoint.getTarget() instanceof InsertSelect) {
return statement.replaceFirst("insert into", "upsert into");
} else if (joinPoint.getTarget() instanceof Update) {
return createUpsertValues((Update) joinPoint.getTarget());
}
return statement;
}
示例2: getSpecificmethod
import org.aspectj.lang.ProceedingJoinPoint; //導入方法依賴的package包/類
private Method getSpecificmethod(ProceedingJoinPoint pjp) {
MethodSignature methodSignature = (MethodSignature) pjp.getSignature();
Method method = methodSignature.getMethod();
// The method may be on an interface, but we need attributes from the
// target class. If the target class is null, the method will be
// unchanged.
Class<?> targetClass = AopProxyUtils.ultimateTargetClass(pjp.getTarget());
if (targetClass == null && pjp.getTarget() != null) {
targetClass = pjp.getTarget().getClass();
}
Method specificMethod = ClassUtils.getMostSpecificMethod(method, targetClass);
// If we are dealing with method with generic parameters, find the
// original method.
specificMethod = BridgeMethodResolver.findBridgedMethod(specificMethod);
return specificMethod;
}
示例3: constructProcess
import org.aspectj.lang.ProceedingJoinPoint; //導入方法依賴的package包/類
@Around("constructor()")
public Object constructProcess(ProceedingJoinPoint joinPoint) throws Throwable {
Object result = joinPoint.proceed();
Object puppet = joinPoint.getTarget();
//Only inject the class that marked by Puppet annotation.
Method onAttach = getRiggerMethod("onPuppetConstructor", Object.class);
onAttach.invoke(getRiggerInstance(), puppet);
return result;
}
示例4: generateKey
import org.aspectj.lang.ProceedingJoinPoint; //導入方法依賴的package包/類
/**
* generate the key based on SPel expression.
*/
protected Object generateKey(String key, ProceedingJoinPoint pjp) throws ExpirableCacheException {
try {
Object target = pjp.getTarget();
Method method = ((MethodSignature) pjp.getSignature()).getMethod();
Object[] allArgs = pjp.getArgs();
if (StringUtils.hasText(key)) {
CacheExpressionDataObject cacheExpressionDataObject = new CacheExpressionDataObject(method, allArgs, target, target.getClass());
EvaluationContext evaluationContext = new StandardEvaluationContext(cacheExpressionDataObject);
SpelExpression spelExpression = getExpression(key, method);
spelExpression.setEvaluationContext(evaluationContext);
return spelExpression.getValue();
}
return keyGenerator.generate(target, method, allArgs);
} catch (Throwable t) {
throw new ExpirableCacheException("### generate key failed");
}
}
示例5: DefaultRequestCacheKey
import org.aspectj.lang.ProceedingJoinPoint; //導入方法依賴的package包/類
public DefaultRequestCacheKey(ProceedingJoinPoint point) throws NoSuchMethodException {
Object[] args = point.getArgs();
Signature signature = point.getSignature();
if (!(signature instanceof MethodSignature)) {
throw new IllegalArgumentException("該注解隻能用於方法");
}
MethodSignature methodSignature = (MethodSignature) signature;
Object target = point.getTarget();
Method currentMethod = target.getClass().getMethod(methodSignature.getName(), methodSignature.getParameterTypes());
clazzKey = currentMethod.getDeclaringClass().getName();
methodKey = currentMethod.getName();
Class[] parameterTypes = methodSignature.getParameterTypes();
StringBuilder builderParamKey = new StringBuilder();
StringBuilder builderValueKey = new StringBuilder();
if (parameterTypes != null) {
for (int i = 0; i < parameterTypes.length; i++) {
if (i != 0) {
builderParamKey.append("#");
builderValueKey.append("#");
}
builderParamKey.append(parameterTypes[i].getName());
builderValueKey.append(args[i]);
}
}
paramKey = builderParamKey.toString();
valueKey = builderValueKey.toString();
}
示例6: onAttachProcess
import org.aspectj.lang.ProceedingJoinPoint; //導入方法依賴的package包/類
@Around("onAttach()")
public Object onAttachProcess(ProceedingJoinPoint joinPoint) throws Throwable {
Object result = joinPoint.proceed();
Object puppet = joinPoint.getTarget();
//Only inject the class that marked by Puppet annotation.
Object[] args = joinPoint.getArgs();
Method onAttach = getRiggerMethod("onAttach", Object.class, Context.class);
onAttach.invoke(getRiggerInstance(), puppet, args[0]);
return result;
}
示例7: onCreateProcess
import org.aspectj.lang.ProceedingJoinPoint; //導入方法依賴的package包/類
@Around("onCreate()")
public Object onCreateProcess(ProceedingJoinPoint joinPoint) throws Throwable {
Object result = joinPoint.proceed();
Object puppet = joinPoint.getTarget();
//Only inject the class that marked by Puppet annotation.
Object[] args = joinPoint.getArgs();
Method onCreate = getRiggerMethod("onCreate", Object.class, Bundle.class);
onCreate.invoke(getRiggerInstance(), puppet, args[0]);
return result;
}
示例8: onCreateViewProcess
import org.aspectj.lang.ProceedingJoinPoint; //導入方法依賴的package包/類
@Around("onCreateView()")
public Object onCreateViewProcess(ProceedingJoinPoint joinPoint) throws Throwable {
Object result = joinPoint.proceed();
Object puppet = joinPoint.getTarget();
Object[] args = joinPoint.getArgs();
Method onCreate = getRiggerMethod("onCreateView", Object.class, LayoutInflater.class, ViewGroup.class,
Bundle.class);
Object riggerResult = onCreate.invoke(getRiggerInstance(), puppet, args[0], args[1], args[2]);
return riggerResult == null ? result : riggerResult;
}
示例9: onResumeProcess
import org.aspectj.lang.ProceedingJoinPoint; //導入方法依賴的package包/類
@Around("onResume()")
public Object onResumeProcess(ProceedingJoinPoint joinPoint) throws Throwable {
Object result = joinPoint.proceed();
Object puppet = joinPoint.getTarget();
//Only inject the class that marked by Puppet annotation.
Method onPause = getRiggerMethod("onResume", Object.class);
onPause.invoke(getRiggerInstance(), puppet);
return result;
}
示例10: onSaveInstanceStateProcess
import org.aspectj.lang.ProceedingJoinPoint; //導入方法依賴的package包/類
@Around("onSaveInstanceState()")
public Object onSaveInstanceStateProcess(ProceedingJoinPoint joinPoint) throws Throwable {
Object result = joinPoint.proceed();
Object puppet = joinPoint.getTarget();
//Only inject the class that marked by Puppet annotation.
Object[] args = joinPoint.getArgs();
Method onSaveInstanceState = getRiggerMethod("onSaveInstanceState", Object.class, Bundle.class);
onSaveInstanceState.invoke(getRiggerInstance(), puppet, args[0]);
return result;
}
示例11: onDestroyProcess
import org.aspectj.lang.ProceedingJoinPoint; //導入方法依賴的package包/類
@Around("onDestroy()")
public Object onDestroyProcess(ProceedingJoinPoint joinPoint) throws Throwable {
Object result = joinPoint.proceed();
Object puppet = joinPoint.getTarget();
//Only inject the class that marked by Puppet annotation.
Method onDestroy = getRiggerMethod("onDestroy", Object.class);
onDestroy.invoke(getRiggerInstance(), puppet);
return result;
}
示例12: setUserVisibleHintProcess
import org.aspectj.lang.ProceedingJoinPoint; //導入方法依賴的package包/類
@Around("setUserVisibleHint()")
public Object setUserVisibleHintProcess(ProceedingJoinPoint joinPoint) throws Throwable {
Object result = joinPoint.proceed();
Object puppet = joinPoint.getTarget();
//Only inject the class that marked by Puppet annotation.
Object[] args = joinPoint.getArgs();
Method onDestroy = getRiggerMethod("setUserVisibleHint", Object.class, boolean.class);
onDestroy.invoke(getRiggerInstance(), puppet, args[0]);
return result;
}
示例13: constructProcess
import org.aspectj.lang.ProceedingJoinPoint; //導入方法依賴的package包/類
@Around("construct()")
public Object constructProcess(ProceedingJoinPoint joinPoint) throws Throwable {
Object result = joinPoint.proceed();
Object puppet = joinPoint.getTarget();
//Only inject the class that marked by Puppet annotation.
Method onAttach = getRiggerMethod("onPuppetConstructor", Object.class);
onAttach.invoke(getRiggerInstance(), puppet);
return result;
}
示例14: onResumeFragmentsProcess
import org.aspectj.lang.ProceedingJoinPoint; //導入方法依賴的package包/類
@Around("onResumeFragments()")
public Object onResumeFragmentsProcess(ProceedingJoinPoint joinPoint) throws Throwable {
Object result = joinPoint.proceed();
Object puppet = joinPoint.getTarget();
//Only inject the class that marked by Puppet annotation.
Method onResumeFragments = getRiggerMethod("onResumeFragments", Object.class);
onResumeFragments.invoke(getRiggerInstance(), puppet);
return result;
}
示例15: onPauseProcess
import org.aspectj.lang.ProceedingJoinPoint; //導入方法依賴的package包/類
@Around("onPause()")
public Object onPauseProcess(ProceedingJoinPoint joinPoint) throws Throwable {
Object result = joinPoint.proceed();
Object puppet = joinPoint.getTarget();
//Only inject the class that marked by Puppet annotation.
Method onPause = getRiggerMethod("onPause", Object.class);
onPause.invoke(getRiggerInstance(), puppet);
return result;
}