KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > inversoft > beans > ConversionEvent


1 /*
2  * Copyright (c) 2003, Inversoft
3  *
4  * This software is distribuable under the GNU Lesser General Public License.
5  * For more information visit gnu.org.
6  */

7 package com.inversoft.beans;
8
9
10 /**
11  * <p>
12  * This class is the event that is generated when a bean
13  * property is being set AND the value is being automatically
14  * converted.
15  * </p>
16  *
17  * <p>
18  * The {@link BaseEvent#getOldValue() getOldValue} and {@link
19  * BaseEvent#getNewValue() getNewValue} methods in {@link
20  * BaseEvent BaseEvent} class are different for this event
21  * and are described
22  * here:
23  * </p>
24  *
25  * <p>
26  * <tt>getOldValue</tt> - Returns the value of the parameter
27  * that is being converted BEFORE it is converted. This value
28  * will remain the same for the pre, post and failed conversion
29  * events.
30  * </p>
31  *
32  * <p>
33  * <tt>getNewValue</tt> - Returns the value of the parameter
34  * that is being converted AFTER it is converted. For
35  * pre-conversion events this will be equal to the value of
36  * getOldValue because the conversion has not yet taken place.
37  * For post-conversion events, this will have the value of the
38  * parameter AFTER it has been converted. For failed-conversion
39  * events, this will be equal to the value of getOldValue
40  * because the conversion failed before completing.
41  * </p>
42  *
43  * <p>
44  * It is also important to remember that if a conversion
45  * fails, only the pre-conversion and failed-conversion events
46  * will occur. If the conversion succeeded, then only the
47  * pre-conversion and post-conversion events will occur.
48  * </p>
49  *
50  * @author Brian Pontarelli
51  */

52 public class ConversionEvent extends BaseEvent {
53
54     /**
55      * Creates a new conversion event using the values given
56      */

57     public ConversionEvent(BaseBeanProperty property, Object JavaDoc oldValue, Object JavaDoc newValue,
58             Object JavaDoc bean) {
59         super(property, oldValue, newValue, bean);
60     }
61 }
62
Popular Tags