/** * Reads the content of <code>in</code> an passes build messages to <code>builder</code>. * @param in input stream from which to read the configuration data. * @param builder object to notify of build events. * @throws IOException if an I/O error occurs. * @throws ConfigurationFormatException if a configuration file format occurs. * @throws ConfigurationException if a non-specific error occurs. */ public void read(Reader in, ConfigurationBuilder builder) throws IOException, ConfigurationException, ConfigurationFormatException { this.builder = builder; locator = null; try {SAXParserFactory.newInstance().newSAXParser().parse(new InputSource(in), this);} catch(ParserConfigurationException e) {throw new ConfigurationException("Failed to create a SAX parser", e);} catch(SAXParseException e) {throw new ConfigurationFormatException(e.getMessage(), e.getLineNumber(), e.getColumnNumber());} catch(SAXException e) {throw new ConfigurationFormatException(e.getException() == null ? e : e.getException());} }