1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package jakarta.faces.event;
20
21 import jakarta.faces.component.UIComponent;
22 import jakarta.faces.context.FacesContext;
23
24
25
26
27 public class ValueChangeEvent extends FacesEvent
28 {
29 private static final long serialVersionUID = -2490528664421353795L;
30
31 private Object _oldValue;
32 private Object _newValue;
33
34 public ValueChangeEvent(FacesContext facesContext, UIComponent uiComponent, Object oldValue, Object newValue)
35 {
36 super(facesContext, uiComponent);
37 if (uiComponent == null)
38 {
39 throw new IllegalArgumentException("uiComponent");
40 }
41 _oldValue = oldValue;
42 _newValue = newValue;
43 }
44
45
46 public ValueChangeEvent(UIComponent uiComponent, Object oldValue, Object newValue)
47 {
48 super(uiComponent);
49 if (uiComponent == null)
50 {
51 throw new IllegalArgumentException("uiComponent");
52 }
53 _oldValue = oldValue;
54 _newValue = newValue;
55 }
56
57
58 public Object getNewValue()
59 {
60 return _newValue;
61 }
62
63 public Object getOldValue()
64 {
65 return _oldValue;
66 }
67
68 @Override
69 public boolean isAppropriateListener(FacesListener facesListeners)
70 {
71 return facesListeners instanceof ValueChangeListener;
72 }
73
74 @Override
75 public void processListener(FacesListener facesListeners)
76 {
77 ((ValueChangeListener)facesListeners).processValueChange(this);
78 }
79 }