Package org.w3c.dom.events
Interface MutationEvent
-
- All Superinterfaces:
Event
- All Known Subinterfaces:
MutationNameEvent
- All Known Implementing Classes:
DOMMutationEvent
,DOMMutationNameEvent
public interface MutationEvent extends Event
TheMutationEvent
interface provides specific contextual information associated with Mutation events.To create an instance of the
MutationEvent
interface, use theDocumentEvent.createEvent("MutationEvent")
method call.See also the Document Object Model (DOM) Level 3 Events Specification .
- Since:
- DOM Level 2
-
-
Field Summary
Fields Modifier and Type Field Description static short
ADDITION
TheAttr
was just added.static short
MODIFICATION
TheAttr
was modified in place.static short
REMOVAL
TheAttr
was just removed.-
Fields inherited from interface org.w3c.dom.events.Event
AT_TARGET, BUBBLING_PHASE, CAPTURING_PHASE
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description short
getAttrChange()
attrChange
indicates the type of change which triggered the DOMAttrModified event.java.lang.String
getAttrName()
attrName
indicates the name of the changedAttr
node in a DOMAttrModified event.java.lang.String
getNewValue()
newValue
indicates the new value of theAttr
node in DOMAttrModified events, and of theCharacterData
node in DOMCharacterDataModified events.java.lang.String
getPrevValue()
prevValue
indicates the previous value of theAttr
node in DOMAttrModified events, and of theCharacterData
node in DOMCharacterDataModified events.org.w3c.dom.Node
getRelatedNode()
relatedNode
is used to identify a secondary node related to a mutation event.void
initMutationEvent(java.lang.String typeArg, boolean canBubbleArg, boolean cancelableArg, org.w3c.dom.Node relatedNodeArg, java.lang.String prevValueArg, java.lang.String newValueArg, java.lang.String attrNameArg, short attrChangeArg)
TheinitMutationEvent
method is used to initialize the value of aMutationEvent
object and has the same behavior asEvent.initEvent()
.void
initMutationEventNS(java.lang.String namespaceURI, java.lang.String typeArg, boolean canBubbleArg, boolean cancelableArg, org.w3c.dom.Node relatedNodeArg, java.lang.String prevValueArg, java.lang.String newValueArg, java.lang.String attrNameArg, short attrChangeArg)
TheinitMutationEventNS
method is used to initialize the value of aMutationEvent
object and has the same behavior asEvent.initEventNS()
.-
Methods inherited from interface org.w3c.dom.events.Event
getBubbles, getCancelable, getCurrentTarget, getDefaultPrevented, getEventPhase, getNamespaceURI, getTarget, getTimeStamp, getType, initEvent, initEventNS, preventDefault, stopImmediatePropagation, stopPropagation
-
-
-
-
Field Detail
-
MODIFICATION
static final short MODIFICATION
TheAttr
was modified in place.- See Also:
- Constant Field Values
-
ADDITION
static final short ADDITION
TheAttr
was just added.- See Also:
- Constant Field Values
-
REMOVAL
static final short REMOVAL
TheAttr
was just removed.- See Also:
- Constant Field Values
-
-
Method Detail
-
getRelatedNode
org.w3c.dom.Node getRelatedNode()
relatedNode
is used to identify a secondary node related to a mutation event. For example, if a mutation event is dispatched to a node indicating that its parent has changed, therelatedNode
is the changed parent. If an event is instead dispatched to a subtree indicating a node was changed within it, therelatedNode
is the changed node. In the case of the DOMAttrModified event it indicates theAttr
node which was modified, added, or removed.
-
getPrevValue
java.lang.String getPrevValue()
prevValue
indicates the previous value of theAttr
node in DOMAttrModified events, and of theCharacterData
node in DOMCharacterDataModified events.
-
getNewValue
java.lang.String getNewValue()
newValue
indicates the new value of theAttr
node in DOMAttrModified events, and of theCharacterData
node in DOMCharacterDataModified events.
-
getAttrName
java.lang.String getAttrName()
attrName
indicates the name of the changedAttr
node in a DOMAttrModified event.
-
getAttrChange
short getAttrChange()
attrChange
indicates the type of change which triggered the DOMAttrModified event. The values can beMODIFICATION
,ADDITION
, orREMOVAL
.
-
initMutationEvent
void initMutationEvent(java.lang.String typeArg, boolean canBubbleArg, boolean cancelableArg, org.w3c.dom.Node relatedNodeArg, java.lang.String prevValueArg, java.lang.String newValueArg, java.lang.String attrNameArg, short attrChangeArg)
TheinitMutationEvent
method is used to initialize the value of aMutationEvent
object and has the same behavior asEvent.initEvent()
.- Parameters:
typeArg
- Refer to theEvent.initEvent()
method for a description of this parameter.canBubbleArg
- Refer to theEvent.initEvent()
method for a description of this parameter.cancelableArg
- Refer to theEvent.initEvent()
method for a description of this parameter.relatedNodeArg
- SpecifiesMutationEvent.relatedNode
.prevValueArg
- SpecifiesMutationEvent.prevValue
. This value may be null.newValueArg
- SpecifiesMutationEvent.newValue
. This value may be null.attrNameArg
- SpecifiesMutationEvent.attrname
. This value may be null.attrChangeArg
- SpecifiesMutationEvent.attrChange
. This value may be null.
-
initMutationEventNS
void initMutationEventNS(java.lang.String namespaceURI, java.lang.String typeArg, boolean canBubbleArg, boolean cancelableArg, org.w3c.dom.Node relatedNodeArg, java.lang.String prevValueArg, java.lang.String newValueArg, java.lang.String attrNameArg, short attrChangeArg)
TheinitMutationEventNS
method is used to initialize the value of aMutationEvent
object and has the same behavior asEvent.initEventNS()
.- Parameters:
namespaceURI
- Refer to theEvent.initEventNS()
method for a description of this parameter.typeArg
- Refer to theEvent.initEventNS()
method for a description of this parameter.canBubbleArg
- Refer to theEvent.initEventNS()
method for a description of this parameter.cancelableArg
- Refer to theEvent.initEventNS()
method for a description of this parameter.relatedNodeArg
- Refer to theMutationEvent.initMutationEvent()
method for a description of this parameter.prevValueArg
- Refer to theMutationEvent.initMutationEvent()
method for a description of this parameter.newValueArg
- Refer to theMutationEvent.initMutationEvent()
method for a description of this parameter.attrNameArg
- Refer to theMutationEvent.initMutationEvent()
method for a description of this parameter.attrChangeArg
- Refer to theMutationEvent.initMutationEvent()
method for a description of this parameter.- Since:
- DOM Level 3
-
-