Class Comment
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
內容詳盡的說明文件
getParentElement()
取得節點的父項 Element 節點。如果節點沒有父項,這個方法會傳回 null。
回攻員
Element|null:父項 Element 節點。
getText()
取得 Comment 節點的文字值。
回攻員
String:Comment 節點的文字值。
getValue()
取得節點直接或間接子項的所有節點文字值,順序與文件中的顯示順序相同。
回攻員
String:節點直接或間接子項的所有節點文字值。
setText(text)
設定 Comment 節點的文字值。
參數
| 名稱 | 類型 | 說明 |
text | String | 要設定的文字值。 |
回攻員
Comment:Comment 節點,用於鏈結。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2026-02-11 (世界標準時間)。
[null,null,["上次更新時間:2026-02-11 (世界標準時間)。"],[],["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"]]