Class Text
자세한 문서
append(text)
노드에 이미 있는 콘텐츠에 지정된 텍스트를 추가합니다.
매개변수
이름 | 유형 | 설명 |
text | String | 노드에 추가할 텍스트 |
리턴
Text
: 체이닝을 위한 Text
노드
detach()
노드를 상위 Element
노드에서 분리합니다. 노드에 상위 노드가 없으면 이 메서드는 영향을 미치지 않습니다.
리턴
Content
: 분리된 노드
getParentElement()
노드의 상위 Element
노드를 가져옵니다. 노드에 상위 노드가 없으면 이 메서드는 null
를 반환합니다.
리턴
Element
: 상위 Element
노드
getText()
Text
노드의 텍스트 값을 가져옵니다.
리턴
String
: Text
노드의 텍스트 값입니다.
getValue()
노드의 직접 또는 간접 하위 요소인 모든 노드의 텍스트 값을 문서에 표시되는 순서대로 가져옵니다.
리턴
String
: 노드의 직간접 하위 요소인 모든 노드의 텍스트 값
setText(text)
Text
노드의 텍스트 값을 설정합니다.
매개변수
이름 | 유형 | 설명 |
text | String | 설정할 텍스트 값 |
리턴
Text
: 체이닝을 위한 Text
노드
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2024-12-03(UTC)
[null,null,["최종 업데이트: 2024-12-03(UTC)"],[[["The `Text` object represents a text node within an XML document and provides methods for manipulating its content."],["You can use methods like `append()`, `setText()`, and `getText()` to modify and retrieve the text content of the node."],["`detach()` removes the node from its parent element, while `getParentElement()` allows access to the parent element."],["`getValue()` retrieves the text value of all child nodes, offering a way to access nested content within the text node."]]],[]]