List detectorNodeList = pluginDescriptor.selectNodes("/FindbugsPlugin/Detector"); for (Iterator i = detectorNodeList.iterator(); i.hasNext(); ) { Element detectorElement = (Element) i.next(); String className = detectorElement.valueOf("@class");  System.out.println("Found detector: class="+className);
try { detectorFactoryList = new ArrayList<DetectorFactory>(); List detectorNodeList = pluginDescriptor.selectNodes("/FindbugsPlugin/Detector"); for (Iterator i = detectorNodeList.iterator(); i.hasNext(); ) { Element detectorElement = (Element) i.next(); String className = detectorElement.valueOf("@class"); String disabled = detectorElement.valueOf("@disabled");  System.out.println("Found detector: class="+className+", disabled="+disabled);  if (!disabled.equals("true")) { Class detectorClass = loadClass(className); DetectorFactory factory = new DetectorFactory(detectorClass); detectorFactoryList.add(factory); } } } catch (ClassNotFoundException e) { throw new PluginException("Could not instantiate detector class", e);
	private void init() throws PluginException {		Document pluginDescriptor; // a.k.a, "findbugs.xml"		Document messageCollection; // a.k.a., "messages.xml"		try {			URL descriptorURL = findResource("findbugs.xml");			if (descriptorURL == null)				throw new PluginException("Couldn't find \"findbugs.xml\" in plugin");			SAXReader reader = new SAXReader();			pluginDescriptor = reader.read(descriptorURL);		} catch (DocumentException e) {			throw new PluginException("Couldn't parse \"findbugs.xml\"", e);		}		try {			URL messageURL = null;			Locale locale = Locale.getDefault();			String language = locale.getLanguage();			String country = locale.getCountry();			if (!country.equals(""))				messageURL = findResource("messages_" + language + "_" + country + ".xml");			if (messageURL == null)				messageURL = findResource("messages_" + language + ".xml");			if (messageURL == null)				messageURL = findResource("messages.xml");			if (messageURL == null)				throw new PluginException("Couldn't find messages.xml");			SAXReader reader = new SAXReader();			messageCollection = reader.read(messageURL);		} catch (DocumentException e) {			throw new PluginException("Couldn't parse \"messages.xml\"", e);		}		// Create a DetectorFactory for all Detector nodes		List detectorNodeList = pluginDescriptor.selectNodes("/FindbugsPlugin/Detector");		for (Iterator i = detectorNodeList.iterator(); i.hasNext(); ) {			Element detectorElement = (Element) i.next();			String className = detectorElement.valueOf("@class");			System.out.println("Found detector: class="+className);		}	}