Class Comment Stay organized with collections Save and categorize content based on your preferences.
AI-generated Key Takeaways
Comment is a representation of an XML
Commentnode.Methods are available to detach the Comment node, get its parent element, and get or set its text value.
The
getValue()method retrieves the text value of all direct or indirect children of the node.
A representation of an XMLComment node.
Methods
| Method | Return type | Brief description |
|---|---|---|
detach() | Content | Detaches the node from its parentElement node. |
get | Element | Gets the node's parentElement node. |
get | String | Gets the text value of theComment 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 | Comment | Sets the text value of theComment node. |
Detailed documentation
detach()
getParentElement()
getText()
Gets the text value of theComment node.
Return
String — the text value of theComment node
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
setText(text)
Sets the text value of theComment node.
Parameters
| Name | Type | Description |
|---|---|---|
text | String | the text value to set |
Return
Comment — theComment 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 2024-12-02 UTC.