public class NodeImpl extends JSObject implements Node, EventTarget
Modifier and Type | Field and Description |
---|---|
static int |
ATTRIBUTE_NODE |
static int |
CDATA_SECTION_NODE |
static int |
COMMENT_NODE |
static int |
DOCUMENT_FRAGMENT_NODE |
static int |
DOCUMENT_NODE |
static int |
DOCUMENT_POSITION_CONTAINED_BY |
static int |
DOCUMENT_POSITION_CONTAINS |
static int |
DOCUMENT_POSITION_DISCONNECTED |
static int |
DOCUMENT_POSITION_FOLLOWING |
static int |
DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC |
static int |
DOCUMENT_POSITION_PRECEDING |
static int |
DOCUMENT_TYPE_NODE |
static int |
ELEMENT_NODE |
static int |
ENTITY_NODE |
static int |
ENTITY_REFERENCE_NODE |
static int |
NOTATION_NODE |
static int |
PROCESSING_INSTRUCTION_NODE |
static int |
TEXT_NODE |
public static final int ELEMENT_NODE
public static final int ATTRIBUTE_NODE
public static final int TEXT_NODE
public static final int CDATA_SECTION_NODE
public static final int ENTITY_REFERENCE_NODE
public static final int ENTITY_NODE
public static final int PROCESSING_INSTRUCTION_NODE
public static final int COMMENT_NODE
public static final int DOCUMENT_NODE
public static final int DOCUMENT_TYPE_NODE
public static final int DOCUMENT_FRAGMENT_NODE
public static final int NOTATION_NODE
public static final int DOCUMENT_POSITION_DISCONNECTED
public static final int DOCUMENT_POSITION_PRECEDING
public static final int DOCUMENT_POSITION_FOLLOWING
public static final int DOCUMENT_POSITION_CONTAINS
public static final int DOCUMENT_POSITION_CONTAINED_BY
public static final int DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC
public String getNodeName()
getNodeName
in interface Node
public String getNodeValue()
getNodeValue
in interface Node
public void setNodeValue(String value) throws DOMException
setNodeValue
in interface Node
DOMException
public short getNodeType()
getNodeType
in interface Node
public Node getParentNode()
getParentNode
in interface Node
public NodeList getChildNodes()
getChildNodes
in interface Node
public Node getFirstChild()
getFirstChild
in interface Node
public Node getLastChild()
getLastChild
in interface Node
public Node getPreviousSibling()
getPreviousSibling
in interface Node
public Node getNextSibling()
getNextSibling
in interface Node
public Document getOwnerDocument()
getOwnerDocument
in interface Node
public String getNamespaceURI()
getNamespaceURI
in interface Node
public void setPrefix(String value) throws DOMException
setPrefix
in interface Node
DOMException
public String getLocalName()
getLocalName
in interface Node
public NamedNodeMap getAttributes()
getAttributes
in interface Node
public String getBaseURI()
getBaseURI
in interface Node
public String getTextContent()
getTextContent
in interface Node
public void setTextContent(String value) throws DOMException
setTextContent
in interface Node
DOMException
public Element getParentElement()
public Node insertBefore(Node newChild, Node refChild) throws DOMException
insertBefore
in interface Node
DOMException
public Node replaceChild(Node newChild, Node oldChild) throws DOMException
replaceChild
in interface Node
DOMException
public Node removeChild(Node oldChild) throws DOMException
removeChild
in interface Node
DOMException
public Node appendChild(Node newChild) throws DOMException
appendChild
in interface Node
DOMException
public boolean hasChildNodes()
hasChildNodes
in interface Node
public Node cloneNode(boolean deep) throws DOMException
cloneNode
in interface Node
DOMException
public boolean isSupported(String feature, String version)
isSupported
in interface Node
public boolean hasAttributes()
hasAttributes
in interface Node
public boolean isSameNode(Node other)
isSameNode
in interface Node
public boolean isEqualNode(Node other)
isEqualNode
in interface Node
public String lookupPrefix(String namespaceURI)
lookupPrefix
in interface Node
public boolean isDefaultNamespace(String namespaceURI)
isDefaultNamespace
in interface Node
public String lookupNamespaceURI(String prefix)
lookupNamespaceURI
in interface Node
public short compareDocumentPosition(Node other)
compareDocumentPosition
in interface Node
public boolean contains(Node other)
public void addEventListener(String type, EventListener listener, boolean useCapture)
addEventListener
in interface EventTarget
public void removeEventListener(String type, EventListener listener, boolean useCapture)
removeEventListener
in interface EventTarget
public boolean dispatchEvent(Event event) throws DOMException
dispatchEvent
in interface EventTarget
DOMException
public Object getUserData(String key)
getUserData
in interface Node
public Object setUserData(String key, Object data, UserDataHandler handler)
setUserData
in interface Node
public Object getFeature(String feature, String version)
getFeature
in interface Node
public Object eval(String s) throws JSException
JSObject
Evaluates a JavaScript expression. The expression is a string of JavaScript source code which will be evaluated in the context given by "this".
eval
in class JSObject
s
- The JavaScript expression.JSException
public Object getMember(String name)
JSObject
Retrieves a named member of a JavaScript object. Equivalent to "this.name" in JavaScript.
public void setMember(String name, Object value) throws JSException
JSObject
Sets a named member of a JavaScript object. Equivalent to "this.name = value" in JavaScript.
setMember
in class JSObject
name
- The name of the JavaScript property to be accessed.value
- The value of the propery.JSException
public void removeMember(String name) throws JSException
JSObject
Removes a named member of a JavaScript object. Equivalent to "delete this.name" in JavaScript.
removeMember
in class JSObject
name
- The name of the JavaScript property to be removed.JSException
public Object getSlot(int index) throws JSException
JSObject
Retrieves an indexed member of a JavaScript object. Equivalent to "this[index]" in JavaScript.
getSlot
in class JSObject
index
- The index of the array to be accessed.JSException
public void setSlot(int index, Object value) throws JSException
JSObject
Sets an indexed member of a JavaScript object. Equivalent to "this[index] = value" in JavaScript.
setSlot
in class JSObject
index
- The index of the array to be accessed.JSException
public Object call(String methodName, Object... args) throws JSException
JSObject
Calls a JavaScript method. Equivalent to "this.methodName(args[0], args[1], ...)" in JavaScript.
call
in class JSObject
methodName
- The name of the JavaScript method to be invoked.args
- the Java objects passed as arguments to the method.JSException
Copyright © 2020. All rights reserved.