本文整理汇总了Java中org.aspectj.lang.Signature.getDeclaringType方法的典型用法代码示例。如果您正苦于以下问题:Java Signature.getDeclaringType方法的具体用法?Java Signature.getDeclaringType怎么用?Java Signature.getDeclaringType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.aspectj.lang.Signature
的用法示例。
在下文中一共展示了Signature.getDeclaringType方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: exitMethod
import org.aspectj.lang.Signature; //导入方法依赖的package包/类
private static void exitMethod(JoinPoint joinPoint, Object result, long lengthMillis) {
if (!enabled) return;
Signature signature = joinPoint.getSignature();
Class<?> cls = signature.getDeclaringType();
String methodName = signature.getName();
boolean hasReturnType = signature instanceof MethodSignature
&& ((MethodSignature) signature).getReturnType() != void.class;
StringBuilder builder = new StringBuilder("\u21E0 ")
.append(methodName)
.append(" [")
.append(lengthMillis)
.append("ms]");
if (hasReturnType) {
builder.append(" = ");
builder.append(Strings.toString(result));
}
// TODO : use a real Logger
System.out.println(asTag(cls) + " : " + builder.toString());
}
示例2: exit
import org.aspectj.lang.Signature; //导入方法依赖的package包/类
private void exit(JoinPoint joinPoint, Object result, StringBuilder builder) {
if (!enabled) return;
Signature signature = joinPoint.getSignature();
Class<?> cls = signature.getDeclaringType();
boolean hasReturnType = signature instanceof MethodSignature
&& ((MethodSignature) signature).getReturnType() != void.class;
if (hasReturnType) {
builder.append(" \u21a6 ");
builder.append(Strings.toString(result));
}
Log.v(asTag(cls), builder.toString());
}
示例3: aroundAction0Call
import org.aspectj.lang.Signature; //导入方法依赖的package包/类
@Around("action0Call()") public Object aroundAction0Call(ProceedingJoinPoint joinPoint)
throws Throwable {
Object result = joinPoint.proceed();
if (enabled) {
StringBuilder builder = new StringBuilder();
//addThread(joinPoint, builder);
Signature signature = joinPoint.getSignature();
Class<?> cls = signature.getDeclaringType();
Log.v(asTag(cls), builder.append(" \u2601 ").toString());
}
return result;
}
示例4: exitMethod
import org.aspectj.lang.Signature; //导入方法依赖的package包/类
private static void exitMethod(JoinPoint joinPoint, Object result, long lengthMillis) {
if (!enabled) return;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
Trace.endSection();
}
Signature signature = joinPoint.getSignature();
Class<?> cls = signature.getDeclaringType();
String methodName = signature.getName();
boolean hasReturnType = signature instanceof MethodSignature
&& ((MethodSignature) signature).getReturnType() != void.class;
StringBuilder builder = new StringBuilder("\u21E0 ")
.append(methodName)
.append(" [")
.append(lengthMillis)
.append("ms]");
if (hasReturnType) {
builder.append(" = ");
builder.append(Strings.toString(result));
}
Log.v(asTag(cls), builder.toString());
}
示例5: exitMethod
import org.aspectj.lang.Signature; //导入方法依赖的package包/类
private void exitMethod(ProceedingJoinPoint joinPoint, Object result, long exeTime) {
Signature signature = joinPoint.getSignature();
Class<?> clz = signature.getDeclaringType();
String methodName = signature.getName();
boolean hasReturnType = signature instanceof MethodSignature && ((MethodSignature)signature).getReturnType() != void.class;
StringBuilder builder = new StringBuilder("\[email protected] Exit---------------------------------\n");
if (hasReturnType){
builder.append("return = " + result + "\n");
}
builder.append(methodName).append("[execute time = " + exeTime + "ms]");
builder.append("\[email protected] Exit end---------------------------------\n");
Log.d(clz.getSimpleName(), builder.toString());
}
示例6: getFieldFromJoinPoint
import org.aspectj.lang.Signature; //导入方法依赖的package包/类
private Field getFieldFromJoinPoint(JoinPoint joinPoint) throws NoSuchFieldException {
Signature signature = joinPoint.getSignature();
Class<?> clazz = signature.getDeclaringType();
return clazz.getDeclaredField(signature.getName());
}