1
|
|
/*
|
2
|
|
* JBind
|
3
|
|
*
|
4
|
|
* Copyright (c) by Stefan Wachter. All rights reserved.
|
5
|
|
*
|
6
|
|
* Usage, modification, and redistribution is subject to license terms that are
|
7
|
|
* available at 'http://www.jbind.org'. The JBind license is like the
|
8
|
|
* 'Apache Software License V 1.1'.
|
9
|
|
*/
|
10
|
|
package org.jbind.xml.dom3.core;
|
11
|
|
|
12
|
|
import org.jbind.xml.dom3.types.IDomDocument;
|
13
|
|
import org.jbind.xml.dom3.types.IDomEntity;
|
14
|
|
import org.jbind.xml.dom3.types.IDomNodeList;
|
15
|
|
import org.jbind.xml.dom3.types.IDomVisitor;
|
16
|
|
import org.w3c.dom.Node;
|
17
|
|
|
18
|
|
public class DomEntity extends DomNonAttrOrElm implements IDomEntity {
|
19
|
|
|
20
|
|
private String myPublicId = null;
|
21
|
|
private String mySystemId = null;
|
22
|
|
private String myNotationName = null;
|
23
|
|
|
24
|
|
/**
|
25
|
|
* <p>EXPERIMENTAL! Based on the <a
|
26
|
|
* href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
|
27
|
|
* Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
|
28
|
|
* <p>
|
29
|
|
* An attribute specifying, as part of the text declaration, the encoding
|
30
|
|
* of this entity, when it is an external parsed entity. This is
|
31
|
|
* <code>null</code> otherwise.
|
32
|
|
* @since DOM Level 3
|
33
|
|
*/
|
34
|
|
private String myEncoding = null;
|
35
|
|
|
36
|
|
/**
|
37
|
|
* An attribute specifying the actual encoding of this document. This is
|
38
|
|
* <code>null</code> otherwise.
|
39
|
|
* <br> This attribute represents the property [character encoding scheme]
|
40
|
|
* defined in .
|
41
|
|
* @since DOM Level 3
|
42
|
|
*/
|
43
|
|
private String myActualEncoding = null;
|
44
|
|
|
45
|
|
/**
|
46
|
|
* <p>EXPERIMENTAL! Based on the <a
|
47
|
|
* href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
|
48
|
|
* Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
|
49
|
|
* <p>
|
50
|
|
* An attribute specifying, as part of the text declaration, the version
|
51
|
|
* number of this entity, when it is an external parsed entity. This is
|
52
|
|
* <code>null</code> otherwise.
|
53
|
|
* @since DOM Level 3
|
54
|
|
*/
|
55
|
|
private String myVersion = null;
|
56
|
|
|
57
|
0
|
public DomEntity(IDomDocument aDomDocument, String aPublicId, String aSystemId, String aNotationName) {
|
58
|
0
|
super(aDomDocument);
|
59
|
0
|
myPublicId = aPublicId;
|
60
|
0
|
mySystemId = aSystemId;
|
61
|
0
|
myNotationName = aNotationName;
|
62
|
|
}
|
63
|
|
|
64
|
0
|
protected DomEntity(IDomEntity aDomEntity, boolean aDeep) {
|
65
|
0
|
super(aDomEntity, aDeep);
|
66
|
0
|
myPublicId = aDomEntity.getPublicId();
|
67
|
0
|
mySystemId = aDomEntity.getSystemId();
|
68
|
0
|
myNotationName = aDomEntity.getNotationName();
|
69
|
|
}
|
70
|
|
|
71
|
0
|
public Node cloneNode(boolean aDeep) {
|
72
|
0
|
return new DomEntity(this, aDeep);
|
73
|
|
}
|
74
|
|
|
75
|
0
|
protected IDomNodeList doCloneChildNodes(IDomNodeList aDomNodeList, boolean aDeep) {
|
76
|
0
|
return new DomNodeList(aDomNodeList, aDeep);
|
77
|
|
}
|
78
|
|
|
79
|
0
|
public String getNodeName() {
|
80
|
|
// TODO clarify.
|
81
|
|
assert false : "nyi";
|
82
|
0
|
return null;
|
83
|
|
}
|
84
|
|
|
85
|
0
|
public short getNodeType() {
|
86
|
0
|
return ENTITY_NODE;
|
87
|
|
}
|
88
|
|
|
89
|
0
|
public String getNodeValue() throws DomException {
|
90
|
0
|
return null;
|
91
|
|
}
|
92
|
|
|
93
|
0
|
public void setNodeValue(String aString) throws DomException {
|
94
|
|
// The specification says that setting the node value of an entity has no effect
|
95
|
|
}
|
96
|
|
|
97
|
0
|
public String getNotationName() {
|
98
|
0
|
return myNotationName;
|
99
|
|
}
|
100
|
|
|
101
|
0
|
public String getPublicId() {
|
102
|
0
|
return myPublicId;
|
103
|
|
}
|
104
|
|
|
105
|
0
|
public String getSystemId() {
|
106
|
0
|
return mySystemId;
|
107
|
|
}
|
108
|
|
|
109
|
0
|
public String getVersion() {
|
110
|
0
|
return myVersion;
|
111
|
|
}
|
112
|
|
|
113
|
0
|
public void setVersion(String aVersion) {
|
114
|
0
|
myVersion = aVersion;
|
115
|
|
}
|
116
|
|
|
117
|
0
|
public String getEncoding() {
|
118
|
0
|
return myEncoding;
|
119
|
|
}
|
120
|
|
|
121
|
0
|
public void setEncoding(String anEncoding) {
|
122
|
0
|
myEncoding = anEncoding;
|
123
|
|
}
|
124
|
|
|
125
|
0
|
public String getActualEncoding() {
|
126
|
0
|
return myActualEncoding;
|
127
|
|
}
|
128
|
|
|
129
|
0
|
public void setActualEncoding(String anEncoding) {
|
130
|
0
|
myActualEncoding = anEncoding;
|
131
|
|
}
|
132
|
|
|
133
|
0
|
protected void doBeforeAccept(IDomVisitor aDomVisitor) {
|
134
|
0
|
aDomVisitor.visitEntityStart(this);
|
135
|
|
}
|
136
|
0
|
protected void doAfterAccept(IDomVisitor aDomVisitor) {
|
137
|
0
|
aDomVisitor.visitEntityEnd(this);
|
138
|
|
}
|
139
|
|
|
140
|
0
|
public String getTextContent() {
|
141
|
0
|
return collectTextContent(myChildNodes);
|
142
|
|
}
|
143
|
|
|
144
|
|
}
|
145
|
|
|