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 XML EntityReference node.

Methods

MethodReturn typeBrief description
detach() Content Detaches the node from its parent Element node.
getName() StringGets the name of the EntityReference node.
getParentElement() Element Gets the node's parent Element node.
getPublicId() StringGets the public ID of the EntityReference node.
getSystemId() StringGets the system ID of the EntityReference node.
getValue() StringGets the text value of all nodes that are direct or indirect children of the node, in the order they appear in the document.
setName(name) EntityRef Sets the name of the EntityReference node.
setPublicId(id) EntityRef Sets the public ID of the EntityReference node.
setSystemId(id) EntityRef Sets the system ID of the EntityReference node.

Detailed documentation

detach()

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

Return

Content — the detached node


getName()

Gets the name of the EntityReference node.

Return

String — the name of the EntityReference node


getParentElement()

Gets the node's parent Element node. If the node does not have a parent, this method returns null.

Return

Element — the parent Element node


getPublicId()

Gets the public ID of the EntityReference node. If the node does not have a public ID, this method returns null.

Return

String — the public ID of the EntityReference node, or null if it has none


getSystemId()

Gets the system ID of the EntityReference node. If the node does not have a system ID, this method returns null.

Return

String — the system ID of the EntityReference node, or null if it has none


getValue()

Gets the text value of all nodes that are direct or indirect children of the node, in the order they 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 the EntityReference node.

Parameters

NameTypeDescription
nameStringthe name to set

Return

EntityRef — the EntityReference node, for chaining


setPublicId(id)

Sets the public ID of the EntityReference node.

Parameters

NameTypeDescription
idStringthe public ID to set

Return

EntityRef — the EntityReference node, for chaining


setSystemId(id)

Sets the system ID of the EntityReference node.

Parameters

NameTypeDescription
idStringthe system ID to set

Return

EntityRef — the EntityReference node, for chaining

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年12月11日 UTC.