View Javadoc
1 package com.bonevich.erj.mof.impl.model; 2 import java.lang.reflect.Method; 3 import java.util.*; 4 5 public class ErjDomainImpl extends com.bonevich.erj.mof.impl.model.ErjModelElementImpl implements com.bonevich.erj.mof.interfaces.model.Domain, com.bonevich.erj.mof.impl.model.ErjAttributeTypeImplHelper 6 { 7 public ErjDomainImpl(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.AttributeType && com.bonevich.erj.mof.interfaces.model.AttributeType.class.isAssignableFrom(base)) 15 { 16 com.bonevich.erj.mof.impl.model.ErjAttributeTypeImplHelper src = (com.bonevich.erj.mof.impl.model.ErjAttributeTypeImplHelper)srcarg; 17 { 18 List c = new ArrayList( src.getAttributes111() ); 19 src.getAttributes111().clear(); 20 collectionSetting(_attributes111, c); 21 } 22 } 23 if (srcarg instanceof com.bonevich.erj.mof.interfaces.model.Domain && com.bonevich.erj.mof.interfaces.model.Domain.class.isAssignableFrom(base)) 24 { 25 com.bonevich.erj.mof.impl.model.ErjDomainImpl src = (com.bonevich.erj.mof.impl.model.ErjDomainImpl)srcarg; 26 { 27 com.bonevich.erj.mof.interfaces.model.DataType c = src.getDataType(); 28 if (c != null) 29 { 30 src.setDataType((com.bonevich.erj.mof.interfaces.model.DataType)null); 31 this.setDataType(c); 32 } 33 } 34 setDefaultConstraint(src.getDefaultConstraint()); 35 setDefaultValue(src.getDefaultValue()); 36 { 37 com.bonevich.erj.mof.impl.model.ErjSchemaImpl c = (com.bonevich.erj.mof.impl.model.ErjSchemaImpl)src.getSchema106(); 38 if (c != null) 39 { 40 int pos = c.getDomains104().indexOf(src); 41 c.getDomains104().set( pos, this ); 42 } 43 } 44 } 45 } 46 // implementing: com.bonevich.erj.mof.interfaces.model.AttributeType 47 private java.util.List _attributes111 = new ru.novosoft.mdf.impl.MDFFeatureListImpl( this, 104, true); 48 public java.util.List getAttributes111() 49 { 50 checkExists(); 51 return _attributes111; 52 } 53 // implementing: com.bonevich.erj.mof.interfaces.model.Domain 54 public com.bonevich.erj.mof.interfaces.model.Schema getSchema() 55 { 56 return getSchema106(); 57 } 58 public void setSchema(com.bonevich.erj.mof.interfaces.model.Schema _schema106) 59 { 60 operationStarted(); 61 try 62 { 63 setSchema106(_schema106); 64 } 65 finally 66 { 67 operationFinished(); 68 } 69 } 70 private com.bonevich.erj.mof.interfaces.model.Schema _schema106; 71 private final static Method _schema106_setMethod = mdfGetMethod1(com.bonevich.erj.mof.impl.model.ErjDomainImpl.class, "setSchema106", com.bonevich.erj.mof.interfaces.model.Schema.class); 72 public com.bonevich.erj.mof.interfaces.model.Schema getSchema106() 73 { 74 checkExists(); 75 return _schema106; 76 } 77 public final void setSchema106(com.bonevich.erj.mof.interfaces.model.Schema __arg) 78 { 79 operationStarted(); 80 try 81 { 82 if (_schema106 != __arg) 83 { 84 if (_schema106 != null) 85 { 86 ((com.bonevich.erj.mof.impl.model.ErjSchemaImpl)_schema106).getDomains104().remove( this ); 87 } 88 if (__arg != null) 89 { 90 ((com.bonevich.erj.mof.impl.model.ErjSchemaImpl)__arg).getDomains104().add( this ); 91 } 92 } 93 } 94 finally 95 { 96 operationFinished(); 97 } 98 } 99 public final void internalRefBySchema106(com.bonevich.erj.mof.interfaces.model.Schema __arg) 100 { 101 com.bonevich.erj.mof.interfaces.model.Schema __saved = _schema106; 102 if (_schema106 != null) 103 { 104 ((com.bonevich.erj.mof.impl.model.ErjSchemaImpl)_schema106).getDomains104().remove( this ); 105 } 106 _schema106 = __arg; 107 if (needEvent()) 108 { 109 firePropertySet("schema",__saved, __arg); 110 } 111 final javax.jmi.reflect.RefAssociation _ContainsDomains = ( javax.jmi.reflect.RefAssociation ) repository.getMetaObject( com.bonevich.erj.mof.interfaces.model.ContainsDomains.class ); 112 ((ru.novosoft.mdf.impl.MDFAssociationImpl)_ContainsDomains).internalAddLink( this, __arg ); 113 } 114 public final void internalUnrefBySchema106(com.bonevich.erj.mof.interfaces.model.Schema __arg) 115 { 116 com.bonevich.erj.mof.interfaces.model.Schema __saved = _schema106; 117 _schema106 = null; 118 if (needEvent()) 119 { 120 firePropertySet("schema", __saved, null); 121 } 122 final javax.jmi.reflect.RefAssociation _ContainsDomains = ( javax.jmi.reflect.RefAssociation ) repository.getMetaObject( com.bonevich.erj.mof.interfaces.model.ContainsDomains.class ); 123 ((ru.novosoft.mdf.impl.MDFAssociationImpl)_ContainsDomains).internalRemoveLink( this, __arg ); 124 } 125 public Set mdfGetElementContents() 126 { 127 Set ret = super.mdfGetElementContents(); 128 ret.add(getDataType()); 129 ret.remove( null ); 130 return ret; 131 } 132 public Class mdfGetInterfaceClass() 133 { 134 return com.bonevich.erj.mof.interfaces.model.Domain.class; 135 } 136 protected void cleanup() 137 { 138 setDataType(null); 139 setSchema106((com.bonevich.erj.mof.interfaces.model.Schema)null); 140 _attributes111.clear(); 141 super.cleanup(); 142 } 143 public void internalElementAdded( ru.novosoft.mdf.impl.MDFListImpl list, int collectionId, Object addedElement ) 144 { 145 if (needEvent()) 146 { 147 switch(collectionId) 148 { 149 case 106 : 150 fireItemAdd( "domains", addedElement ); 151 break; 152 default: super.internalElementAdded(list, collectionId, addedElement); 153 } 154 } 155 } 156 public void internalElementRemoved(ru.novosoft.mdf.impl.MDFListImpl list, int collectionId, Object removedElement ) 157 { 158 if (needEvent()) 159 { 160 switch(collectionId) 161 { 162 case 106 : 163 fireItemRemove( "domains", removedElement ); 164 break; 165 default: super.internalElementRemoved(list, collectionId, removedElement); 166 } 167 } 168 } 169 public void canBeElementAdded( ru.novosoft.mdf.impl.MDFListImpl list, int collectionId, Object newElement ) 170 { 171 switch( collectionId ) 172 { 173 174 case 104: 175 if (newElement == null) 176 { 177 throw new NullPointerException(); 178 } 179 if (mdfGetOutermostPackage() != ((ru.novosoft.mdf.impl.MDFBaseObjectImpl)newElement).mdfGetOutermostPackage()) 180 { 181 throw new javax.jmi.reflect.ClosureViolationException( null, null ); 182 } 183 if (list.contains( newElement )) 184 { 185 throw new javax.jmi.reflect.DuplicateException( null, null); 186 } 187 if ( ! (newElement instanceof com.bonevich.erj.mof.interfaces.model.Attribute) ) 188 { 189 throw new javax.jmi.reflect.TypeMismatchException( null, null, null ); 190 } 191 break; 192 default: super.canBeElementAdded( list, collectionId, newElement ); 193 } 194 } 195 public void elementAdded( ru.novosoft.mdf.impl.MDFListImpl list, int collectionId, int position, Object newElement ) 196 { 197 switch( collectionId ) 198 { 199 case 104 : 200 { 201 ((com.bonevich.erj.mof.impl.model.ErjAttributeImpl)newElement).internalRefByType112(this); 202 if (needUndo()) 203 { 204 logItemAddAt((ru.novosoft.mdf.impl.MDFListImpl)_attributes111,_addAtMethod, _removeAtMethod, newElement, position); 205 } 206 if ( needEvent() ) 207 { 208 fireItemAddAt("com.bonevich.erj.mof.interfaces.model.Types.attributes", newElement, position); 209 } 210 } 211 break; 212 default: super.elementAdded( list, collectionId, position, newElement ); 213 } 214 } 215 public void elementRemoved( ru.novosoft.mdf.impl.MDFListImpl list, int collectionId, int position, Object removedObject ) 216 { 217 switch( collectionId ) 218 { 219 case 104 : 220 { 221 ((com.bonevich.erj.mof.impl.model.ErjAttributeImpl)removedObject).internalUnrefByType112(this); 222 if ( needUndo() ) 223 { 224 logItemRemoveAt((ru.novosoft.mdf.impl.MDFListImpl)_attributes111,_removeAtMethod, _addAtMethod, removedObject, position); 225 } 226 if ( needEvent() ) 227 { 228 fireItemRemoveAt("com.bonevich.erj.mof.interfaces.model.Types.attributes", removedObject, position); 229 } 230 } 231 break; 232 default: super.elementRemoved( list, collectionId, position, removedObject ); 233 } 234 } 235 public void elementSetAt(ru.novosoft.mdf.impl.MDFListImpl list, int collectionId, int position, Object removed, Object added) 236 { 237 switch(collectionId) 238 { 239 case 104: 240 { 241 ((com.bonevich.erj.mof.impl.model.ErjAttributeImpl)added).internalRefByType112(this); 242 ((com.bonevich.erj.mof.impl.model.ErjAttributeImpl)removed).internalUnrefByType112(this); 243 if (needUndo()) 244 { 245 logItemSetAt((ru.novosoft.mdf.impl.MDFListImpl)_attributes111,_setAtMethod, removed, added, position); 246 } 247 if ( needEvent() ) 248 { 249 fireItemSetAt("com.bonevich.erj.mof.interfaces.model.Types.attributes", removed, added, position); 250 } 251 } 252 break; 253 default: super.elementSetAt(list, collectionId, position, removed, added); 254 } 255 } 256 public void mdfSetValue(String feature, Object value) 257 { 258 if ("dataType".equals(feature)) 259 { 260 setDataType(((com.bonevich.erj.mof.interfaces.model.DataType)value)); 261 return; 262 } 263 if ("defaultValue".equals(feature)) 264 { 265 setDefaultValue(((com.bonevich.erj.mof.interfaces.model.DefaultValue)value)); 266 return; 267 } 268 if ("defaultConstraint".equals(feature)) 269 { 270 setDefaultConstraint(((com.bonevich.erj.mof.interfaces.model.AttributeConstraint)value)); 271 return; 272 } 273 if ("schema".equals(feature)) 274 { 275 setSchema106(((com.bonevich.erj.mof.interfaces.model.Schema)value)); 276 return; 277 } 278 if ("com.bonevich.erj.mof.interfaces.model.Types.attributes".equals(feature)) 279 { 280 collectionSetting(_attributes111, (java.util.Collection)value); 281 return; 282 } 283 super.mdfSetValue(feature, value); 284 } 285 public Class mdfGetFeatureElementType(String k) 286 { 287 if ("com.bonevich.erj.mof.interfaces.model.Types.attributes".equals(k)) 288 { 289 return com.bonevich.erj.mof.interfaces.model.Attribute.class; 290 } 291 return super.mdfGetFeatureElementType(k); 292 } 293 public Class mdfGetFeatureType(String k) 294 { 295 if ("dataType".equals(k)) 296 { 297 return com.bonevich.erj.mof.interfaces.model.DataType.class; 298 } 299 if ("defaultValue".equals(k)) 300 { 301 return com.bonevich.erj.mof.interfaces.model.DefaultValue.class; 302 } 303 if ("defaultConstraint".equals(k)) 304 { 305 return com.bonevich.erj.mof.interfaces.model.AttributeConstraint.class; 306 } 307 if ("schema".equals(k)) 308 { 309 return com.bonevich.erj.mof.interfaces.model.Schema.class; 310 } 311 if ("com.bonevich.erj.mof.interfaces.model.Types.attributes".equals(k)) 312 { 313 return java.util.List.class; 314 } 315 return super.mdfGetFeatureType(k); 316 } 317 public Object mdfGetValue(String feature) 318 { 319 if ("dataType".equals(feature)) 320 { 321 return getDataType(); 322 } 323 if ("defaultValue".equals(feature)) 324 { 325 return getDefaultValue(); 326 } 327 if ("defaultConstraint".equals(feature)) 328 { 329 return getDefaultConstraint(); 330 } 331 if ("schema".equals(feature)) 332 { 333 return getSchema106(); 334 } 335 if ("com.bonevich.erj.mof.interfaces.model.Types.attributes".equals(feature)) 336 { 337 return getAttributes111(); 338 } 339 return super.mdfGetValue( feature ); 340 } 341 public void mdfRemoveValue(String feature, Object existingValue) 342 { 343 if ("com.bonevich.erj.mof.interfaces.model.Types.attributes".equals(feature)) 344 { 345 _attributes111.remove(((com.bonevich.erj.mof.interfaces.model.Attribute)existingValue)); 346 return; 347 } 348 super.mdfRemoveValue(feature, existingValue); 349 } 350 private com.bonevich.erj.mof.interfaces.model.DataType _dataType116 = null; 351 private final static Method _dataType116_setMethod = mdfGetMethod1(com.bonevich.erj.mof.impl.model.ErjDomainImpl.class, "setDataType", com.bonevich.erj.mof.interfaces.model.DataType.class); 352 public final com.bonevich.erj.mof.interfaces.model.DataType getDataType() 353 { 354 checkExists(); 355 return ((com.bonevich.erj.mof.interfaces.model.DataType)_dataType116); 356 } 357 public final void setDataType(com.bonevich.erj.mof.interfaces.model.DataType newValue) 358 { 359 operationStarted(); 360 try 361 { 362 if (_dataType116 != ((com.bonevich.erj.mof.interfaces.model.DataType)newValue)) 363 { 364 com.bonevich.erj.mof.interfaces.model.DataType __saved = _dataType116; 365 _dataType116 = ((com.bonevich.erj.mof.interfaces.model.DataType)newValue); 366 if (((com.bonevich.erj.mof.impl.model.ErjDataTypeImpl)__saved) != null) 367 { 368 if (((com.bonevich.erj.mof.impl.model.ErjDataTypeImpl)__saved).refImmediateComposite() != null) 369 { 370 ((ru.novosoft.mdf.impl.MDFObjectImpl)((com.bonevich.erj.mof.impl.model.ErjDataTypeImpl)__saved)).mdfSetElementContainer(null, null); 371 } 372 } 373 if (((com.bonevich.erj.mof.impl.model.ErjDataTypeImpl)newValue) != null) 374 { 375 ((ru.novosoft.mdf.impl.MDFObjectImpl)((com.bonevich.erj.mof.impl.model.ErjDataTypeImpl)newValue)).mdfSetElementContainer((ru.novosoft.mdf.ext.MDFFeatured)this,"dataType"); 376 } 377 if (needUndo()) 378 { 379 logPropertySet(_dataType116_setMethod, __saved, ((com.bonevich.erj.mof.interfaces.model.DataType)newValue)); 380 } 381 if (needEvent()) 382 { 383 firePropertySet("dataType", __saved, ((com.bonevich.erj.mof.interfaces.model.DataType)newValue)); 384 } 385 } 386 } 387 finally 388 { 389 operationFinished(); 390 } 391 } 392 private com.bonevich.erj.mof.interfaces.model.AttributeConstraint _defaultConstraint117 = null; 393 private final static Method _defaultConstraint117_setMethod = mdfGetMethod1(com.bonevich.erj.mof.impl.model.ErjDomainImpl.class, "setDefaultConstraint", com.bonevich.erj.mof.interfaces.model.AttributeConstraint.class); 394 public final com.bonevich.erj.mof.interfaces.model.AttributeConstraint getDefaultConstraint() 395 { 396 checkExists(); 397 return ((com.bonevich.erj.mof.interfaces.model.AttributeConstraint)_defaultConstraint117); 398 } 399 public final void setDefaultConstraint(com.bonevich.erj.mof.interfaces.model.AttributeConstraint newValue) 400 { 401 operationStarted(); 402 try 403 { 404 if (_defaultConstraint117 != ((com.bonevich.erj.mof.interfaces.model.AttributeConstraint)newValue)) 405 { 406 com.bonevich.erj.mof.interfaces.model.AttributeConstraint __saved = _defaultConstraint117; 407 _defaultConstraint117 = ((com.bonevich.erj.mof.interfaces.model.AttributeConstraint)newValue); 408 if (needUndo()) 409 { 410 logPropertySet(_defaultConstraint117_setMethod, __saved, ((com.bonevich.erj.mof.interfaces.model.AttributeConstraint)newValue)); 411 } 412 if (needEvent()) 413 { 414 firePropertySet("defaultConstraint", __saved, ((com.bonevich.erj.mof.interfaces.model.AttributeConstraint)newValue)); 415 } 416 } 417 } 418 finally 419 { 420 operationFinished(); 421 } 422 } 423 private com.bonevich.erj.mof.interfaces.model.DefaultValue _defaultValue118 = null; 424 private final static Method _defaultValue118_setMethod = mdfGetMethod1(com.bonevich.erj.mof.impl.model.ErjDomainImpl.class, "setDefaultValue", com.bonevich.erj.mof.interfaces.model.DefaultValue.class); 425 public final com.bonevich.erj.mof.interfaces.model.DefaultValue getDefaultValue() 426 { 427 checkExists(); 428 return _defaultValue118; 429 } 430 public final void setDefaultValue(com.bonevich.erj.mof.interfaces.model.DefaultValue newValue) 431 { 432 operationStarted(); 433 try 434 { 435 if (_defaultValue118 != ((com.bonevich.erj.mof.interfaces.model.DefaultValue)newValue)) 436 { 437 com.bonevich.erj.mof.interfaces.model.DefaultValue __saved = _defaultValue118; 438 _defaultValue118 = ((com.bonevich.erj.mof.interfaces.model.DefaultValue)newValue); 439 if (_defaultValue118 != newValue) 440 { 441 // _defaultValue118.mdfFreeze(); 442 } 443 if (needUndo()) 444 { 445 logPropertySet(_defaultValue118_setMethod, __saved, ((com.bonevich.erj.mof.interfaces.model.DefaultValue)newValue)); 446 } 447 if (needEvent()) 448 { 449 firePropertySet("defaultValue", __saved, ((com.bonevich.erj.mof.interfaces.model.DefaultValue)newValue)); 450 } 451 } 452 } 453 finally 454 { 455 operationFinished(); 456 } 457 } 458 public Object refGetValue(javax.jmi.reflect.RefObject feature) 459 { 460 if (ru.novosoft.mdf.impl.MDFBaseObjectImpl.checkQualifiedName( feature, "ErjInfoModel","Domain","dataType")) 461 { 462 return getDataType(); 463 } 464 if (ru.novosoft.mdf.impl.MDFBaseObjectImpl.checkQualifiedName( feature, "ErjInfoModel","Domain","defaultConstraint")) 465 { 466 return getDefaultConstraint(); 467 } 468 if (ru.novosoft.mdf.impl.MDFBaseObjectImpl.checkQualifiedName( feature, "ErjInfoModel","Domain","defaultValue")) 469 { 470 return getDefaultValue(); 471 } 472 if (ru.novosoft.mdf.impl.MDFBaseObjectImpl.checkQualifiedName( feature, "ErjInfoModel","Domain","schema")) 473 { 474 return getSchema(); 475 } 476 return super.refGetValue(feature); 477 } 478 public Object refGetValue(String feature) 479 { 480 return mdfGetValue(feature); 481 } 482 public void refSetValue(javax.jmi.reflect.RefObject feature, Object value) 483 { 484 if(ru.novosoft.mdf.impl.MDFBaseObjectImpl.checkQualifiedName( feature, "ErjInfoModel","Domain","dataType" )) 485 { 486 setDataType((com.bonevich.erj.mof.interfaces.model.DataType) value); 487 } 488 else if(ru.novosoft.mdf.impl.MDFBaseObjectImpl.checkQualifiedName( feature, "ErjInfoModel","Domain","defaultConstraint" )) 489 { 490 setDefaultConstraint((com.bonevich.erj.mof.interfaces.model.AttributeConstraint) value); 491 } 492 else if(ru.novosoft.mdf.impl.MDFBaseObjectImpl.checkQualifiedName( feature, "ErjInfoModel","Domain","defaultValue" )) 493 { 494 setDefaultValue((com.bonevich.erj.mof.interfaces.model.DefaultValue) value); 495 } 496 else if(ru.novosoft.mdf.impl.MDFBaseObjectImpl.checkQualifiedName( feature, "ErjInfoModel","Domain","schema" )) 497 { 498 setSchema106((com.bonevich.erj.mof.interfaces.model.Schema) value); 499 } 500 else 501 { 502 super.refSetValue( feature, value ); 503 } 504 } 505 public void refSetValue(String feature, Object value) 506 { 507 mdfSetValue(feature, value); 508 } 509 public Object refInvokeOperation(javax.jmi.reflect.RefObject requestedOperation, java.util.List args) 510 { 511 throw new RuntimeException(" !!! NOT IMPLEMENTED !!!"); 512 } 513 public Object refInvokeOperation(String requestedOperation, java.util.List args) 514 { 515 throw new RuntimeException(" !!! NOT IMPLEMENTED !!!"); 516 } 517 public javax.jmi.reflect.RefObject refMetaObject() 518 { 519 return refGetClass().refMetaObject(); 520 } 521 public javax.jmi.reflect.RefPackage refImmediatePackage() 522 { 523 return refGetClass().refImmediatePackage(); 524 } 525 public javax.jmi.reflect.RefPackage refOutermostPackage() 526 { 527 return refGetClass().refOutermostPackage(); 528 } 529 public String refMofId() 530 { 531 throw new RuntimeException(" !!! NOT IMPLEMENTED !!!"); 532 } 533 private ru.novosoft.mdf.ext.MDFClass thisCls = null; 534 public javax.jmi.reflect.RefClass refGetClass() 535 { 536 if (thisCls == null) 537 { 538 thisCls = (ru.novosoft.mdf.ext.MDFClass)repository.getMetaObject( com.bonevich.erj.mof.interfaces.model.DomainClass.class ); 539 } 540 return thisCls; 541 } 542 public java.util.Collection refVerify( boolean f ) 543 { 544 throw new RuntimeException(" !!! NOT IMPLEMENTED !!!"); 545 } 546 public java.util.List internalGetOppositeCollection( int collectionId, Object o ) 547 { 548 switch( collectionId ) 549 { 550 case 106 : return ((com.bonevich.erj.mof.impl.model.ErjSchemaImpl)o).getDomains104(); 551 } 552 return super.internalGetOppositeCollection( collectionId, o ); 553 } 554 }

This page was automatically generated by Maven