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