1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.mybatis.generator.api.dom.xml;
17
18 import java.util.Optional;
19
20 import org.jspecify.annotations.Nullable;
21
22 public class Document {
23
24 private @Nullable DocType docType;
25
26 private final XmlElement rootElement;
27
28 public Document(String publicId, String systemId, XmlElement rootElement) {
29 this(rootElement);
30 docType = new PublicDocType(publicId, systemId);
31 }
32
33 public Document(String systemId, XmlElement rootElement) {
34 this(rootElement);
35 docType = new SystemDocType(systemId);
36 }
37
38 public Document(XmlElement rootElement) {
39 this.rootElement = rootElement;
40 }
41
42 public XmlElement getRootElement() {
43 return rootElement;
44 }
45
46 public Optional<DocType> getDocType() {
47 return Optional.ofNullable(docType);
48 }
49 }