@Test void emptyConfig() throws Exception { Configuration config = Configuration.builder().build(); exporter.export(config, out); assertEquals("<redpen-conf lang=\"en\">\n</redpen-conf>", out.toString()); }
public void export(Configuration config, OutputStream out) { try { XMLOutputFactory sf = XMLOutputFactory.newInstance(); XMLStreamWriter sax = new IndentingXMLStreamWriter(sf.createXMLStreamWriter(new OutputStreamWriter(out, UTF_8))); addRoot(config, sax); addValidators(config.getValidatorConfigs(), sax); addNonDefaultSymbols(config.getSymbolTable(), sax); sax.writeEndElement(); sax.flush(); } catch (XMLStreamException e) { throw new RuntimeException(e); } }
ConfigurationExporter { public void export(Configuration config, OutputStream out) { try { XMLOutputFactory sf = XMLOutputFactory.newInstance(); XMLStreamWriter sax = new IndentingXMLStreamWriter(sf.createXMLStreamWriter(new OutputStreamWriter(out, UTF_8))); addRoot(config, sax); addValidators(config.getValidatorConfigs(), sax); addNonDefaultSymbols(config.getSymbolTable(), sax); sax.writeEndElement(); sax.flush(); } catch (XMLStreamException e) { throw new RuntimeException(e); } } }
ConfigurationExporter { public void export(Configuration config, OutputStream out) { try { XMLOutputFactory sf = XMLOutputFactory.newInstance(); XMLStreamWriter sax = new IndentingXMLStreamWriter(sf.createXMLStreamWriter(new OutputStreamWriter(out, UTF_8))); addRoot(config, sax); addValidators(config.getValidatorConfigs(), sax); addNonDefaultSymbols(config.getSymbolTable(), sax); sax.writeEndElement(); sax.flush(); } catch (XMLStreamException e) { throw new RuntimeException(e); } }  }
ConfigurationExporter { public void export(Configuration config, OutputStream out) { try { XMLOutputFactory sf = XMLOutputFactory.newInstance(); XMLStreamWriter sax = new IndentingXMLStreamWriter(sf.createXMLStreamWriter(new OutputStreamWriter(out, UTF_8))); addRoot(config, sax); addValidators(config.getValidatorConfigs(), sax); addNonDefaultSymbols(config.getSymbolTable(), sax); sax.writeEndElement(); sax.flush(); } catch (XMLStreamException e) { throw new RuntimeException(e); } }  void export(Configuration config, OutputStream out); }
ConfigurationExporter { public void export(Configuration config, OutputStream out) { try { XMLOutputFactory sf = XMLOutputFactory.newInstance(); XMLStreamWriter sax = new IndentingXMLStreamWriter(sf.createXMLStreamWriter(new OutputStreamWriter(out, UTF_8))); addRoot(config, sax); addValidators(config.getValidatorConfigs(), sax); addNonDefaultSymbols(config.getSymbolTable(), sax); sax.writeEndElement(); sax.flush(); } catch (XMLStreamException e) { throw new RuntimeException(e); } }  void export(Configuration config, OutputStream out);  }