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


Java UClass类代码示例

本文整理汇总了Java中org.jetbrains.uast.UClass的典型用法代码示例。如果您正苦于以下问题:Java UClass类的具体用法?Java UClass怎么用?Java UClass使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


UClass类属于org.jetbrains.uast包,在下文中一共展示了UClass类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: visitClass

import org.jetbrains.uast.UClass; //导入依赖的package包/类
@Override
public void visitClass(UClass uClass) {
    //only check interface
    if(!uClass.isInterface()){
        return;
    }
    Set<PropInfo> infos = getPropInfoWithSupers(uClass);
    if(infos.isEmpty()){
        return;
    }
   //check method is relative of any field
    for(UMethod method: uClass.getMethods()){
        PsiModifierList list = method.getModifierList();
        PsiAnnotation pa_keep = list.findAnnotation(NAME_KEEP);
        PsiAnnotation pa_impl = list.findAnnotation(NAME_IMPL_METHOD);
        if (pa_keep == null && pa_impl == null) {
            if(!hasPropInfo(infos, method.getName())){
                report(method);
            }
        }
    }
}
 
开发者ID:LightSun,项目名称:data-mediator,代码行数:23,代码来源:PropertyDetector.java

示例2: detectR2

import org.jetbrains.uast.UClass; //导入依赖的package包/类
private static void detectR2(JavaContext context, UElement node) {
  UFile sourceFile = context.getUastFile();
  List<UClass> classes = sourceFile.getClasses();
  if (!classes.isEmpty() && classes.get(0).getName() != null) {
    String qualifiedName = classes.get(0).getName();
    if (qualifiedName.contains("_ViewBinder")
        || qualifiedName.contains("_ViewBinding")
        || qualifiedName.equals(R2)) {
      // skip generated files and R2
      return;
    }
  }
  boolean isR2 = isR2Expression(node);
  if (isR2 && !context.isSuppressedWithComment(node, ISSUE)) {
    context.report(ISSUE, node, context.getLocation(node), LINT_ERROR_BODY);
  }
}
 
开发者ID:JakeWharton,项目名称:butterknife,代码行数:18,代码来源:InvalidR2UsageDetector.java

示例3: createUastHandler

import org.jetbrains.uast.UClass; //导入依赖的package包/类
@Override
public UElementHandler createUastHandler(final JavaContext context) {
    return new UElementHandler() {
        @Override
        public void visitClass(UClass uClass) {
            uClass.accept(new FromMethodVisitor(context));
        }
    };
}
 
开发者ID:jeppeman,项目名称:HighLite,代码行数:10,代码来源:InvalidSQLiteOperatorUsageDetector.java

示例4: createUastHandler

import org.jetbrains.uast.UClass; //导入依赖的package包/类
@Override
public UElementHandler createUastHandler(final JavaContext context) {
    return new UElementHandler() {
        @Override public void visitClass(UClass node) {
            node.accept(new AnnotationChecker(context));
        }
    };
}
 
开发者ID:permissions-dispatcher,项目名称:PermissionsDispatcher,代码行数:9,代码来源:NoCorrespondingNeedsPermissionDetector.java

示例5: isGeneratedFiles

import org.jetbrains.uast.UClass; //导入依赖的package包/类
private static boolean isGeneratedFiles(JavaContext context) {
    UFile sourceFile = context.getUastFile();
    if (sourceFile == null) {
        return false;
    }
    List<UClass> classes = sourceFile.getClasses();
    if (!classes.isEmpty()) {
        String qualifiedName = classes.get(0).getName();
        if (qualifiedName != null && qualifiedName.contains("PermissionsDispatcher")) {
            return true;
        }
    }
    return false;
}
 
开发者ID:permissions-dispatcher,项目名称:PermissionsDispatcher,代码行数:15,代码来源:CallNeedsPermissionDetector.java

示例6: createUastHandler

import org.jetbrains.uast.UClass; //导入依赖的package包/类
@Override
public UElementHandler createUastHandler(final JavaContext context) {
    return new UElementHandler() {
        @Override
        public void visitClass(UClass node) {
            node.accept(new OnRequestPermissionsResultChecker(context, node));
        }
    };
}
 
开发者ID:permissions-dispatcher,项目名称:PermissionsDispatcher,代码行数:10,代码来源:CallOnRequestPermissionsResultDetector.java

示例7: createUastHandler

import org.jetbrains.uast.UClass; //导入依赖的package包/类
@Override public UElementHandler createUastHandler(final JavaContext context) {
  return new UElementHandler() {
    @Override public void visitClass(UClass node) {
      node.accept(new R2UsageVisitor(context));
    }
  };
}
 
开发者ID:JakeWharton,项目名称:butterknife,代码行数:8,代码来源:InvalidR2UsageDetector.java

示例8: getApplicableUastTypes

import org.jetbrains.uast.UClass; //导入依赖的package包/类
@Override
public List<Class<? extends UElement>> getApplicableUastTypes() {
    return Collections.<Class<? extends UElement>>singletonList(UClass.class);
}
 
开发者ID:LightSun,项目名称:data-mediator,代码行数:5,代码来源:PropertyDetector.java

示例9: getPropInfoWithSupers

import org.jetbrains.uast.UClass; //导入依赖的package包/类
static Set<PropertyDetector.PropInfo> getPropInfoWithSupers(UClass uClass){
    Set<PropertyDetector.PropInfo> mSet = new ArrayListSet<>();
    getPropInfoWithSupers(uClass.getPsi(), mSet);
    return mSet;
}
 
开发者ID:LightSun,项目名称:data-mediator,代码行数:6,代码来源:PropertyUtils.java

示例10: getApplicableUastTypes

import org.jetbrains.uast.UClass; //导入依赖的package包/类
@Override
public List<Class<? extends UElement>> getApplicableUastTypes() {
    return Collections.singletonList(UClass.class);
}
 
开发者ID:siruozhao,项目名称:android-custom-lint,代码行数:5,代码来源:JavaConstructorDetector.java

示例11: getApplicableUastTypes

import org.jetbrains.uast.UClass; //导入依赖的package包/类
@Override
public List<Class<? extends UElement>> getApplicableUastTypes() {
    final List<Class<? extends UElement>> ret = new ArrayList<>();
    ret.add(UClass.class);
    return ret;
}
 
开发者ID:jeppeman,项目名称:HighLite,代码行数:7,代码来源:InvalidSQLiteOperatorUsageDetector.java

示例12: OnRequestPermissionsResultChecker

import org.jetbrains.uast.UClass; //导入依赖的package包/类
private OnRequestPermissionsResultChecker(JavaContext context, UClass klass) {
    this.context = context;
    this.className = klass.getName();
}
 
开发者ID:permissions-dispatcher,项目名称:PermissionsDispatcher,代码行数:5,代码来源:CallOnRequestPermissionsResultDetector.java

示例13: getApplicableUastTypes

import org.jetbrains.uast.UClass; //导入依赖的package包/类
@Override public List<Class<? extends UElement>> getApplicableUastTypes() {
  return Collections.singletonList(UClass.class);
}
 
开发者ID:JakeWharton,项目名称:butterknife,代码行数:4,代码来源:InvalidR2UsageDetector.java


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