- All Superinterfaces:
- Event
public interface MutationEvent extends Event
The 
MutationEvent interface 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 SummaryFields Modifier and Type Field Description static shortADDITIONTheAttrwas just added.static shortMODIFICATIONTheAttrwas modified in place.static shortREMOVALTheAttrwas just removed.
- 
Method SummaryModifier 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.EventgetBubbles, getCancelable, getCurrentTarget, getEventPhase, getTarget, getTimeStamp, getType, initEvent, preventDefault, stopPropagation
- 
Field Details- 
MODIFICATIONstatic final short MODIFICATIONTheAttrwas modified in place.- See Also:
- Constant Field Values
 
- 
ADDITIONstatic final short ADDITIONTheAttrwas just added.- See Also:
- Constant Field Values
 
- 
REMOVALstatic final short REMOVALTheAttrwas just removed.- See Also:
- Constant Field Values
 
 
- 
- 
Method Details- 
getRelatedNodeNode 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.
- 
getPrevValueString getPrevValue()prevValueindicates the previous value of theAttrnode in DOMAttrModified events, and of theCharacterDatanode in DOMCharacterDataModified events.
- 
getNewValueString getNewValue()newValueindicates the new value of theAttrnode in DOMAttrModified events, and of theCharacterDatanode in DOMCharacterDataModified events.
- 
getAttrNameString getAttrName()attrNameindicates the name of the changedAttrnode in a DOMAttrModified event.
- 
getAttrChangeshort getAttrChange()attrChangeindicates the type of change which triggered the DOMAttrModified event. The values can beMODIFICATION,ADDITION, orREMOVAL.
- 
initMutationEventvoid 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 the- Event's related Node.
- prevValueArg- Specifies the- Event's- prevValueattribute. This value may be null.
- newValueArg- Specifies the- Event's- newValueattribute. This value may be null.
- attrNameArg- Specifies the- Event's- attrNameattribute. This value may be null.
- attrChangeArg- Specifies the- Event's- attrChangeattribute
 
 
-