当前位置: 首页>>代码示例>>Java>>正文


Java Signature.getDeclaringType方法代码示例

本文整理汇总了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());
}
 
开发者ID:fpoyer,项目名称:Hugo-Spring,代码行数:25,代码来源:Hugo.java

示例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());
}
 
开发者ID:pt2121,项目名称:MarbledCat,代码行数:17,代码来源:MarbledCat.java

示例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;
}
 
开发者ID:pt2121,项目名称:MarbledCat,代码行数:13,代码来源:MarbledCat.java

示例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());
}
 
开发者ID:JakeWharton,项目名称:hugo,代码行数:28,代码来源:Hugo.java

示例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());

}
 
开发者ID:jiangkang,项目名称:KTools,代码行数:20,代码来源:L.java

示例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());
}
 
开发者ID:xLeitix,项目名称:jcloudscale,代码行数:6,代码来源:DatastoreLibAspect.java


注:本文中的org.aspectj.lang.Signature.getDeclaringType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。