Note that this object models the actual entity, _not_ the entity declaration or the entity reference.
An XML processor may choose to completely expand entities before the structure model is passed to the DOM; in this case, there will be no EntityReferences in the DOM tree.
Quoting the 10/01 DOM Proposal,
"The DOM Level 1 does not support editing Entity nodes; if a user wants to make changes to the contents of an Entity, every related EntityReference node has to be replaced in the structure model by a clone of the Entity's contents, and then the desired changes must be made to each of those clones instead. All the descendants of an Entity node are readonly."I'm interpreting this as: It is the parser's responsibilty to call the non-DOM operation setReadOnly(true,true) after it constructs the Entity. Since the DOM explicitly decided not to deal with this, _any_ answer will involve a non-DOM operation, and this is the simplest solution.
Modifier and Type | Field and Description |
---|---|
protected String | baseURI
base uri |
protected String | encoding
Encoding |
protected String | inputEncoding
Input Encoding |
protected String | name
Entity name. |
protected String | notationName
Notation name. |
protected String | publicId
Public identifier. |
pack-priv static final long | serialVersionUID
Hides com. |
protected String | systemId
System identifier. |
protected String | version
Version |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public Node | cloneNode(boolean
If deep)true , recursively clone the subtree under
the specified node; if false , clone only the node
itself (and its attributes, if it is an Element ).Overrides com. Implements org. Clone node. |
public String | Returns: The absolute base URI of this node or null.Overrides com. Implements org. Returns the absolute base URI of this node or null if the implementation wasn't able to obtain an absolute URI. |
public String | getInputEncoding()
Implements org. An attribute specifying the encoding used for this entity at the tiome of parsing, when it is an external parsed entity. |
public String | getNodeName()
Implements abstract com. Implements org. Returns the entity name |
public short | getNodeType()
Implements abstract com. Implements org. A short integer indicating what type of node this is. |
public String | getNotationName()
Implements org. Unparsed entities -- which contain non-XML data -- have a "notation name" which tells applications how to deal with them. |
public String | getPublicId()
Implements org. The public identifier associated with the entity. |
public String | getSystemId()
Implements org. The system identifier associated with the entity. |
public String | getXmlEncoding()
Implements org. DOM Level 3 WD - experimental the encoding of this entity, when it is an external parsed entity. |
public String | getXmlVersion()
Implements org. DOM Level 3 WD - experimental the version number of this entity, when it is an external parsed entity. |
public void | |
public void | |
public void | setNodeValue(String x)
Overrides com. Implements org. Sets the node value. |
public void | setNotationName(String name)
DOM Level 2: Unparsed entities -- which contain non-XML data -- have a "notation name" which tells applications how to deal with them. |
public void | setPrefix(String prefix)
Overrides com. Implements org. The namespace prefix of this node |
public void | |
public void | |
public void | setXmlEncoding(String value)
NON-DOM encoding - An attribute specifying, as part of the text declaration, the encoding of this entity, when it is an external parsed entity. |
public void | setXmlVersion(String value)
NON-DOM version - An attribute specifying, as part of the text declaration, the version number of this entity, when it is an external parsed entity. |
baseURI | back to summary |
---|---|
protected String baseURI base uri |
encoding | back to summary |
---|---|
protected String encoding Encoding |
inputEncoding | back to summary |
---|---|
protected String inputEncoding Input Encoding |
name | back to summary |
---|---|
protected String name Entity name. |
notationName | back to summary |
---|---|
protected String notationName Notation name. |
publicId | back to summary |
---|---|
protected String publicId Public identifier. |
serialVersionUID | back to summary |
---|---|
pack-priv static final long serialVersionUID Hides com. Serialization version. |
systemId | back to summary |
---|---|
protected String systemId System identifier. |
version | back to summary |
---|---|
protected String version Version |
EntityImpl | back to summary |
---|---|
public EntityImpl(CoreDocumentImpl ownerDoc, String name) Factory constructor. |
cloneNode | back to summary |
---|---|
public Node cloneNode(boolean deep) Overrides com. Implements org. Clone node.
|
getBaseURI | back to summary |
---|---|
public String getBaseURI() Overrides com. Implements org. Returns the absolute base URI of this node or null if the implementation wasn't able to obtain an absolute URI. Note If the URI is malformed, a null is returned.
|
getInputEncoding | back to summary |
---|---|
public String getInputEncoding() Implements org. An attribute specifying the encoding used for this entity at the tiome
of parsing, when it is an external parsed entity. This is
|
getNodeName | back to summary |
---|---|
public String getNodeName() Implements abstract com. Implements org. Returns the entity name |
getNodeType | back to summary |
---|---|
public short getNodeType() Implements abstract com. Implements org. A short integer indicating what type of node this is. The named constants for this value are defined in the org.w3c.dom.Node interface. |
getNotationName | back to summary |
---|---|
public String getNotationName() Implements org. Unparsed entities -- which contain non-XML data -- have a "notation name" which tells applications how to deal with them. Parsed entities, which are in XML format, don't need this and set it to null. |
getPublicId | back to summary |
---|---|
public String getPublicId() Implements org. The public identifier associated with the entity. If not specified, this will be null. |
getSystemId | back to summary |
---|---|
public String getSystemId() Implements org. The system identifier associated with the entity. If not specified, this will be null. |
getXmlEncoding | back to summary |
---|---|
public String getXmlEncoding() Implements org. DOM Level 3 WD - experimental the encoding of this entity, when it is an external parsed entity. |
getXmlVersion | back to summary |
---|---|
public String getXmlVersion() Implements org. DOM Level 3 WD - experimental the version number of this entity, when it is an external parsed entity. |
setBaseURI | back to summary |
---|---|
public void setBaseURI(String uri) NON-DOM: set base uri |
setInputEncoding | back to summary |
---|---|
public void setInputEncoding(String inputEncoding) NON-DOM, used to set the input encoding. |
setNodeValue | back to summary |
---|---|
public void setNodeValue(String x) throws DOMException Overrides com. Implements org. Sets the node value.
|
setNotationName | back to summary |
---|---|
public void setNotationName(String name) DOM Level 2: Unparsed entities -- which contain non-XML data -- have a "notation name" which tells applications how to deal with them. Parsed entities, which are in XML format, don't need this and set it to null. |
setPrefix | back to summary |
---|---|
public void setPrefix(String prefix) throws DOMException Overrides com. Implements org. The namespace prefix of this node
|
setPublicId | back to summary |
---|---|
public void setPublicId(String id) DOM Level 2: The public identifier associated with the entity. If not specified, this will be null. |
setSystemId | back to summary |
---|---|
public void setSystemId(String id) DOM Level 2: The system identifier associated with the entity. If not specified, this will be null. |
setXmlEncoding | back to summary |
---|---|
public void setXmlEncoding(String value) NON-DOM encoding - An attribute specifying, as part of the text declaration, the encoding of this entity, when it is an external parsed entity. This is null otherwise |
setXmlVersion | back to summary |
---|---|
public void setXmlVersion(String value) NON-DOM version - An attribute specifying, as part of the text declaration, the version number of this entity, when it is an external parsed entity. This is null otherwise |