Class Text
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
详细文档
append(text)
将给定文本附加到节点中已存在的任何内容。
参数
名称 | 类型 | 说明 |
text | String | 要附加到节点的文本 |
返回
Text
- Text
节点,用于链式调用
getText()
获取 Text
节点的文本值。
返回
String
- Text
节点的文本值
getValue()
获取节点的直接或间接子节点的所有文本值,按文档中显示的顺序。
返回
String
- 节点的直接或间接子节点的所有文本值
setText(text)
设置 Text
节点的文本值。
参数
返回
Text
- Text
节点,用于链式调用
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[],["The `Text` node represents XML text content. Key actions include: appending text to the node via `append(text)`, detaching the node from its parent using `detach()`, and retrieving the parent element with `getParentElement()`. Text content can be obtained using `getText()` for the node's text or `getValue()` for text of child nodes. Finally, `setText(text)` sets the text value of the node. These methods allow manipulation and reading of text in an XML structure.\n"],null,[]]