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

This page was automatically generated by Maven