01: package simpleorm.properties;
02:
03: /**
04: * Convenience, ephemeral objects for creating properties with values.
05: * Note that PropertyHash contains the values directly, not these
06: * objects. They are simply picked apart and the key and values are
07: * added to the map separately.<p>
08: *
09: * ## The only reason that we need these is that S*Meta records require an array
10: * of propertyValues as a parameter. The alternative would be something like <p>
11: *
12: * SField foo = new SField(...).MYPROP(myval).MYPROP2(myval2)...
13: *
14: * Where MYPROP just returns the SPropertyMap that SField is.
15: * However, this does not work because of initialization code in the SField
16: * constructor, which should probably be moved.
17: */
18:
19: public class SPropertyValue {
20: SProperty property = null;
21: Object value = null;
22:
23: public SPropertyValue(SProperty property, Object value) {
24: this .property = property;
25: this .value = value;
26: }
27:
28: /** Default value is Boolean.TRUE */
29: public SPropertyValue(SProperty property) {
30: this.property = property;
31: this.value = Boolean.TRUE;
32: }
33: }
|