1 19 20 package edu.umd.cs.findbugs.plan; 21 22 import edu.umd.cs.findbugs.DetectorFactory; 23 import edu.umd.cs.findbugs.Plugin; 24 25 28 public class ByInterfaceDetectorFactorySelector implements DetectorFactorySelector { 29 private Plugin plugin; 30 private Class detectorInterface; 31 32 public ByInterfaceDetectorFactorySelector(Plugin plugin, Class detectorInterface) { 33 this.plugin = plugin; 34 this.detectorInterface = detectorInterface; 35 } 36 37 public boolean selectFactory(DetectorFactory factory) { 38 if (plugin != null && factory.getPlugin() != plugin) 39 return false; 40 return factory.isDetectorClassSubtypeOf(detectorInterface); 41 } 42 } 43 | Popular Tags |