Class Comment
Comment
XML Comment
노드의 표현입니다.
자세한 문서
detach()
노드를 상위 Element
노드에서 분리합니다. 노드에 상위 노드가 없으면 이 메서드는 영향을 미치지 않습니다.
리턴
Content
: 분리된 노드
getParentElement()
노드의 상위 Element
노드를 가져옵니다. 노드에 상위 노드가 없으면 이 메서드는 null
를 반환합니다.
리턴
Element
: 상위 Element
노드
getText()
Comment
노드의 텍스트 값을 가져옵니다.
리턴
String
: Comment
노드의 텍스트 값입니다.
getValue()
노드의 직접 또는 간접 하위 요소인 모든 노드의 텍스트 값을 문서에 표시되는 순서대로 가져옵니다.
리턴
String
: 노드의 직간접 하위 요소인 모든 노드의 텍스트 값
setText(text)
Comment
노드의 텍스트 값을 설정합니다.
매개변수
이름 | 유형 | 설명 |
text | String | 설정할 텍스트 값 |
리턴
Comment
: 체이닝을 위한 Comment
노드
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2024-12-03(UTC)
[null,null,["최종 업데이트: 2024-12-03(UTC)"],[[["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"]]