Class Comment
內容詳盡的說明文件
getText()
取得 Comment
節點的文字值。
回攻員
String
:Comment
節點的文字值
getValue()
取得節點的所有直接或間接子項節點的文字值,並依文件中顯示的順序排列。
回攻員
String
:節點的直接或間接子項的所有節點文字值
setText(text)
設定 Comment
節點的文字值。
參數
回攻員
Comment
:用於鏈結的 Comment
節點
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-12-03 (世界標準時間)。
[null,null,["上次更新時間:2024-12-03 (世界標準時間)。"],[[["Represents an XML `Comment` node, providing methods for interaction."],["Allows detachment from parent element, retrieval of parent/text values, and text modification."],["Includes `getText()` for the comment's text and `getValue()` for text of all child nodes."],["Offers `setText()` to modify the comment's text and `detach()` to remove it from its parent."]]],["An XML `Comment` node can be manipulated using several methods. `detach()` removes the node from its parent element. `getParentElement()` retrieves the parent `Element` node, if any. `getText()` and `getValue()` return the text content of the `Comment` node and its children respectively. The `setText(text)` method updates the text content of the `Comment` node and supports method chaining by returning the updated `Comment` node.\n"]]