@Override protected Exporter createExporter(final Writer writer, final Stream<SpecificationItem> itemStream, final Newline newline) { final XMLStreamWriter xmlWriter = createXmlWriter(writer); return new SpecobjectExporter(itemStream, xmlWriter, writer, newline); }
public SpecobjectExporter(final Stream<SpecificationItem> itemStream, final XMLStreamWriter xmlWriter, final Writer originalWriter, final Newline newline) { this.newline = newline; this.items = groupByDoctype(itemStream); this.writer = xmlWriter; this.originalWriter = originalWriter; }
private String processMultilineText(final String text) { return unifyNewlines(text); }
private void writeElementIfPresent(final String elementName, final String content) throws XMLStreamException { if (content != null && !content.isEmpty()) { writeElement(elementName, content); } }
@Override // [impl->dsn~conversion.reqm2-export~1] public void runExport() { try { writeOutput(); } catch (final XMLStreamException e) { throw new ExporterException("Error exporting to specobject format", e); } finally { closeXmlWriter(); } }
private void writeItems(final String doctype, final List<SpecificationItem> specItems) throws XMLStreamException { LOG.finest(() -> "Writing " + specItems.size() + " items with doctype " + doctype); this.writer.writeStartElement("specobjects"); this.writer.writeAttribute("doctype", doctype); for (final SpecificationItem item : specItems) { writeItem(item); } this.writer.writeEndElement(); }
private void writeElementIfPresent(final String elementName, final String content) throws XMLStreamException { if (content != null && !content.isEmpty()) { writeElement(elementName, content); } }
@Override protected Exporter createExporter(final Writer writer, final Stream<SpecificationItem> itemStream, final Newline newline) { final XMLStreamWriter xmlWriter = createXmlWriter(writer); return new SpecobjectExporter(itemStream, xmlWriter, writer, newline); }
@Override // [impl->dsn~conversion.reqm2-export~1] public void runExport() { try { writeOutput(); } catch (final XMLStreamException e) { throw new ExporterException("Error exporting to specobject format", e); } finally { closeXmlWriter(); } }
public SpecobjectExporter(final Stream<SpecificationItem> itemStream, final XMLStreamWriter xmlWriter, final Writer originalWriter, final Newline newline) { this.newline = newline; this.items = groupByDoctype(itemStream); this.writer = xmlWriter; this.originalWriter = originalWriter; }
private String processMultilineText(final String text) { return unifyNewlines(text); }
private void writeItems(final String doctype, final List<SpecificationItem> specItems) throws XMLStreamException { LOG.finest(() -> "Writing " + specItems.size() + " items with doctype " + doctype); this.writer.writeStartElement("specobjects"); this.writer.writeAttribute("doctype", doctype); for (final SpecificationItem item : specItems) { writeItem(item); } this.writer.writeEndElement(); }
private void writeElement(final String elementName, final int content) throws XMLStreamException { writeElement(elementName, String.valueOf(content)); }
private void writeElement(final String elementName, final int content) throws XMLStreamException { writeElement(elementName, String.valueOf(content)); }
private void writeTags(final List<String> tags) throws XMLStreamException { if (tags.isEmpty()) { return; } this.writer.writeStartElement("tags"); for (final String tag : tags) { writeElement("tag", tag); } this.writer.writeEndElement(); }
private void writeTags(final List<String> tags) throws XMLStreamException { if (tags.isEmpty()) { return; } this.writer.writeStartElement("tags"); for (final String tag : tags) { writeElement("tag", tag); } this.writer.writeEndElement(); }
private void writeNeedsArtifactTypes(final List<String> needsArtifactTypes) throws XMLStreamException { if (needsArtifactTypes.isEmpty()) { return; } this.writer.writeStartElement("needscoverage"); for (final String neededArtifactType : needsArtifactTypes) { writeElement("needsobj", neededArtifactType); } this.writer.writeEndElement(); }
private void writeNeedsArtifactTypes(final List<String> needsArtifactTypes) throws XMLStreamException { if (needsArtifactTypes.isEmpty()) { return; } this.writer.writeStartElement("needscoverage"); for (final String neededArtifactType : needsArtifactTypes) { writeElement("needsobj", neededArtifactType); } this.writer.writeEndElement(); }
private void writeLocation(final Location location) throws XMLStreamException { if (location != null && location.getPath() != null && !location.getPath().isEmpty()) { writeElement("sourcefile", location.getPath()); writeElement("sourceline", location.getLine()); } } }
private void writeLocation(final Location location) throws XMLStreamException { if (location != null && location.getPath() != null && !location.getPath().isEmpty()) { writeElement("sourcefile", location.getPath()); writeElement("sourceline", location.getLine()); } } }