Class EntityRef Stay organized with collections Save and categorize content based on your preferences.
Page Summary
EntityRef represents an XML EntityReference node.
It provides methods to get and set the name, public ID, and system ID of the node.
You can detach an EntityRef node from its parent element.
You can get the text value of all child nodes.
A representation of an XMLEntity node.
Methods
| Method | Return type | Brief description |
|---|---|---|
detach() | Content | Detaches the node from its parentElement node. |
get | String | Gets the name of theEntity node. |
get | Element | Gets the node's parentElement node. |
get | String | Gets the public ID of theEntity node. |
get | String | Gets the system ID of theEntity node. |
get | String | Gets the text value of all nodes that are direct or indirect children of the node, in the orderthey appear in the document. |
set | Entity | Sets the name of theEntity node. |
set | Entity | Sets the public ID of theEntity node. |
set | Entity | Sets the system ID of theEntity node. |
Detailed documentation
detach()
getName()
Gets the name of theEntity node.
Return
String — the name of theEntity node
getParentElement()
getPublicId()
Gets the public ID of theEntity node. If the node does not have a public ID,this method returnsnull.
Return
String — the public ID of theEntity node, ornull if it has none
getSystemId()
Gets the system ID of theEntity node. If the node does not have a system ID,this method returnsnull.
Return
String — the system ID of theEntity node, ornull if it has none
getValue()
Gets the text value of all nodes that are direct or indirect children of the node, in the orderthey appear in the document.
Return
String — the text value of all nodes that are direct or indirect children of the node
setName(name)
Sets the name of theEntity node.
Parameters
| Name | Type | Description |
|---|---|---|
name | String | the name to set |
Return
Entity — theEntity node, for chaining
setPublicId(id)
Sets the public ID of theEntity node.
Parameters
| Name | Type | Description |
|---|---|---|
id | String | the public ID to set |
Return
Entity — theEntity node, for chaining
setSystemId(id)
Sets the system ID of theEntity node.
Parameters
| Name | Type | Description |
|---|---|---|
id | String | the system ID to set |
Return
Entity — theEntity node, for chaining
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-11 UTC.