Path: blob/aarch64-shenandoah-jdk8u272-b10/jaxp/src/org/w3c/dom/events/MutationEvent.java
86410 views
/*1* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.2*3* This code is free software; you can redistribute it and/or modify it4* under the terms of the GNU General Public License version 2 only, as5* published by the Free Software Foundation. Oracle designates this6* particular file as subject to the "Classpath" exception as provided7* by Oracle in the LICENSE file that accompanied this code.8*9* This code is distributed in the hope that it will be useful, but WITHOUT10* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12* version 2 for more details (a copy is included in the LICENSE file that13* accompanied this code).14*15* You should have received a copy of the GNU General Public License version16* 2 along with this work; if not, write to the Free Software Foundation,17* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18*19* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20* or visit www.oracle.com if you need additional information or have any21* questions.22*/2324/*25* This file is available under and governed by the GNU General Public26* License version 2 only, as published by the Free Software Foundation.27* However, the following notice accompanied the original version of this28* file and, per its terms, should not be removed:29*30* Copyright (c) 2000 World Wide Web Consortium,31* (Massachusetts Institute of Technology, Institut National de32* Recherche en Informatique et en Automatique, Keio University). All33* Rights Reserved. This program is distributed under the W3C's Software34* Intellectual Property License. This program is distributed in the35* hope that it will be useful, but WITHOUT ANY WARRANTY; without even36* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR37* PURPOSE.38* See W3C License http://www.w3.org/Consortium/Legal/ for more details.39*/4041package org.w3c.dom.events;4243import org.w3c.dom.Node;4445/**46* The <code>MutationEvent</code> interface provides specific contextual47* information associated with Mutation events.48* <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113'>Document Object Model (DOM) Level 2 Events Specification</a>.49* @since DOM Level 250*/51public interface MutationEvent extends Event {52// attrChangeType53/**54* The <code>Attr</code> was modified in place.55*/56public static final short MODIFICATION = 1;57/**58* The <code>Attr</code> was just added.59*/60public static final short ADDITION = 2;61/**62* The <code>Attr</code> was just removed.63*/64public static final short REMOVAL = 3;6566/**67* <code>relatedNode</code> is used to identify a secondary node related68* to a mutation event. For example, if a mutation event is dispatched69* to a node indicating that its parent has changed, the70* <code>relatedNode</code> is the changed parent. If an event is71* instead dispatched to a subtree indicating a node was changed within72* it, the <code>relatedNode</code> is the changed node. In the case of73* the DOMAttrModified event it indicates the <code>Attr</code> node74* which was modified, added, or removed.75*/76public Node getRelatedNode();7778/**79* <code>prevValue</code> indicates the previous value of the80* <code>Attr</code> node in DOMAttrModified events, and of the81* <code>CharacterData</code> node in DOMCharacterDataModified events.82*/83public String getPrevValue();8485/**86* <code>newValue</code> indicates the new value of the <code>Attr</code>87* node in DOMAttrModified events, and of the <code>CharacterData</code>88* node in DOMCharacterDataModified events.89*/90public String getNewValue();9192/**93* <code>attrName</code> indicates the name of the changed94* <code>Attr</code> node in a DOMAttrModified event.95*/96public String getAttrName();9798/**99* <code>attrChange</code> indicates the type of change which triggered100* the DOMAttrModified event. The values can be <code>MODIFICATION</code>101* , <code>ADDITION</code>, or <code>REMOVAL</code>.102*/103public short getAttrChange();104105/**106* The <code>initMutationEvent</code> method is used to initialize the107* value of a <code>MutationEvent</code> created through the108* <code>DocumentEvent</code> interface. This method may only be called109* before the <code>MutationEvent</code> has been dispatched via the110* <code>dispatchEvent</code> method, though it may be called multiple111* times during that phase if necessary. If called multiple times, the112* final invocation takes precedence.113* @param typeArg Specifies the event type.114* @param canBubbleArg Specifies whether or not the event can bubble.115* @param cancelableArg Specifies whether or not the event's default116* action can be prevented.117* @param relatedNodeArg Specifies the <code>Event</code>'s related Node.118* @param prevValueArg Specifies the <code>Event</code>'s119* <code>prevValue</code> attribute. This value may be null.120* @param newValueArg Specifies the <code>Event</code>'s121* <code>newValue</code> attribute. This value may be null.122* @param attrNameArg Specifies the <code>Event</code>'s123* <code>attrName</code> attribute. This value may be null.124* @param attrChangeArg Specifies the <code>Event</code>'s125* <code>attrChange</code> attribute126*/127public void initMutationEvent(String typeArg,128boolean canBubbleArg,129boolean cancelableArg,130Node relatedNodeArg,131String prevValueArg,132String newValueArg,133String attrNameArg,134short attrChangeArg);135136}137138139