本文整理汇总了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);
}
}
}
}
示例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);
}
}
示例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));
}
};
}
示例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));
}
};
}
示例8: getApplicableUastTypes
import org.jetbrains.uast.UClass; //导入依赖的package包/类
@Override
public List<Class<? extends UElement>> getApplicableUastTypes() {
return Collections.<Class<? extends UElement>>singletonList(UClass.class);
}
示例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;
}
示例10: getApplicableUastTypes
import org.jetbrains.uast.UClass; //导入依赖的package包/类
@Override
public List<Class<? extends UElement>> getApplicableUastTypes() {
return Collections.singletonList(UClass.class);
}
示例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;
}
示例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);
}