01: /*
02: * MyGWT Widget Library
03: * Copyright(c) 2007, MyGWT.
04: * licensing@mygwt.net
05: *
06: * http://mygwt.net/license
07: */
08: package net.mygwt.ui.client.data;
09:
10: /**
11: * Describes a field in a <code>Model</code>. Used when mapping raw data to a
12: * model's properties.
13: */
14: public class DataField {
15:
16: /**
17: * Field type constant for dates.
18: */
19: public static final String DATE_TYPE = "date";
20:
21: /**
22: * The name of the field.
23: */
24: public String name;
25:
26: /**
27: * An optional field used when the property name of the model is different
28: * than the property name of the raw data.
29: */
30: public String map;
31:
32: /**
33: * The data type of the field.
34: */
35: public String type;
36:
37: /**
38: * Format is used when converting raw data to object instances.
39: */
40: public String format;
41:
42: /**
43: * Creates a new field.
44: *
45: * @param name the name
46: */
47: public DataField(String name) {
48: this .name = name;
49: }
50:
51: /**
52: * Creates a new field instance.
53: *
54: * @param name the field name
55: * @param map the map name
56: */
57: public DataField(String name, String map) {
58: this.name = name;
59: this.map = map;
60: }
61:
62: }
|