Revision 24742 trunk/extensions/extMetadata/src/org/gvsig/metadata/extended/registry/objects/MDElementDefinition.java
MDElementDefinition.java | ||
---|---|---|
32 | 32 |
|
33 | 33 |
package org.gvsig.metadata.extended.registry.objects; |
34 | 34 |
|
35 |
import java.util.HashMap; |
|
36 |
import java.util.Map; |
|
37 | 35 |
|
38 | 36 |
|
39 | 37 |
public class MDElementDefinition { |
40 | 38 |
|
39 |
private String id; |
|
41 | 40 |
private String name; |
42 |
private MDType type;
|
|
41 |
private String type;
|
|
43 | 42 |
private Boolean required; |
44 | 43 |
private Object defaultValue; |
45 | 44 |
private String description; |
46 |
private Map<String, Object> synonyms = new HashMap<String, Object>(); |
|
47 |
|
|
48 |
public MDElementDefinition() {} |
|
49 |
|
|
50 |
public MDElementDefinition(String name, MDType type, Boolean required, Object defaultValue, String description) { |
|
45 |
private MDDefinition father; |
|
46 |
private boolean persisted, changed; |
|
47 |
|
|
48 |
// public MDElementDefinition() { |
|
49 |
// this.id = ""; |
|
50 |
// this.name = ""; |
|
51 |
// this.type = null; |
|
52 |
// this.required = false; |
|
53 |
// this.defaultValue = null; |
|
54 |
// this.description = ""; |
|
55 |
// this.persisted = false; |
|
56 |
// this.changed = false; |
|
57 |
// } |
|
58 |
// |
|
59 |
public MDElementDefinition(String name, String type, Boolean required, Object defaultValue, String description) { |
|
60 |
this.id = ""; |
|
51 | 61 |
this.name = name; |
52 | 62 |
this.type = type; |
53 | 63 |
this.required = required; |
54 | 64 |
this.defaultValue = defaultValue; |
55 | 65 |
this.description = description; |
66 |
this.persisted = false; |
|
67 |
this.changed = true; |
|
56 | 68 |
} |
57 | 69 |
|
70 |
public MDElementDefinition(String id, String name, String description, Boolean required, MDDefinition father, String type, String defaultValue) { |
|
71 |
this.id = id; |
|
72 |
this.name = name; |
|
73 |
this.description = description; |
|
74 |
this.required = required; |
|
75 |
this.father = father; |
|
76 |
this.type = type; |
|
77 |
this.defaultValue = defaultValue; |
|
78 |
this.persisted = false; |
|
79 |
this.changed = true; |
|
80 |
} |
|
81 |
|
|
58 | 82 |
public String getName() { |
59 | 83 |
return this.name; |
60 | 84 |
} |
61 | 85 |
|
62 |
public MDType getType() {
|
|
86 |
public String getType() {
|
|
63 | 87 |
return this.type; |
64 | 88 |
} |
65 | 89 |
|
... | ... | |
75 | 99 |
return this.description; |
76 | 100 |
} |
77 | 101 |
|
78 |
public Object getSynonym(String name) { |
|
79 |
return synonyms.get(name); |
|
80 |
} |
|
81 |
|
|
82 | 102 |
public void setName(String name) { |
83 | 103 |
this.name = name; |
104 |
this.changed = true; |
|
84 | 105 |
} |
85 | 106 |
|
86 |
public void setType(MDType type) {
|
|
107 |
public void setType(String type) {
|
|
87 | 108 |
this.type = type; |
109 |
this.changed = true; |
|
88 | 110 |
} |
89 | 111 |
|
90 | 112 |
public void setRequired(Boolean required) { |
91 | 113 |
this.required = required; |
114 |
this.changed = true; |
|
92 | 115 |
} |
93 | 116 |
|
94 | 117 |
public void setDefaultValue(Object defaultValue) { |
95 | 118 |
this.defaultValue = defaultValue; |
119 |
this.changed = true; |
|
96 | 120 |
} |
97 | 121 |
|
98 | 122 |
public void setDescription(String description) { |
99 | 123 |
this.description = description; |
124 |
this.changed = true; |
|
100 | 125 |
} |
126 |
|
|
127 |
/** |
|
128 |
* @return the changed |
|
129 |
*/ |
|
130 |
public boolean isChanged() { |
|
131 |
return changed; |
|
132 |
} |
|
133 |
|
|
134 |
/** |
|
135 |
* @param changed the changed to set |
|
136 |
*/ |
|
137 |
public void setChanged(boolean changed) { |
|
138 |
this.changed = changed; |
|
139 |
} |
|
140 |
|
|
141 |
/** |
|
142 |
* @return the id |
|
143 |
*/ |
|
144 |
public String getId() { |
|
145 |
return id; |
|
146 |
} |
|
147 |
|
|
148 |
/** |
|
149 |
* @param id the id to set |
|
150 |
*/ |
|
151 |
protected void setId(String id) { |
|
152 |
this.id = id; |
|
153 |
} |
|
154 |
|
|
155 |
/** |
|
156 |
* @return the persisted |
|
157 |
*/ |
|
158 |
public boolean isPersisted() { |
|
159 |
return persisted; |
|
160 |
} |
|
161 |
|
|
162 |
/** |
|
163 |
* @param persisted the persisted to set |
|
164 |
*/ |
|
165 |
public void setPersisted(boolean persisted) { |
|
166 |
this.persisted = persisted; |
|
167 |
} |
|
168 |
|
|
169 |
/** |
|
170 |
* @return the required |
|
171 |
*/ |
|
172 |
public Boolean getRequired() { |
|
173 |
return required; |
|
174 |
} |
|
175 |
|
|
176 |
/** |
|
177 |
* @return the father |
|
178 |
*/ |
|
179 |
public MDDefinition getFather() { |
|
180 |
return father; |
|
181 |
} |
|
182 |
|
|
183 |
/** |
|
184 |
* @param father the father to set |
|
185 |
*/ |
|
186 |
public void setFather(MDDefinition father) { |
|
187 |
this.father = father; |
|
188 |
this.changed = true; |
|
189 |
} |
|
101 | 190 |
|
102 |
public void setSynonym(String name, Object synonym) { |
|
103 |
synonyms.put(name, synonym); |
|
104 |
} |
|
105 | 191 |
} |
Also available in: Unified diff