Module org.htmlunit

Class ProcessingInstruction

java.lang.Object
org.htmlunit.corejs.javascript.SlotMapOwner<org.htmlunit.corejs.javascript.Scriptable>
All Implemented Interfaces:
Serializable, Cloneable, org.htmlunit.corejs.javascript.ConstProperties<org.htmlunit.corejs.javascript.Scriptable>, org.htmlunit.corejs.javascript.debug.DebuggableObject, org.htmlunit.corejs.javascript.PropHolder<org.htmlunit.corejs.javascript.Scriptable>, org.htmlunit.corejs.javascript.Scriptable, org.htmlunit.corejs.javascript.SymbolScriptable

public class ProcessingInstruction extends CharacterData
A JavaScript object for ProcessingInstruction.

Note: There is an architectural difference between the Java DOM layer and the JavaScript host layer: DomProcessingInstruction extends DomNode directly rather than a Java-equivalent character data class, whereas this JavaScript class inherits from CharacterData to correctly mirror the standard browser prototype chain.

Author:
Ahmed Ashour, Ronald Brill
See Also:
  • Constructor Details

    • ProcessingInstruction

      public ProcessingInstruction()
  • Method Details

    • jsConstructor

      public void jsConstructor()
      JavaScript constructor.
      Overrides:
      jsConstructor in class CharacterData
    • getTarget

      public String getTarget()
      Returns the target attribute.
      Returns:
      the target
    • getData

      public String getData()
      Returns the data attribute.
      Overrides:
      getData in class CharacterData
      Returns:
      the data
    • setData

      public void setData(String data)
      Sets the data attribute.
      Overrides:
      setData in class CharacterData
      Parameters:
      data - the data
    • getLength

      public int getLength()
      Gets the number of character in the character data.
      Overrides:
      getLength in class CharacterData
      Returns:
      the number of characters
    • appendData

      public void appendData(String arg)
      Appends a string to character data.
      Overrides:
      appendData in class CharacterData
      Parameters:
      arg - the string to be appended to the character data
    • deleteData

      public void deleteData(int offset, int count)
      Deletes characters from character data.
      Overrides:
      deleteData in class CharacterData
      Parameters:
      offset - the position of the first character to be deleted
      count - the number of characters to be deleted
    • insertData

      public void insertData(int offset, String arg)
      Inserts a string into character data.
      Overrides:
      insertData in class CharacterData
      Parameters:
      offset - the position within the first character at which the string is to be inserted.
      arg - the string to insert
    • replaceData

      public void replaceData(int offset, int count, String arg)
      Replaces characters of character data with a string.
      Overrides:
      replaceData in class CharacterData
      Parameters:
      offset - the position within the first character at which the string is to be replaced.
      count - the number of characters to be replaced
      arg - the string that replaces the count characters beginning at the character at offset.
    • substringData

      public String substringData(int offset, int count)
      Extracts a substring from character data.
      Overrides:
      substringData in class CharacterData
      Parameters:
      offset - the position of the first character to be extracted
      count - the number of characters to be extracted
      Returns:
      a string that consists of the count characters of the character data starting from the character at position offset