1 package com.bonevich.erj.mof.impl.model;
2 import java.lang.reflect.Method;
3 import java.util.*;
4
5 public class ErjSchemaImpl extends com.bonevich.erj.mof.impl.model.ErjModelElementImpl implements com.bonevich.erj.mof.interfaces.model.Schema
6 {
7 public ErjSchemaImpl(ru.novosoft.mdf.impl.MDFOutermostPackageImpl r)
8 {
9 super(r);
10 }
11 protected void mdfReplaceData( ru.novosoft.mdf.ext.MDFObject srcarg, Class base)
12 {
13 super.mdfReplaceData(srcarg, base);
14 if (srcarg instanceof com.bonevich.erj.mof.interfaces.model.Schema && com.bonevich.erj.mof.interfaces.model.Schema.class.isAssignableFrom(base))
15 {
16 com.bonevich.erj.mof.impl.model.ErjSchemaImpl src = (com.bonevich.erj.mof.impl.model.ErjSchemaImpl)srcarg;
17 {
18 List c = new ArrayList( src.getDomains104() );
19 src.getDomains104().clear();
20 collectionSetting(_domains104, c);
21 }
22 {
23 List c = new ArrayList( src.getRelations105() );
24 src.getRelations105().clear();
25 collectionSetting(_relations105, c);
26 }
27 }
28 }
29 // implementing: com.bonevich.erj.mof.interfaces.model.Schema
30 public java.util.List getRelations()
31 {
32 return getRelations105();
33 }
34 public java.util.List getDomains()
35 {
36 return getDomains104();
37 }
38 private java.util.List _domains104 = new ru.novosoft.mdf.impl.MDFFeatureListImpl( this, 102, true);
39 public java.util.List getDomains104()
40 {
41 checkExists();
42 return _domains104;
43 }
44 private java.util.List _relations105 = new ru.novosoft.mdf.impl.MDFFeatureListImpl( this, 103, true);
45 public java.util.List getRelations105()
46 {
47 checkExists();
48 return _relations105;
49 }
50 public Set mdfGetElementContents()
51 {
52 Set ret = super.mdfGetElementContents();
53 ret.addAll(getDomains104());
54 ret.addAll(getRelations105());
55 ret.remove( null );
56 return ret;
57 }
58 public Class mdfGetInterfaceClass()
59 {
60 return com.bonevich.erj.mof.interfaces.model.Schema.class;
61 }
62 protected void cleanup()
63 {
64 _domains104.clear();
65 _relations105.clear();
66 super.cleanup();
67 }
68 public void canBeElementAdded( ru.novosoft.mdf.impl.MDFListImpl list, int collectionId, Object newElement )
69 {
70 switch( collectionId )
71 {
72
73 case 102:
74 if (newElement == null)
75 {
76 throw new NullPointerException();
77 }
78 if (mdfGetOutermostPackage() != ((ru.novosoft.mdf.impl.MDFBaseObjectImpl)newElement).mdfGetOutermostPackage())
79 {
80 throw new javax.jmi.reflect.ClosureViolationException( null, null );
81 }
82 if (list.contains( newElement ))
83 {
84 throw new javax.jmi.reflect.DuplicateException( null, null);
85 }
86 if ((( ru.novosoft.mdf.impl.MDFObjectImpl) newElement ).mdfGetImmediateCompositeAttribute() != null && !"domains".equals( (( ru.novosoft.mdf.impl.MDFObjectImpl) newElement ).mdfGetImmediateCompositeAttribute() ))
87 {
88 throw new javax.jmi.reflect.ClosureViolationException( null, null );
89 }
90 mdfCheckNotOwned( (ru.novosoft.mdf.impl.MDFObjectImpl) newElement );
91 if ( ! (newElement instanceof com.bonevich.erj.mof.interfaces.model.Domain) )
92 {
93 throw new javax.jmi.reflect.TypeMismatchException( null, null, null );
94 }
95 break;
96
97 case 103:
98 if (newElement == null)
99 {
100 throw new NullPointerException();
101 }
102 if (mdfGetOutermostPackage() != ((ru.novosoft.mdf.impl.MDFBaseObjectImpl)newElement).mdfGetOutermostPackage())
103 {
104 throw new javax.jmi.reflect.ClosureViolationException( null, null );
105 }
106 if (list.contains( newElement ))
107 {
108 throw new javax.jmi.reflect.DuplicateException( null, null);
109 }
110 if ((( ru.novosoft.mdf.impl.MDFObjectImpl) newElement ).mdfGetImmediateCompositeAttribute() != null && !"relations".equals( (( ru.novosoft.mdf.impl.MDFObjectImpl) newElement ).mdfGetImmediateCompositeAttribute() ))
111 {
112 throw new javax.jmi.reflect.ClosureViolationException( null, null );
113 }
114 mdfCheckNotOwned( (ru.novosoft.mdf.impl.MDFObjectImpl) newElement );
115 if ( ! (newElement instanceof com.bonevich.erj.mof.interfaces.model.Relation) )
116 {
117 throw new javax.jmi.reflect.TypeMismatchException( null, null, null );
118 }
119 break;
120 default: super.canBeElementAdded( list, collectionId, newElement );
121 }
122 }
123 public void elementAdded( ru.novosoft.mdf.impl.MDFListImpl list, int collectionId, int position, Object newElement )
124 {
125 switch( collectionId )
126 {
127 case 102 :
128 {
129 ((com.bonevich.erj.mof.impl.model.ErjDomainImpl)newElement).internalRefBySchema106(this);
130 ((ru.novosoft.mdf.impl.MDFObjectImpl)((com.bonevich.erj.mof.impl.model.ErjDomainImpl)newElement)).mdfSetElementContainer((ru.novosoft.mdf.ext.MDFFeatured)this,"domains");
131 if (needUndo())
132 {
133 logItemAddAt((ru.novosoft.mdf.impl.MDFListImpl)_domains104,_addAtMethod, _removeAtMethod, newElement, position);
134 }
135 if ( needEvent() )
136 {
137 fireItemAddAt("domains", newElement, position);
138 }
139 }
140 break;
141 case 103 :
142 {
143 ((com.bonevich.erj.mof.impl.model.ErjRelationImpl)newElement).internalRefBySchema107(this);
144 ((ru.novosoft.mdf.impl.MDFObjectImpl)((com.bonevich.erj.mof.impl.model.ErjRelationImpl)newElement)).mdfSetElementContainer((ru.novosoft.mdf.ext.MDFFeatured)this,"relations");
145 if (needUndo())
146 {
147 logItemAddAt((ru.novosoft.mdf.impl.MDFListImpl)_relations105,_addAtMethod, _removeAtMethod, newElement, position);
148 }
149 if ( needEvent() )
150 {
151 fireItemAddAt("relations", newElement, position);
152 }
153 }
154 break;
155 default: super.elementAdded( list, collectionId, position, newElement );
156 }
157 }
158 public void elementRemoved( ru.novosoft.mdf.impl.MDFListImpl list, int collectionId, int position, Object removedObject )
159 {
160 switch( collectionId )
161 {
162 case 102 :
163 {
164 ((com.bonevich.erj.mof.impl.model.ErjDomainImpl)removedObject).internalUnrefBySchema106(this);
165 if (((com.bonevich.erj.mof.impl.model.ErjDomainImpl)removedObject).refImmediateComposite() != null)
166 {
167 ((ru.novosoft.mdf.impl.MDFObjectImpl)((com.bonevich.erj.mof.impl.model.ErjDomainImpl)removedObject)).mdfSetElementContainer(null, null);
168 }
169 if ( needUndo() )
170 {
171 logItemRemoveAt((ru.novosoft.mdf.impl.MDFListImpl)_domains104,_removeAtMethod, _addAtMethod, removedObject, position);
172 }
173 if ( needEvent() )
174 {
175 fireItemRemoveAt("domains", removedObject, position);
176 }
177 }
178 break;
179 case 103 :
180 {
181 ((com.bonevich.erj.mof.impl.model.ErjRelationImpl)removedObject).internalUnrefBySchema107(this);
182 if (((com.bonevich.erj.mof.impl.model.ErjRelationImpl)removedObject).refImmediateComposite() != null)
183 {
184 ((ru.novosoft.mdf.impl.MDFObjectImpl)((com.bonevich.erj.mof.impl.model.ErjRelationImpl)removedObject)).mdfSetElementContainer(null, null);
185 }
186 if ( needUndo() )
187 {
188 logItemRemoveAt((ru.novosoft.mdf.impl.MDFListImpl)_relations105,_removeAtMethod, _addAtMethod, removedObject, position);
189 }
190 if ( needEvent() )
191 {
192 fireItemRemoveAt("relations", removedObject, position);
193 }
194 }
195 break;
196 default: super.elementRemoved( list, collectionId, position, removedObject );
197 }
198 }
199 public void elementSetAt(ru.novosoft.mdf.impl.MDFListImpl list, int collectionId, int position, Object removed, Object added)
200 {
201 switch(collectionId)
202 {
203 case 102:
204 {
205 ((com.bonevich.erj.mof.impl.model.ErjDomainImpl)added).internalRefBySchema106(this);
206 ((ru.novosoft.mdf.impl.MDFObjectImpl)((com.bonevich.erj.mof.impl.model.ErjDomainImpl)added)).mdfSetElementContainer((ru.novosoft.mdf.ext.MDFFeatured)this,"domains");
207 ((com.bonevich.erj.mof.impl.model.ErjDomainImpl)removed).internalUnrefBySchema106(this);
208 if (((com.bonevich.erj.mof.impl.model.ErjDomainImpl)removed).refImmediateComposite() != null)
209 {
210 ((ru.novosoft.mdf.impl.MDFObjectImpl)((com.bonevich.erj.mof.impl.model.ErjDomainImpl)removed)).mdfSetElementContainer(null, null);
211 }
212 if (needUndo())
213 {
214 logItemSetAt((ru.novosoft.mdf.impl.MDFListImpl)_domains104,_setAtMethod, removed, added, position);
215 }
216 if ( needEvent() )
217 {
218 fireItemSetAt("domains", removed, added, position);
219 }
220 }
221 break;
222 case 103:
223 {
224 ((com.bonevich.erj.mof.impl.model.ErjRelationImpl)added).internalRefBySchema107(this);
225 ((ru.novosoft.mdf.impl.MDFObjectImpl)((com.bonevich.erj.mof.impl.model.ErjRelationImpl)added)).mdfSetElementContainer((ru.novosoft.mdf.ext.MDFFeatured)this,"relations");
226 ((com.bonevich.erj.mof.impl.model.ErjRelationImpl)removed).internalUnrefBySchema107(this);
227 if (((com.bonevich.erj.mof.impl.model.ErjRelationImpl)removed).refImmediateComposite() != null)
228 {
229 ((ru.novosoft.mdf.impl.MDFObjectImpl)((com.bonevich.erj.mof.impl.model.ErjRelationImpl)removed)).mdfSetElementContainer(null, null);
230 }
231 if (needUndo())
232 {
233 logItemSetAt((ru.novosoft.mdf.impl.MDFListImpl)_relations105,_setAtMethod, removed, added, position);
234 }
235 if ( needEvent() )
236 {
237 fireItemSetAt("relations", removed, added, position);
238 }
239 }
240 break;
241 }
242 }
243 public void mdfSetValue(String feature, Object value)
244 {
245 if ("domains".equals(feature))
246 {
247 collectionSetting(_domains104, (java.util.Collection)value);
248 return;
249 }
250 if ("relations".equals(feature))
251 {
252 collectionSetting(_relations105, (java.util.Collection)value);
253 return;
254 }
255 super.mdfSetValue(feature, value);
256 }
257 public Class mdfGetFeatureElementType(String k)
258 {
259 if ("domains".equals(k))
260 {
261 return com.bonevich.erj.mof.interfaces.model.Domain.class;
262 }
263 if ("relations".equals(k))
264 {
265 return com.bonevich.erj.mof.interfaces.model.Relation.class;
266 }
267 return super.mdfGetFeatureElementType(k);
268 }
269 public Class mdfGetFeatureType(String k)
270 {
271 if ("domains".equals(k))
272 {
273 return java.util.List.class;
274 }
275 if ("relations".equals(k))
276 {
277 return java.util.List.class;
278 }
279 return super.mdfGetFeatureType(k);
280 }
281 public Object mdfGetValue(String feature)
282 {
283 if ("domains".equals(feature))
284 {
285 return getDomains104();
286 }
287 if ("relations".equals(feature))
288 {
289 return getRelations105();
290 }
291 return super.mdfGetValue( feature );
292 }
293 public void mdfRemoveValue(String feature, Object existingValue)
294 {
295 if ("domains".equals(feature))
296 {
297 _domains104.remove(((com.bonevich.erj.mof.interfaces.model.Domain)existingValue));
298 return;
299 }
300 if ("relations".equals(feature))
301 {
302 _relations105.remove(((com.bonevich.erj.mof.interfaces.model.Relation)existingValue));
303 return;
304 }
305 super.mdfRemoveValue(feature, existingValue);
306 }
307 public Object refGetValue(javax.jmi.reflect.RefObject feature)
308 {
309 if (ru.novosoft.mdf.impl.MDFBaseObjectImpl.checkQualifiedName( feature, "ErjInfoModel","Schema","relations"))
310 {
311 return getRelations();
312 }
313 if (ru.novosoft.mdf.impl.MDFBaseObjectImpl.checkQualifiedName( feature, "ErjInfoModel","Schema","domains"))
314 {
315 return getDomains();
316 }
317 return super.refGetValue(feature);
318 }
319 public Object refGetValue(String feature)
320 {
321 return mdfGetValue(feature);
322 }
323 public void refSetValue(javax.jmi.reflect.RefObject feature, Object value)
324 {
325 if(ru.novosoft.mdf.impl.MDFBaseObjectImpl.checkQualifiedName( feature, "ErjInfoModel","Schema","relations" ))
326 {
327 collectionSetting(_relations105, (java.util.Collection)value);
328 }
329 else if(ru.novosoft.mdf.impl.MDFBaseObjectImpl.checkQualifiedName( feature, "ErjInfoModel","Schema","domains" ))
330 {
331 collectionSetting(_domains104, (java.util.Collection)value);
332 }
333 else
334 {
335 super.refSetValue( feature, value );
336 }
337 }
338 public void refSetValue(String feature, Object value)
339 {
340 mdfSetValue(feature, value);
341 }
342 public Object refInvokeOperation(javax.jmi.reflect.RefObject requestedOperation, java.util.List args)
343 {
344 throw new RuntimeException(" !!! NOT IMPLEMENTED !!!");
345 }
346 public Object refInvokeOperation(String requestedOperation, java.util.List args)
347 {
348 throw new RuntimeException(" !!! NOT IMPLEMENTED !!!");
349 }
350 public javax.jmi.reflect.RefObject refMetaObject()
351 {
352 return refGetClass().refMetaObject();
353 }
354 public javax.jmi.reflect.RefPackage refImmediatePackage()
355 {
356 return refGetClass().refImmediatePackage();
357 }
358 public javax.jmi.reflect.RefPackage refOutermostPackage()
359 {
360 return refGetClass().refOutermostPackage();
361 }
362 public String refMofId()
363 {
364 throw new RuntimeException(" !!! NOT IMPLEMENTED !!!");
365 }
366 private ru.novosoft.mdf.ext.MDFClass thisCls = null;
367 public javax.jmi.reflect.RefClass refGetClass()
368 {
369 if (thisCls == null)
370 {
371 thisCls = (ru.novosoft.mdf.ext.MDFClass)repository.getMetaObject( com.bonevich.erj.mof.interfaces.model.SchemaClass.class );
372 }
373 return thisCls;
374 }
375 public java.util.Collection refVerify( boolean f )
376 {
377 throw new RuntimeException(" !!! NOT IMPLEMENTED !!!");
378 }
379 public java.util.List internalGetOppositeCollection( int collectionId, Object o )
380 {
381 switch( collectionId )
382 {
383 }
384 return super.internalGetOppositeCollection( collectionId, o );
385 }
386 }
This page was automatically generated by Maven