-
- All Superinterfaces:
Event
public interface MutationEvent extends Event
TheMutationEventinterface provides specific contextual information associated with Mutation events.See also the Document Object Model (DOM) Level 2 Events Specification.
- Since:
- 1.5, DOM Level 2
-
-
Field Summary
Fields Modifier and Type Field Description static shortADDITIONTheAttrwas just added.static shortMODIFICATIONTheAttrwas modified in place.static shortREMOVALTheAttrwas just removed.-
Fields declared in 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 shortgetAttrChange()attrChangeindicates the type of change which triggered the DOMAttrModified event.StringgetAttrName()attrNameindicates the name of the changedAttrnode in a DOMAttrModified event.StringgetNewValue()newValueindicates the new value of theAttrnode in DOMAttrModified events, and of theCharacterDatanode in DOMCharacterDataModified events.StringgetPrevValue()prevValueindicates the previous value of theAttrnode in DOMAttrModified events, and of theCharacterDatanode in DOMCharacterDataModified events.NodegetRelatedNode()relatedNodeis used to identify a secondary node related to a mutation event.voidinitMutationEvent(String typeArg, boolean canBubbleArg, boolean cancelableArg, Node relatedNodeArg, String prevValueArg, String newValueArg, String attrNameArg, short attrChangeArg)TheinitMutationEventmethod is used to initialize the value of aMutationEventcreated through theDocumentEventinterface.-
Methods declared in interface org.w3c.dom.events.Event
getBubbles, getCancelable, getCurrentTarget, getEventPhase, getTarget, getTimeStamp, getType, initEvent, preventDefault, stopPropagation
-
-
-
-
Field Detail
-
MODIFICATION
static final short MODIFICATION
TheAttrwas modified in place.- See Also:
- Constant Field Values
-
ADDITION
static final short ADDITION
TheAttrwas just added.- See Also:
- Constant Field Values
-
REMOVAL
static final short REMOVAL
TheAttrwas just removed.- See Also:
- Constant Field Values
-
-
Method Detail
-
getRelatedNode
Node getRelatedNode()
relatedNodeis 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, therelatedNodeis the changed parent. If an event is instead dispatched to a subtree indicating a node was changed within it, therelatedNodeis the changed node. In the case of the DOMAttrModified event it indicates theAttrnode which was modified, added, or removed.
-
getPrevValue
String getPrevValue()
prevValueindicates the previous value of theAttrnode in DOMAttrModified events, and of theCharacterDatanode in DOMCharacterDataModified events.
-
getNewValue
String getNewValue()
newValueindicates the new value of theAttrnode in DOMAttrModified events, and of theCharacterDatanode in DOMCharacterDataModified events.
-
getAttrName
String getAttrName()
attrNameindicates the name of the changedAttrnode in a DOMAttrModified event.
-
getAttrChange
short getAttrChange()
attrChangeindicates the type of change which triggered the DOMAttrModified event. The values can beMODIFICATION,ADDITION, orREMOVAL.
-
initMutationEvent
void initMutationEvent(String typeArg, boolean canBubbleArg, boolean cancelableArg, Node relatedNodeArg, String prevValueArg, String newValueArg, String attrNameArg, short attrChangeArg)
TheinitMutationEventmethod is used to initialize the value of aMutationEventcreated through theDocumentEventinterface. This method may only be called before theMutationEventhas been dispatched via thedispatchEventmethod, though it may be called multiple times during that phase if necessary. If called multiple times, the final invocation takes precedence.- Parameters:
typeArg- Specifies the event type.canBubbleArg- Specifies whether or not the event can bubble.cancelableArg- Specifies whether or not the event's default action can be prevented.relatedNodeArg- Specifies theEvent's related Node.prevValueArg- Specifies theEvent'sprevValueattribute. This value may be null.newValueArg- Specifies theEvent'snewValueattribute. This value may be null.attrNameArg- Specifies theEvent'sattrNameattribute. This value may be null.attrChangeArg- Specifies theEvent'sattrChangeattribute
-
-