本文整理汇总了Java中edu.umd.cs.findbugs.classfile.IAnalysisEngine类的典型用法代码示例。如果您正苦于以下问题:Java IAnalysisEngine类的具体用法?Java IAnalysisEngine怎么用?Java IAnalysisEngine使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IAnalysisEngine类属于edu.umd.cs.findbugs.classfile包,在下文中一共展示了IAnalysisEngine类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createMap
import edu.umd.cs.findbugs.classfile.IAnalysisEngine; //导入依赖的package包/类
private static <DescriptorType> Map<DescriptorType, Object> createMap(
final Map<Class<?>, ? extends IAnalysisEngine<DescriptorType, ?>> engineMap,
final Class<?> analysisClass) {
Map<DescriptorType, Object> descriptorMap;
// Create a MapCache that allows the analysis engine to
// decide that analysis results should be retained indefinitely.
IAnalysisEngine<DescriptorType, ?> engine = engineMap.get(analysisClass);
if (analysisClass.equals(JavaClass.class)) {
descriptorMap = new MapCache<DescriptorType, Object>(MAX_JAVACLASS_RESULTS_TO_CACHE);
} else if (analysisClass.equals(ConstantPoolGen.class)) {
descriptorMap = new MapCache<DescriptorType, Object>(MAX_CONSTANT_POOL_GEN_RESULTS_TO_CACHE);
} else if (analysisClass.equals(ClassContext.class)) {
descriptorMap = new MapCache<DescriptorType, Object>(10);
} else if (engine instanceof IClassAnalysisEngine && ((IClassAnalysisEngine<?>) engine).canRecompute()) {
descriptorMap = new MapCache<DescriptorType, Object>(MAX_CLASS_RESULTS_TO_CACHE);
} else {
descriptorMap = new HashMap<DescriptorType, Object>();
}
return descriptorMap;
}
示例2: createMap
import edu.umd.cs.findbugs.classfile.IAnalysisEngine; //导入依赖的package包/类
private static <DescriptorType> Map<DescriptorType, Object> createMap(
final Map<Class<?>, ? extends IAnalysisEngine<DescriptorType, ?>> engineMap,
final Class<?> analysisClass) {
Map<DescriptorType, Object> descriptorMap;
// Create a MapCache that allows the analysis engine to
// decide that analysis results should be retained indefinitely.
IAnalysisEngine<DescriptorType, ?> engine = engineMap.get(analysisClass);
if (analysisClass.equals(JavaClass.class)) {
descriptorMap = new MapCache<DescriptorType, Object>(MAX_JAVACLASS_RESULTS_TO_CACHE);
} else if (analysisClass.equals(FBClassReader.class)) {
descriptorMap = new MapCache<DescriptorType, Object>(MAX_FBCLASSREADER_RESULTS_TO_CACHE);
} else if (analysisClass.equals(ConstantPoolGen.class)) {
descriptorMap = new MapCache<DescriptorType, Object>(MAX_CONSTANT_POOL_GEN_RESULTS_TO_CACHE);
} else if (analysisClass.equals(ClassContext.class)) {
descriptorMap = new MapCache<DescriptorType, Object>(10);
} else if (engine instanceof IClassAnalysisEngine && ((IClassAnalysisEngine<?>) engine).canRecompute()) {
descriptorMap = new MapCache<DescriptorType, Object>(MAX_CLASS_RESULTS_TO_CACHE);
} else {
descriptorMap = new HashMap<DescriptorType, Object>();
}
return descriptorMap;
}
示例3: findOrCreateDescriptorMap
import edu.umd.cs.findbugs.classfile.IAnalysisEngine; //导入依赖的package包/类
/**
* Find or create a descriptor to analysis object map.
*
* @param <DescriptorType>
* type of descriptor used as the map's key type (ClassDescriptor
* or MethodDescriptor)
* @param <E>
* type of analysis class
* @param analysisClassToDescriptorMapMap
* analysis class to descriptor map map
* @param engineMap
* analysis class to analysis engine map
* @param analysisClass
* the analysis map
* @return the descriptor to analysis object map
*/
private static <DescriptorType> Map<DescriptorType, Object> findOrCreateDescriptorMap(
final Map<Class<?>, Map<DescriptorType, Object>> analysisClassToDescriptorMapMap,
final Map<Class<?>, ? extends IAnalysisEngine<DescriptorType, ?>> engineMap,
final Class<?> analysisClass) {
Map<DescriptorType, Object> descriptorMap = analysisClassToDescriptorMapMap.get(analysisClass);
if (descriptorMap == null) {
descriptorMap = createMap(engineMap, analysisClass);
analysisClassToDescriptorMapMap.put(analysisClass, descriptorMap);
}
return descriptorMap;
}
示例4: findOrCreateDescriptorMap
import edu.umd.cs.findbugs.classfile.IAnalysisEngine; //导入依赖的package包/类
/**
* Find or create a descriptor to analysis object map.
*
* @param <DescriptorType>
* type of descriptor used as the map's key type (ClassDescriptor
* or MethodDescriptor)
* @param analysisClassToDescriptorMapMap
* analysis class to descriptor map map
* @param engineMap
* analysis class to analysis engine map
* @param analysisClass
* the analysis map
* @return the descriptor to analysis object map
*/
private static <DescriptorType> Map<DescriptorType, Object> findOrCreateDescriptorMap(
final Map<Class<?>, Map<DescriptorType, Object>> analysisClassToDescriptorMapMap,
final Map<Class<?>, ? extends IAnalysisEngine<DescriptorType, ?>> engineMap,
final Class<?> analysisClass) {
Map<DescriptorType, Object> descriptorMap = analysisClassToDescriptorMapMap.get(analysisClass);
if (descriptorMap == null) {
descriptorMap = createMap(engineMap, analysisClass);
analysisClassToDescriptorMapMap.put(analysisClass, descriptorMap);
}
return descriptorMap;
}