1 package org.andromda.metafacades.emf.uml22;
2
3 import java.lang.reflect.InvocationTargetException;
4 import java.util.Map;
5 import org.eclipse.emf.common.notify.Adapter;
6 import org.eclipse.emf.common.notify.Notification;
7 import org.eclipse.emf.common.util.DiagnosticChain;
8 import org.eclipse.emf.common.util.EList;
9 import org.eclipse.emf.common.util.TreeIterator;
10 import org.eclipse.emf.ecore.EAnnotation;
11 import org.eclipse.emf.ecore.EClass;
12 import org.eclipse.emf.ecore.EObject;
13 import org.eclipse.emf.ecore.EOperation;
14 import org.eclipse.emf.ecore.EReference;
15 import org.eclipse.emf.ecore.EStructuralFeature;
16 import org.eclipse.emf.ecore.resource.Resource;
17 import org.eclipse.uml2.uml.Classifier;
18 import org.eclipse.uml2.uml.Comment;
19 import org.eclipse.uml2.uml.Dependency;
20 import org.eclipse.uml2.uml.Deployment;
21 import org.eclipse.uml2.uml.DirectedRelationship;
22 import org.eclipse.uml2.uml.Element;
23 import org.eclipse.uml2.uml.InstanceSpecification;
24 import org.eclipse.uml2.uml.Model;
25 import org.eclipse.uml2.uml.NamedElement;
26 import org.eclipse.uml2.uml.Namespace;
27 import org.eclipse.uml2.uml.Package;
28 import org.eclipse.uml2.uml.PackageableElement;
29 import org.eclipse.uml2.uml.ParameterableElement;
30 import org.eclipse.uml2.uml.Relationship;
31 import org.eclipse.uml2.uml.Slot;
32 import org.eclipse.uml2.uml.Stereotype;
33 import org.eclipse.uml2.uml.StringExpression;
34 import org.eclipse.uml2.uml.TemplateParameter;
35 import org.eclipse.uml2.uml.Type;
36 import org.eclipse.uml2.uml.Usage;
37 import org.eclipse.uml2.uml.ValueSpecification;
38 import org.eclipse.uml2.uml.VisibilityKind;
39
40
41
42
43 public class ObjectInstanceImpl implements ObjectInstance
44 {
45
46
47
48 final InstanceSpecification instanceSpecification;
49
50
51
52
53 ObjectInstanceImpl(final InstanceSpecification instanceSpecification)
54 {
55 this.instanceSpecification = instanceSpecification;
56 }
57
58
59
60
61 @Override
62 public boolean equals(final Object object)
63 {
64 if (object instanceof ObjectInstanceImpl)
65 {
66 return this.instanceSpecification.equals(((ObjectInstanceImpl)object).instanceSpecification);
67 }
68
69
70
71
72 return this.instanceSpecification.equals(object);
73 }
74
75
76
77
78 @Override
79 public int hashCode()
80 {
81 return this.instanceSpecification.hashCode();
82 }
83
84
85
86
87 @Override
88 public String toString()
89 {
90 return this.getClass().getName() + '[' + this.instanceSpecification.toString() + ']';
91 }
92
93
94
95
96 public EList<Deployment> getDeployments()
97 {
98 return this.instanceSpecification.getDeployments();
99 }
100
101
102
103
104 public Deployment getDeployment(final String string, final boolean ignoreCase, final boolean createOnDemand)
105 {
106 return this.instanceSpecification.getDeployment(string, ignoreCase, createOnDemand);
107 }
108
109
110
111
112 public Deployment getDeployment(final String string)
113 {
114 return this.instanceSpecification.getDeployment(string);
115 }
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130 public Deployment createDeployment(final String name)
131 {
132 return this.instanceSpecification.createDeployment(name);
133 }
134
135
136
137
138 public EList<PackageableElement> getDeployedElements()
139 {
140 return this.instanceSpecification.getDeployedElements();
141 }
142
143
144
145
146 public PackageableElement getDeployedElement(final String string)
147 {
148 return this.instanceSpecification.getDeployedElement(string);
149 }
150
151
152
153
154 public PackageableElement getDeployedElement(final String string, final boolean bool, final EClass eClass)
155 {
156 return this.instanceSpecification.getDeployedElement(string, bool, eClass);
157 }
158
159
160
161
162 public EList<Slot> getSlots()
163 {
164 return this.instanceSpecification.getSlots();
165 }
166
167
168
169
170
171 public Slot createSlot(final EClass eClass)
172 {
173 return this.instanceSpecification.createSlot();
174 }
175
176
177
178
179 public Slot createSlot()
180 {
181 return this.instanceSpecification.createSlot();
182 }
183
184
185
186
187 public EList<Classifier> getClassifiers()
188 {
189 return this.instanceSpecification.getClassifiers();
190 }
191
192
193
194
195 public Classifier getClassifier(final String string)
196 {
197 return this.instanceSpecification.getClassifier(string);
198 }
199
200
201
202
203 public Classifier getClassifier(final String string, final boolean ignoreCase, final EClass eClass)
204 {
205 return this.instanceSpecification.getClassifier(string, ignoreCase, eClass);
206 }
207
208
209
210
211 public ValueSpecification getSpecification()
212 {
213 return this.instanceSpecification.getSpecification();
214 }
215
216
217
218
219 public void setSpecification(final ValueSpecification valueSpecification)
220 {
221 this.instanceSpecification.setSpecification(valueSpecification);
222 }
223
224
225
226
227
228 public ValueSpecification createSpecification(final EClass eClass)
229 {
230 return this.instanceSpecification.createSpecification(null, null, eClass);
231 }
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246 public EList<Dependency> getClientDependencies()
247 {
248 return this.instanceSpecification.getClientDependencies();
249 }
250
251
252
253
254 public Object eGet(final EStructuralFeature eStructuralFeature, final boolean resolve)
255 {
256 return this.instanceSpecification.eGet(eStructuralFeature, resolve);
257 }
258
259
260
261
262 public void eSet(final EStructuralFeature eStructuralFeature, final Object object)
263 {
264 this.instanceSpecification.eSet(eStructuralFeature, object);
265 }
266
267
268
269
270 public void eUnset(final EStructuralFeature eStructuralFeature)
271 {
272 this.instanceSpecification.eUnset(eStructuralFeature);
273 }
274
275
276
277
278 public boolean eIsSet(final EStructuralFeature eStructuralFeature)
279 {
280 return this.instanceSpecification.eIsSet(eStructuralFeature);
281 }
282
283
284
285
286 public TemplateParameter getTemplateParameter()
287 {
288 return this.instanceSpecification.getTemplateParameter();
289 }
290
291
292
293
294 public void setTemplateParameter(final TemplateParameter templateParameter)
295 {
296 this.instanceSpecification.setTemplateParameter(templateParameter);
297 }
298
299
300
301
302 public TemplateParameter getOwningParameter()
303 {
304 return this.instanceSpecification.getOwningTemplateParameter();
305 }
306
307
308
309
310 public void setOwningParameter(final TemplateParameter templateParameter)
311 {
312 this.instanceSpecification.setOwningTemplateParameter(templateParameter);
313 }
314
315
316
317
318 public VisibilityKind getPackageableElement_visibility()
319 {
320 return this.instanceSpecification.getVisibility();
321 }
322
323
324
325
326 public void setPackageableElement_visibility(final VisibilityKind visibilityKind)
327 {
328 this.instanceSpecification.setVisibility(visibilityKind);
329 }
330
331
332
333
334 public VisibilityKind getVisibility()
335 {
336 return this.instanceSpecification.getVisibility();
337 }
338
339
340
341
342 public void setVisibility(final VisibilityKind visibilityKind)
343 {
344 this.instanceSpecification.setVisibility(visibilityKind);
345 }
346
347
348
349
350 public String getName()
351 {
352 return this.instanceSpecification.getName();
353 }
354
355
356
357
358 public void setName(final String string)
359 {
360 this.instanceSpecification.setName(string);
361 }
362
363
364
365
366 public String getQualifiedName()
367 {
368 return this.instanceSpecification.getQualifiedName();
369 }
370
371
372
373
374 public Dependency getClientDependency(final String string)
375 {
376 return this.instanceSpecification.getClientDependency(string);
377 }
378
379
380
381
382 public Dependency getClientDependency(final String string, final boolean ignoreCase, final EClass eClass)
383 {
384 return this.instanceSpecification.getClientDependency(string, ignoreCase, eClass);
385 }
386
387
388
389
390 public StringExpression getNameExpression()
391 {
392 return this.instanceSpecification.getNameExpression();
393 }
394
395
396
397
398 public void setNameExpression(final StringExpression stringExpression)
399 {
400 this.instanceSpecification.setNameExpression(stringExpression);
401 }
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418 public boolean validateNoName(final DiagnosticChain diagnosticChain, final Map<Object, Object> map)
419 {
420 return !this.instanceSpecification.validateHasQualifiedName(diagnosticChain, map);
421 }
422
423
424
425
426 public boolean validateHasNoQualifiedName(final DiagnosticChain diagnosticChain, final Map<Object, Object> map)
427 {
428 return this.instanceSpecification.validateHasNoQualifiedName(diagnosticChain, map);
429 }
430
431
432
433
434
435
436 public boolean validateQualifiedName(final DiagnosticChain diagnosticChain, final Map<Object, Object> map)
437 {
438 return this.instanceSpecification.validateHasQualifiedName(diagnosticChain, map);
439 }
440
441
442
443
444 public boolean validateHasQualifiedName(final DiagnosticChain diagnosticChain, final Map<Object, Object> map)
445 {
446 return this.instanceSpecification.validateHasQualifiedName(diagnosticChain, map);
447 }
448
449
450
451
452 public EList<Namespace> allNamespaces()
453 {
454 return this.instanceSpecification.allNamespaces();
455 }
456
457
458
459
460 public boolean isDistinguishableFrom(final NamedElement namedElement, final Namespace namespace)
461 {
462 return this.instanceSpecification.isDistinguishableFrom(namedElement, namespace);
463 }
464
465
466
467
468 public String separator()
469 {
470 return this.instanceSpecification.separator();
471 }
472
473
474
475
476 public String qualifiedName()
477 {
478 return this.instanceSpecification.getQualifiedName();
479 }
480
481
482
483
484 public boolean validateVisibilityNeedsOwnership(final DiagnosticChain diagnosticChain, final Map<Object, Object> map)
485 {
486 return this.instanceSpecification.validateVisibilityNeedsOwnership(diagnosticChain, map);
487 }
488
489
490
491
492 public Namespace getNamespace()
493 {
494 return this.instanceSpecification.getNamespace();
495 }
496
497
498
499
500 public String getLabel()
501 {
502 return this.instanceSpecification.getLabel();
503 }
504
505
506
507
508 public String getLabel(final boolean localize)
509 {
510 return this.instanceSpecification.getLabel(localize);
511 }
512
513
514
515
516 public Dependency createDependency(final NamedElement namedElement)
517 {
518 return this.instanceSpecification.createDependency(namedElement);
519 }
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564 public EList<Element> getOwnedElements()
565 {
566 return this.instanceSpecification.getOwnedElements();
567 }
568
569
570
571
572 public Element getOwner()
573 {
574 return this.instanceSpecification.getOwner();
575 }
576
577
578
579
580 public EList<Comment> getOwnedComments()
581 {
582 return this.instanceSpecification.getOwnedComments();
583 }
584
585
586
587
588
589 public Comment createOwnedComment(final EClass eClass)
590 {
591 return this.instanceSpecification.createOwnedComment();
592 }
593
594
595
596
597 public Comment createOwnedComment()
598 {
599 return this.instanceSpecification.createOwnedComment();
600 }
601
602
603
604
605 public boolean validateNotOwnSelf(final DiagnosticChain diagnosticChain, final Map<Object, Object> map)
606 {
607 return this.instanceSpecification.validateNotOwnSelf(diagnosticChain, map);
608 }
609
610
611
612
613 public boolean validateHasOwner(final DiagnosticChain diagnosticChain, final Map<Object, Object> map)
614 {
615 return this.instanceSpecification.validateHasOwner(diagnosticChain, map);
616 }
617
618
619
620
621 public EList<Element> allOwnedElements()
622 {
623 return this.instanceSpecification.allOwnedElements();
624 }
625
626
627
628
629 public boolean mustBeOwned()
630 {
631 return this.instanceSpecification.mustBeOwned();
632 }
633
634
635
636
637 public EAnnotation createEAnnotation(final String string)
638 {
639 return this.instanceSpecification.createEAnnotation(string);
640 }
641
642
643
644
645 public EObject applyStereotype(final Stereotype stereotype)
646 {
647 return this.instanceSpecification.applyStereotype(stereotype);
648 }
649
650
651
652
653 public Stereotype getApplicableStereotype(final String string)
654 {
655 return this.instanceSpecification.getApplicableStereotype(string);
656 }
657
658
659
660
661 public EList<Stereotype> getApplicableStereotypes()
662 {
663 return this.instanceSpecification.getApplicableStereotypes();
664 }
665
666
667
668
669 public Stereotype getAppliedStereotype(final String string)
670 {
671 return this.instanceSpecification.getAppliedStereotype(string);
672 }
673
674
675
676
677 public EList<Stereotype> getAppliedStereotypes()
678 {
679 return this.instanceSpecification.getAppliedStereotypes();
680 }
681
682
683
684
685 public Model getModel()
686 {
687 return (Model) UmlUtilities.findModel(this.instanceSpecification);
688 }
689
690
691
692
693 public Package getNearestPackage()
694 {
695 return this.instanceSpecification.getNearestPackage();
696 }
697
698
699
700
701 public Object getValue(final Stereotype stereotype, final String string)
702 {
703 return this.instanceSpecification.getValue(stereotype, string);
704 }
705
706
707
708
709
710 public boolean isApplied(final Stereotype stereotype)
711 {
712 return this.instanceSpecification.isStereotypeApplied(stereotype);
713 }
714
715
716
717
718
719 public boolean isRequired(final Stereotype stereotype)
720 {
721 return this.instanceSpecification.isStereotypeRequired(stereotype);
722 }
723
724
725
726
727 public void setValue(final Stereotype stereotype, final String string, final Object object)
728 {
729 this.instanceSpecification.setValue(stereotype, string, object);
730 }
731
732
733
734
735 public boolean hasValue(final Stereotype stereotype, final String string)
736 {
737 return this.instanceSpecification.hasValue(stereotype, string);
738 }
739
740
741
742
743
744
745
746
747
748 public EObject unapplyStereotype(final Stereotype stereotype)
749 {
750 return this.instanceSpecification.unapplyStereotype(stereotype);
751 }
752
753
754
755
756 public void destroy()
757 {
758 this.instanceSpecification.destroy();
759 }
760
761
762
763
764
765
766
767
768
769 public boolean addKeyword(final String string)
770 {
771 return this.instanceSpecification.addKeyword(string);
772 }
773
774
775
776
777 public EList<String> getKeywords()
778 {
779 return this.instanceSpecification.getKeywords();
780 }
781
782
783
784
785 public boolean hasKeyword(final String string)
786 {
787 return this.instanceSpecification.hasKeyword(string);
788 }
789
790
791
792
793 public boolean removeKeyword(final String string)
794 {
795 return this.instanceSpecification.removeKeyword(string);
796 }
797
798
799
800
801 public EList<EAnnotation> getEAnnotations()
802 {
803 return this.instanceSpecification.getEAnnotations();
804 }
805
806
807
808
809 public EAnnotation getEAnnotation(final String string)
810 {
811 return this.instanceSpecification.getEAnnotation(string);
812 }
813
814
815
816
817 public EList<Adapter> eAdapters()
818 {
819 return this.instanceSpecification.eAdapters();
820 }
821
822
823
824
825 public boolean eDeliver()
826 {
827 return this.instanceSpecification.eDeliver();
828 }
829
830
831
832
833 public void eSetDeliver(final boolean deliver)
834 {
835 this.instanceSpecification.eSetDeliver(deliver);
836 }
837
838
839
840
841 public boolean eIsProxy()
842 {
843 return this.instanceSpecification.eIsProxy();
844 }
845
846
847
848
849 public EClass eClass()
850 {
851 return this.instanceSpecification.eClass();
852 }
853
854
855
856
857 public EObject eContainer()
858 {
859 return this.instanceSpecification.eContainer();
860 }
861
862
863
864
865 public EList<EObject> eContents()
866 {
867 return this.instanceSpecification.eContents();
868 }
869
870
871
872
873 public EList<EObject> eCrossReferences()
874 {
875 return this.instanceSpecification.eCrossReferences();
876 }
877
878
879
880
881 public TreeIterator<EObject> eAllContents()
882 {
883 return this.instanceSpecification.eAllContents();
884 }
885
886
887
888
889 public EReference eContainmentFeature()
890 {
891 return this.instanceSpecification.eContainmentFeature();
892 }
893
894
895
896
897 public EStructuralFeature eContainingFeature()
898 {
899 return this.instanceSpecification.eContainingFeature();
900 }
901
902
903
904
905 public Resource eResource()
906 {
907 return this.instanceSpecification.eResource();
908 }
909
910
911
912
913 public Object eGet(final EStructuralFeature eStructuralFeature)
914 {
915 return this.instanceSpecification.eGet(eStructuralFeature);
916 }
917
918
919
920
921 public void eNotify(final Notification notification)
922 {
923 this.instanceSpecification.eNotify(notification);
924 }
925
926
927
928
929 public ValueSpecification createSpecification(final String name, final Type type, final EClass eClass)
930 {
931 return this.instanceSpecification.createSpecification(name, type, eClass);
932 }
933
934
935
936
937 public boolean validateDefiningFeature(final DiagnosticChain diagnostics, final Map<Object, Object> context)
938 {
939 return this.instanceSpecification.validateDefiningFeature(diagnostics, context);
940 }
941
942
943
944
945 public boolean validateDeploymentArtifact(final DiagnosticChain diagnostics,
946 final Map<Object, Object> context)
947 {
948 return this.instanceSpecification.validateDeploymentArtifact(diagnostics, context);
949 }
950
951
952
953
954 public boolean validateDeploymentTarget(final DiagnosticChain diagnostics, final Map<Object, Object> context)
955 {
956 return this.instanceSpecification.validateDeploymentTarget(diagnostics, context);
957 }
958
959
960
961
962 public boolean validateStructuralFeature(final DiagnosticChain diagnostics,
963 final Map<Object, Object> context)
964 {
965 return this.instanceSpecification.validateStructuralFeature(diagnostics, context);
966 }
967
968
969
970
971 public EList<Package> allOwningPackages()
972 {
973 return this.instanceSpecification.allOwningPackages();
974 }
975
976
977
978
979 public StringExpression createNameExpression(final String name, final Type type)
980 {
981 return this.instanceSpecification.createNameExpression(name, type);
982 }
983
984
985
986
987 public Usage createUsage(final NamedElement supplier)
988 {
989 return this.instanceSpecification.createUsage(supplier);
990 }
991
992
993
994
995 public boolean isSetName()
996 {
997 return this.instanceSpecification.isSetName();
998 }
999
1000
1001
1002
1003 public boolean isSetVisibility()
1004 {
1005 return this.instanceSpecification.isSetVisibility();
1006 }
1007
1008
1009
1010
1011 public void unsetName()
1012 {
1013 this.instanceSpecification.unsetName();
1014 }
1015
1016
1017
1018
1019 public void unsetVisibility()
1020 {
1021 this.instanceSpecification.unsetVisibility();
1022 }
1023
1024
1025
1026
1027 public Stereotype getAppliedSubstereotype(final Stereotype stereotype, final String qualifiedName)
1028 {
1029 return this.instanceSpecification.getAppliedSubstereotype(stereotype, qualifiedName);
1030 }
1031
1032
1033
1034
1035 public EList<Stereotype> getAppliedSubstereotypes(final Stereotype stereotype)
1036 {
1037 return this.instanceSpecification.getAppliedSubstereotypes(stereotype);
1038 }
1039
1040
1041
1042
1043 public EList<Relationship> getRelationships()
1044 {
1045 return this.instanceSpecification.getRelationships();
1046 }
1047
1048
1049
1050
1051 public EList<Relationship> getRelationships(final EClass eClass)
1052 {
1053 return this.instanceSpecification.getRelationships(eClass);
1054 }
1055
1056
1057
1058
1059 public Stereotype getRequiredStereotype(final String qualifiedName)
1060 {
1061 return this.instanceSpecification.getRequiredStereotype(qualifiedName);
1062 }
1063
1064
1065
1066
1067 public EList<Stereotype> getRequiredStereotypes()
1068 {
1069 return this.instanceSpecification.getRequiredStereotypes();
1070 }
1071
1072
1073
1074
1075 public EList<DirectedRelationship> getSourceDirectedRelationships()
1076 {
1077 return this.instanceSpecification.getSourceDirectedRelationships();
1078 }
1079
1080
1081
1082
1083 public EList<DirectedRelationship> getSourceDirectedRelationships(final EClass eClass)
1084 {
1085 return this.instanceSpecification.getSourceDirectedRelationships(eClass);
1086 }
1087
1088
1089
1090
1091 public EObject getStereotypeApplication(final Stereotype stereotype)
1092 {
1093 return this.instanceSpecification.getStereotypeApplication(stereotype);
1094 }
1095
1096
1097
1098
1099 public EList<EObject> getStereotypeApplications()
1100 {
1101 return this.instanceSpecification.getStereotypeApplications();
1102 }
1103
1104
1105
1106
1107 public EList<DirectedRelationship> getTargetDirectedRelationships()
1108 {
1109 return this.instanceSpecification.getTargetDirectedRelationships();
1110 }
1111
1112
1113
1114
1115 public EList<DirectedRelationship> getTargetDirectedRelationships(final EClass eClass)
1116 {
1117 return this.instanceSpecification.getTargetDirectedRelationships(eClass);
1118 }
1119
1120
1121
1122
1123 public boolean isStereotypeApplicable(final Stereotype stereotype)
1124 {
1125 return this.instanceSpecification.isStereotypeApplicable(stereotype);
1126 }
1127
1128
1129
1130
1131 public boolean isStereotypeApplied(final Stereotype stereotype)
1132 {
1133 return this.instanceSpecification.isStereotypeApplied(stereotype);
1134 }
1135
1136
1137
1138
1139 public boolean isStereotypeRequired(final Stereotype stereotype)
1140 {
1141 return this.instanceSpecification.isStereotypeRequired(stereotype);
1142 }
1143
1144
1145
1146
1147 public TemplateParameter getOwningTemplateParameter()
1148 {
1149 return this.instanceSpecification.getTemplateParameter();
1150 }
1151
1152
1153
1154
1155 public boolean isCompatibleWith(final ParameterableElement param)
1156 {
1157 return this.instanceSpecification.isCompatibleWith(param);
1158 }
1159
1160
1161
1162
1163 public boolean isTemplateParameter()
1164 {
1165 return this.instanceSpecification.isTemplateParameter();
1166 }
1167
1168
1169
1170
1171 public void setOwningTemplateParameter(final TemplateParameter value)
1172 {
1173 this.instanceSpecification.setOwningTemplateParameter(value);
1174 }
1175
1176
1177
1178
1179
1180 public Object eInvoke(final EOperation operation, final EList<?> arguments) throws InvocationTargetException
1181 {
1182 return this.instanceSpecification.eInvoke(operation, arguments);
1183 }
1184
1185
1186
1187
1188
1189 @Override
1190 public boolean validateNamespaceNeedsVisibility(DiagnosticChain diagnostics, Map<Object, Object> context)
1191 {
1192 return this.instanceSpecification.validateNamespaceNeedsVisibility(diagnostics, context);
1193 }
1194 }