1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package net.sourceforge.jeuclid.elements.generic;
20
21 import org.apache.batik.dom.AbstractDOMImplementation;
22 import org.w3c.dom.DOMImplementation;
23 import org.w3c.dom.Document;
24 import org.w3c.dom.DocumentType;
25
26
27
28
29 public final class JEuclidDOMImplementation extends AbstractDOMImplementation {
30
31 private static final long serialVersionUID = 1L;
32
33 private static final class SingletonHolder {
34 private static final JEuclidDOMImplementation INSTANCE = new JEuclidDOMImplementation();
35
36 private SingletonHolder() {
37 }
38 }
39
40
41
42
43 protected JEuclidDOMImplementation() {
44 super();
45 }
46
47
48 public Document createDocument(final String namespaceURI,
49 final String qualifiedName, final DocumentType doctype) {
50 final Document result = new DocumentElement(doctype);
51 result.appendChild(result.createElementNS(namespaceURI, qualifiedName));
52 return result;
53 }
54
55
56 public DocumentType createDocumentType(final String qualifiedName,
57 final String publicId, final String systemId) {
58 throw new UnsupportedOperationException();
59 }
60
61
62
63
64
65
66 public static DOMImplementation getInstance() {
67 return JEuclidDOMImplementation.SingletonHolder.INSTANCE;
68 }
69 }