本文整理汇总了Java中edu.umd.cs.findbugs.ba.ClassMember类的典型用法代码示例。如果您正苦于以下问题:Java ClassMember类的具体用法?Java ClassMember怎么用?Java ClassMember使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ClassMember类属于edu.umd.cs.findbugs.ba包,在下文中一共展示了ClassMember类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visitAnnotation
import edu.umd.cs.findbugs.ba.ClassMember; //导入依赖的package包/类
@Override
public void visitAnnotation(String annotationClass, Map<String, ElementValue> map, boolean runtimeVisible) {
if (!annotationClass.startsWith(NET_JCIP_ANNOTATIONS))
return;
annotationClass = annotationClass.substring(NET_JCIP_ANNOTATIONS.length());
ElementValue value = map.get("value");
ClassMember member;
if (visitingField())
member = XFactory.createXField(this);
else if (visitingMethod())
member = XFactory.createXMethod(this);
else {
Map<String, ElementValue> annotationsOfThisClass = AnalysisContext.currentAnalysisContext()
.getJCIPAnnotationDatabase().getEntryForClass(getDottedClassName());
annotationsOfThisClass.put(annotationClass, value);
return;
}
Map<String, ElementValue> annotationsOfThisMember = AnalysisContext.currentAnalysisContext().getJCIPAnnotationDatabase()
.getEntryForClassMember(member);
annotationsOfThisMember.put(annotationClass, value);
}
示例2: visitAnnotation
import edu.umd.cs.findbugs.ba.ClassMember; //导入依赖的package包/类
@Override
public void visitAnnotation(String annotationClass, Map<String, ElementValue> map, boolean runtimeVisible) {
if (annotationClass.startsWith(NET_JCIP_ANNOTATIONS)) {
annotationClass = annotationClass.substring(NET_JCIP_ANNOTATIONS.length());
} else if (annotationClass.startsWith(JSR305_CONCURRENT_ANNOTATIONS)) {
annotationClass = annotationClass.substring(JSR305_CONCURRENT_ANNOTATIONS.length());
} else {
return;
}
JCIPAnnotationDatabase annotationDatabase = AnalysisContext.currentAnalysisContext()
.getJCIPAnnotationDatabase();
ElementValue value = map.get("value");
ClassMember member;
if (visitingField()) {
member = XFactory.createXField(this);
} else if (visitingMethod()) {
member = XFactory.createXMethod(this);
} else {
annotationDatabase.addEntryForClass(getDottedClassName(), annotationClass, value);
return;
}
annotationDatabase.addEntryForClassMember(member, annotationClass, value);
}