aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/zwobble/mammoth/internal/DocumentConverter.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/zwobble/mammoth/internal/DocumentConverter.java')
-rw-r--r--src/main/java/org/zwobble/mammoth/internal/DocumentConverter.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/main/java/org/zwobble/mammoth/internal/DocumentConverter.java b/src/main/java/org/zwobble/mammoth/internal/DocumentConverter.java
index 5aa3c08..ab28651 100644
--- a/src/main/java/org/zwobble/mammoth/internal/DocumentConverter.java
+++ b/src/main/java/org/zwobble/mammoth/internal/DocumentConverter.java
@@ -24,8 +24,8 @@ import static org.zwobble.mammoth.internal.util.MammothLists.*;
import static org.zwobble.mammoth.internal.util.MammothMaps.map;
public class DocumentConverter {
- public static Result<List<HtmlNode>> convertToHtml(String idPrefix, boolean preserveEmptyParagraphs, StyleMap styleMap, Document document) {
- DocumentConverter documentConverter = new DocumentConverter(idPrefix, preserveEmptyParagraphs, styleMap);
+ public static Result<List<HtmlNode>> convertToHtml(Document document, DocumentToHtmlOptions options) {
+ DocumentConverter documentConverter = new DocumentConverter(options);
return new Result<>(
documentConverter.convertToHtml(document),
documentConverter.warnings.build());
@@ -38,8 +38,8 @@ public class DocumentConverter {
reference -> document.getNotes().findNote(reference.getNoteType(), reference.getNoteId()).get()));
}
- public static Result<List<HtmlNode>> convertToHtml(String idPrefix, boolean preserveEmptyParagraphs, StyleMap styleMap, DocumentElement element) {
- DocumentConverter documentConverter = new DocumentConverter(idPrefix, preserveEmptyParagraphs, styleMap);
+ public static Result<List<HtmlNode>> convertToHtml(DocumentElement element, DocumentToHtmlOptions options) {
+ DocumentConverter documentConverter = new DocumentConverter(options);
return new Result<>(
documentConverter.convertToHtml(element),
documentConverter.warnings.build());
@@ -51,10 +51,10 @@ public class DocumentConverter {
private final List<NoteReference> noteReferences = new ArrayList<>();
private final ImmutableList.Builder<Warning> warnings = ImmutableList.builder();
- private DocumentConverter(String idPrefix, boolean preserveEmptyParagraphs, StyleMap styleMap) {
- this.idPrefix = idPrefix;
- this.preserveEmptyParagraphs = preserveEmptyParagraphs;
- this.styleMap = styleMap;
+ private DocumentConverter(DocumentToHtmlOptions options) {
+ this.idPrefix = options.idPrefix();
+ this.preserveEmptyParagraphs = options.shouldPreserveEmptyParagraphs();
+ this.styleMap = options.styleMap();
}
private List<HtmlNode> convertToHtml(Document document) {