Document document = new Document(); name.setWords(words); if (Character.isAlphabetic(prefix.charAt(0))) { document.setAppendix(true); document.setName(name); document.setSource(source);
private void addDocument(Document document) { docBuffer.addId(getId(document)); // Apply document fixes, like replacing the forward slash with the id separator: String doc = document.getSource(); doc = fixDoc(doc); docBuffer.addLine(doc); docBuffer.addLine(); }
public void documentModel(Model model) { .filter(document -> !document.isAppendix()) .sorted() .forEach(this::addDocument);
private void writeDocument(Document document) { writer.writeStartObject(); writeName(document); String source = document.getSource(); if (source != null) { writer.write("source", source); String html = htmlGenerator.toHtml(source); if (html != null) { writer.write("html", html); } } writer.writeEnd(); }
private void writeDocument(Document document) { writer.writeStartElement("document"); writeName(document); String source = document.getSource(); if (source != null) { writer.writeElement("source", source); String html = htmlGenerator.toHtml(source); if (html != null) { writer.writeElement("html", html); } } writer.writeEndElement(); }