public static PluginDefinition parseXmlPluginDefinition ( final ClassLoader cl , final InputStream in ) throws PluginConfigurationException { DocumentBuilderFactory factory = DocumentBuilderFactory . newInstance ( ) ; Document document ; try { DocumentBuilder loader = factory . newDocumentBuilder ( ) ; DOMReader reader = new DOMReader ( ) ; document = reader . read ( loader . parse ( in ) ) ; } catch ( Exception e ) { throw new PluginConfigurationException ( e . getMessage ( ) , e ) ; } Element plugin = document . getRootElement ( ) ; // TODO : validate against schema return parsePluginDefinition ( cl , plugin ) ; }
Loads the definition of a single plugin from an XML file .