Class DOMCharacterData

All Implemented Interfaces:
DOMRange, CharacterData, Node
Direct Known Subclasses:
DOMComment, DOMProcessingInstruction, DOMText

public abstract class DOMCharacterData extends DOMTreeNode implements CharacterData
A CharacterData node.
  • Constructor Details

    • DOMCharacterData

      public DOMCharacterData(int start, int end)
  • Method Details

    • hasMultiLine

      public boolean hasMultiLine()
    • getDelimiter

      public String 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

      public boolean containsText(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's CharSequence.
      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

      public String getData()
      Specified by:
      getData in interface CharacterData
    • getNodeValue

      public String getNodeValue() throws DOMException
      Specified by:
      getNodeValue in interface Node
      Overrides:
      getNodeValue in class DOMNode
      Throws:
      DOMException
    • isWhitespace

      public boolean isWhitespace()
    • setWhitespace

      public void setWhitespace(boolean whitespace)
    • appendData

      public void appendData(String data) throws DOMException
      Specified by:
      appendData in interface CharacterData
      Throws:
      DOMException
    • deleteData

      public void deleteData(int offset, int count) throws DOMException
      Specified by:
      deleteData in interface CharacterData
      Throws:
      DOMException
    • getLength

      public int getLength()
      Specified by:
      getLength in interface CharacterData
    • insertData

      public void insertData(int offset, String data) throws DOMException
      Specified by:
      insertData in interface CharacterData
      Throws:
      DOMException
    • replaceData

      public void replaceData(int offset, int count, String data) throws DOMException
      Specified by:
      replaceData in interface CharacterData
      Throws:
      DOMException
    • setData

      public void setData(String value) throws DOMException
      Specified by:
      setData in interface CharacterData
      Throws:
      DOMException
    • substringData

      public String substringData(int offset, int count) throws DOMException
      Specified by:
      substringData in interface CharacterData
      Throws:
      DOMException