PropertyChangeEvent.java revision 2362
3261N/A * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 2246N/A * A "PropertyChange" event gets delivered whenever a bean changes a "bound" 2246N/A * or "constrained" property. A PropertyChangeEvent object is sent as an 2246N/A * argument to the PropertyChangeListener and VetoableChangeListener methods. 2246N/A * Normally PropertyChangeEvents are accompanied by the name and the old 2246N/A * and new value of the changed property. If the new value is a primitive 0N/A * type (such as int or boolean) it must be wrapped as the 0N/A * corresponding java.lang.* Object type (such as Integer or Boolean). 0N/A * Null values may be provided for the old and the new values if their 0N/A * true values are not known. 2246N/A * An event source may send a null object as the name to indicate that an 0N/A * arbitrary set of if its properties have changed. In this case the 0N/A * old and new values should also be null. * Constructs a new <code>PropertyChangeEvent</code>. * @param source The bean that fired the event. * @param propertyName The programmatic name of the property * @param oldValue The old value of the property. * @param newValue The new value of the property. * Gets the programmatic name of the property that was changed. * @return The programmatic name of the property that was changed. * May be null if multiple properties have changed. * Gets the new value for the property, expressed as an Object. * @return The new value for the property, expressed as an Object. * May be null if multiple properties have changed. * Gets the old value for the property, expressed as an Object. * @return The old value for the property, expressed as an Object. * May be null if multiple properties have changed. * Sets the propagationId object for the event. * @param propagationId The propagationId object for the event. * The "propagationId" field is reserved for future use. In Beans 1.0 * the sole requirement is that if a listener catches a PropertyChangeEvent * and then fires a PropertyChangeEvent of its own, then it should * make sure that it propagates the propagationId field from its * incoming event to its outgoing event. * name of the property that changed. May be null, if not known. * New value for property. May be null if not known. * Previous value for property. May be null if not known. * Propagation ID. May be null. * Returns a string representation of the object. * @return a string representation of the object