Class EntityRef

  • 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.

EntityRef

A representation of an XMLEntityReference node.

Methods

MethodReturn typeBrief description
detach()ContentDetaches the node from its parentElement node.
getName()StringGets the name of theEntityReference node.
getParentElement()ElementGets the node's parentElement node.
getPublicId()StringGets the public ID of theEntityReference node.
getSystemId()StringGets the system ID of theEntityReference node.
getValue()StringGets the text value of all nodes that are direct or indirect children of the node, in the orderthey appear in the document.
setName(name)EntityRefSets the name of theEntityReference node.
setPublicId(id)EntityRefSets the public ID of theEntityReference node.
setSystemId(id)EntityRefSets the system ID of theEntityReference node.

Detailed documentation

detach()

Detaches the node from its parentElement node. If the node does not have a parent,this method has no effect.

Return

Content — the detached node


getName()

Gets the name of theEntityReference node.

Return

String — the name of theEntityReference node


getParentElement()

Gets the node's parentElement node. If the node does not have a parent, this methodreturnsnull.

Return

Element — the parentElement node


getPublicId()

Gets the public ID of theEntityReference node. If the node does not have a public ID,this method returnsnull.

Return

String — the public ID of theEntityReference node, ornull if it has none


getSystemId()

Gets the system ID of theEntityReference node. If the node does not have a system ID,this method returnsnull.

Return

String — the system ID of theEntityReference 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 theEntityReference node.

Parameters

NameTypeDescription
nameStringthe name to set

Return

EntityRef — theEntityReference node, for chaining


setPublicId(id)

Sets the public ID of theEntityReference node.

Parameters

NameTypeDescription
idStringthe public ID to set

Return

EntityRef — theEntityReference node, for chaining


setSystemId(id)

Sets the system ID of theEntityReference node.

Parameters

NameTypeDescription
idStringthe system ID to set

Return

EntityRef — theEntityReference 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.