1
2
3
4 package org.astrogrid.dataservice.metadata.queryable;
5
6 /***
7 * Wrapper for metadata about a search field (eg column, or XML leaf) -
8 * its units, ucds, dimensions, related
9 * error column, etc
10 */
11 import java.util.Hashtable;
12 import java.util.Vector;
13 import org.astrogrid.units.Units;
14
15 public class SearchField {
16
17 private String id;
18 private String name;
19 private String groupName;
20 private String description;
21
22 /*** interoperating type - presented to the outside world */
23 private String publicType;
24 /*** Java type to hold the values */
25 private Class javaType;
26 /*** The type as given by the packing store - eg the SQL type */
27 private String backType;
28 private String errorField;
29 private Units units;
30
31
32 private Hashtable ucds = new Hashtable();
33
34
35 private Vector links = new Vector();
36
37 public void setBackType(String givenType) { this.backType = givenType; }
38
39 public String getBackType() { return backType; }
40
41 public void setDescription(String description)
42 {
43 this.description = description;
44 }
45
46 public String getDescription() { return description; }
47
48 public void setGroup(String group) { this.groupName = group; }
49
50 public String getGroup() { return groupName; }
51
52 public void setJavaType(Class javaType) { this.javaType = javaType; }
53
54 public Class getJavaType() { return javaType; }
55
56 public void setUnits(String units) {
57 this.units = new Units(units);
58 }
59
60 public void setUnits(Units units) {
61 this.units = units;
62 }
63
64 public Units getUnits() {
65 return units;
66 }
67
68 public void setErrorField(String errorColId) {
69 this.errorField = errorColId;
70 }
71
72 public String getErrorField() {
73 return errorField;
74 }
75
76 /***
77 * Sets Ucd with the given version
78 */
79 public void setUcd(String ucd, String version) {
80 if (ucd == null) {
81 ucds.remove(version);
82 }
83 else {
84 ucds.put(version, ucd);
85 }
86 }
87
88 /***
89 * Returns Ucd of the given version
90 */
91 public String getUcd(String version) {
92 return (String) ucds.get(version);
93 }
94
95 public void setPublicType(String datatype) { this.publicType = datatype; }
96
97 public String getPublicType() { return publicType; }
98
99 public void setId(String id) { this.id = id; }
100
101 public String getId() { return id; }
102
103 public void setName(String name) { this.name = name; }
104
105 public String getName() { return name; }
106
107 public String[] getLinks() {
108 return (String[]) links.toArray(new String[] {} );
109 }
110
111 }
112