Package org.eclipse.lemminx.dom
Class DOMCharacterData
java.lang.Object
org.eclipse.lemminx.dom.DOMNode
org.eclipse.lemminx.dom.DOMTreeNode
org.eclipse.lemminx.dom.DOMCharacterData
- All Implemented Interfaces:
DOMRange,CharacterData,Node
- Direct Known Subclasses:
DOMComment,DOMProcessingInstruction,DOMText
A CharacterData node.
-
Field Summary
Fields inherited from class org.eclipse.lemminx.dom.DOMNode
DTD_ATT_LIST_NODE, DTD_DECL_NODE, DTD_ELEMENT_DECL_NODE, DTD_ENTITY_DECL_NODE, DTD_NOTATION_DECL, NULL_VALUEFields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappendData(String data) booleancontainsText(String text) Returns true if the trimmed content of this character data equals the given text, using zero-allocation char-by-char comparison against the document'sCharSequence.voiddeleteData(int offset, int count) booleanIf data ends with a new line character.getData()intintintbooleanhasData()booleanvoidinsertData(int offset, String data) booleanvoidreplaceData(int offset, int count, String data) voidvoidsetWhitespace(boolean whitespace) booleanIf data starts with a new line character.substringData(int offset, int count) Methods inherited from class org.eclipse.lemminx.dom.DOMTreeNode
getEnd, getStart, isClosedMethods inherited from class org.eclipse.lemminx.dom.DOMNode
addChild, appendChild, attributes, children, cloneNode, compareDocumentPosition, findAttrAt, findAttrAt, findChildWithAttributeValue, findDTDDeclParameterAt, findDTDDeclParameterAt, findNodeAt, findNodeBefore, findNodeOrAttrAt, findTextAt, getAttribute, getAttributeAtIndex, getAttributeNode, getAttributeNode, getAttributeNodes, getAttributes, getBaseURI, getChild, getChildNodes, getChildren, getFeature, getFirstChild, getLastAttr, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getOrphanEndElement, getOrphanEndElement, getOwnerDocument, getParentElement, getParentNode, getPrefix, getPreviousNonTextSibling, getPreviousSibling, getTextContent, getUserData, hasAttribute, hasAttributes, hasChildNodes, hasSiblings, hasSingleAttribute, insertBefore, isAttribute, isCDATA, isCharacterData, isChildOfOwnerDocument, isComment, isDefaultNamespace, isDoctype, isDTDAttListDecl, isDTDElementDecl, isDTDEntityDecl, isDTDNotationDecl, isElement, isEqualNode, isGenericDTDDecl, isIncluded, isIncluded, isOwnerDocument, isProcessingInstruction, isProlog, isSameNode, isSupported, isText, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setAttribute, setAttributeNode, setNodeValue, setPrefix, setTextContent, setUserData, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
-
Constructor Details
-
DOMCharacterData
public DOMCharacterData(int start, int end)
-
-
Method Details
-
hasMultiLine
public boolean hasMultiLine() -
getDelimiter
-
endsWithNewLine
public boolean endsWithNewLine()If data ends with a new line character. Returns false if a character is found before a new line. Non-newline whitespace will be ignored while searching. If no data exists, returns false.- Returns:
- true if newline character occurs before non-whitespace character
-
startsWithNewLine
public boolean startsWithNewLine()If data starts with a new line character. Returns false if a character is found before a new line. Non-newline whitespace will be ignored while searching.- Returns:
- true if newline character occurs before non-whitespace character
-
containsText
Returns true if the trimmed content of this character data equals the given text, using zero-allocation char-by-char comparison against the document'sCharSequence.- Parameters:
text- the text to match against the trimmed content.- Returns:
- true if the trimmed content equals the given text.
-
hasData
public boolean hasData() -
getStartContent
public int getStartContent() -
getEndContent
public int getEndContent() -
getData
- Specified by:
getDatain interfaceCharacterData
-
getNodeValue
- Specified by:
getNodeValuein interfaceNode- Overrides:
getNodeValuein classDOMNode- Throws:
DOMException
-
isWhitespace
public boolean isWhitespace() -
setWhitespace
public void setWhitespace(boolean whitespace) -
appendData
- Specified by:
appendDatain interfaceCharacterData- Throws:
DOMException
-
deleteData
- Specified by:
deleteDatain interfaceCharacterData- Throws:
DOMException
-
getLength
public int getLength()- Specified by:
getLengthin interfaceCharacterData
-
insertData
- Specified by:
insertDatain interfaceCharacterData- Throws:
DOMException
-
replaceData
- Specified by:
replaceDatain interfaceCharacterData- Throws:
DOMException
-
setData
- Specified by:
setDatain interfaceCharacterData- Throws:
DOMException
-
substringData
- Specified by:
substringDatain interfaceCharacterData- Throws:
DOMException
-