1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package net.wotonomy.control;
20
21 import net.wotonomy.foundation.NSKeyValueCoding;
22
23 /***
24 * EOKeyValueCoding defines an interface for classes that
25 * need to have more control over the wotonomy's property
26 * introspection facilities. <br><br>
27 *
28 * On an object that implements this interface, wotonomy
29 * will call these methods, and otherwise use the static
30 * methods on EOKeyValueCodingSupport. <br><br>
31 *
32 * EOKeyValueCodingSupport implements the default behaviors
33 * for each of these methods, so classes implementing this
34 * interface can call those methods to acheive the same
35 * behavior. <br><br>
36 *
37 * valueForKey and takeValueForKey are called in response
38 * to user actions, like viewing an object or updating its
39 * value in a user interface. These should call the public
40 * getter and setter methods on the object itself and the
41 * operations should be subject to validation. <br><br>
42 *
43 * storedValueForKey and takeStoredValueForKey are called
44 * in response to wotonomy actions, like snapshotting,
45 * faulting, commits, and reverts. These operations should
46 * bypass the public methods and directly modify the internal
47 * state of the object without validation.
48 *
49 * @author michael@mpowers.net
50 * @author $Author: cgruber $
51 * @version $Revision: 893 $
52 */
53 public interface EOKeyValueCoding extends NSKeyValueCoding
54 {
55 /***
56 * Returns the value for the specified property.
57 * If the property does not exist, this method should
58 * call handleQueryWithUnboundKey.
59 */
60 Object valueForKey( String aKey );
61
62 /***
63 * Sets the property to the specified value.
64 * If the property does not exist, this method should
65 * call handleTakeValueForUnboundKey.
66 * If the property is of a type that cannot allow
67 * null (e.g. primitive types) and aValue is null,
68 * this method should call unableToSetNullForKey.
69 */
70 void takeValueForKey( Object aValue, String aKey );
71
72 /***
73 * Returns the value for the private field that
74 * corresponds to the specified property.
75 */
76 Object storedValueForKey( String aKey );
77
78 /***
79 * Sets the the private field that corresponds to the
80 * specified property to the specified value.
81 */
82 void takeStoredValueForKey( Object aValue, String aKey );
83
84 /***
85 * Called by valueForKey when the specified key is
86 * not found on this object. Implementing classes
87 * should handle the specified value or otherwise
88 * throw an exception.
89 */
90 Object handleQueryWithUnboundKey( String aKey );
91
92 /***
93 * Called by takeValueForKey when the specified key
94 * is not found on this object. Implementing classes
95 * should handle the specified value or otherwise
96 * throw an exception.
97 */
98 void handleTakeValueForUnboundKey( Object aValue, String aKey );
99
100 /***
101 * Called by takeValueForKey when the type of the
102 * specified key is not allowed to be null, as is
103 * the case with primitive types. Implementing
104 * classes should handle this case appropriately
105 * or otherwise throw an exception.
106 */
107 void unableToSetNullForKey( String aKey );
108
109 }
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129