aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/zwobble/mammoth/documents/NoteReference.java
blob: 11190c37daf3a9d7471ac4df09b385013c172d3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package org.zwobble.mammoth.documents;

public class NoteReference implements DocumentElement {
    public static NoteReference footnoteReference(String noteId) {
        return new NoteReference(NoteType.FOOTNOTE, noteId);
    }

    public static NoteReference endnoteReference(String noteId) {
        return new NoteReference(NoteType.ENDNOTE, noteId);
    }

    private final NoteType noteType;
    private final String noteId;

    public NoteReference(NoteType noteType, String noteId) {
        this.noteType = noteType;
        this.noteId = noteId;
    }

    public NoteType getNoteType() {
        return noteType;
    }

    public String getNoteId() {
        return noteId;
    }

    @Override
    public <T> T accept(DocumentElementVisitor<T> visitor) {
        return visitor.visit(this);
    }
}