/
DeploymentImpl.java
782 lines (731 loc) · 23.3 KB
/
DeploymentImpl.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
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
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
/*
* Copyright (c) 2005, 2018 IBM Corporation, CEA, and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
* IBM - initial API and implementation
* Kenn Hussey (CEA) - 327039, 418466, 451350, 485756
* Eike Stepper - 540786
* Kenn Hussey - 535301
*
*/
package org.eclipse.uml2.uml.internal.impl;
import java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EAnnotation;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.uml2.common.util.CacheAdapter;
import org.eclipse.uml2.common.util.DerivedUnionEObjectEList;
import org.eclipse.uml2.common.util.SubsetSupersetEObjectResolvingEList;
import org.eclipse.uml2.uml.Comment;
import org.eclipse.uml2.uml.DeployedArtifact;
import org.eclipse.uml2.uml.Deployment;
import org.eclipse.uml2.uml.DeploymentSpecification;
import org.eclipse.uml2.uml.DeploymentTarget;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.NamedElement;
import org.eclipse.uml2.uml.StringExpression;
import org.eclipse.uml2.uml.TemplateParameter;
import org.eclipse.uml2.uml.UMLPackage;
import org.eclipse.uml2.uml.VisibilityKind;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Deployment</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.uml2.uml.internal.impl.DeploymentImpl#getOwnedElements <em>Owned Element</em>}</li>
* <li>{@link org.eclipse.uml2.uml.internal.impl.DeploymentImpl#getOwner <em>Owner</em>}</li>
* <li>{@link org.eclipse.uml2.uml.internal.impl.DeploymentImpl#getSuppliers <em>Supplier</em>}</li>
* <li>{@link org.eclipse.uml2.uml.internal.impl.DeploymentImpl#getClients <em>Client</em>}</li>
* <li>{@link org.eclipse.uml2.uml.internal.impl.DeploymentImpl#getConfigurations <em>Configuration</em>}</li>
* <li>{@link org.eclipse.uml2.uml.internal.impl.DeploymentImpl#getDeployedArtifacts <em>Deployed Artifact</em>}</li>
* <li>{@link org.eclipse.uml2.uml.internal.impl.DeploymentImpl#getLocation <em>Location</em>}</li>
* </ul>
*
* @generated
*/
public class DeploymentImpl
extends DependencyImpl
implements Deployment {
/**
* The cached value of the '{@link #getConfigurations() <em>Configuration</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getConfigurations()
* @generated
* @ordered
*/
protected EList<DeploymentSpecification> configurations;
/**
* The cached value of the '{@link #getDeployedArtifacts() <em>Deployed Artifact</em>}' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDeployedArtifacts()
* @generated
* @ordered
*/
protected EList<DeployedArtifact> deployedArtifacts;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected DeploymentImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return UMLPackage.Literals.DEPLOYMENT;
}
@SuppressWarnings("unused")
private EList<?> createSubsetSupersetList(
EStructuralFeature eStructuralFeature) {
if (eStructuralFeature == UMLPackage.Literals.DEPENDENCY__CLIENT) {
return createClientsList();
}
if (eStructuralFeature == UMLPackage.Literals.DEPLOYMENT__DEPLOYED_ARTIFACT) {
return createDeployedArtifactsList();
}
if (eStructuralFeature == UMLPackage.Literals.DEPENDENCY__SUPPLIER) {
return createSuppliersList();
}
return null;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EList<Element> getOwnedElements() {
CacheAdapter cache = getCacheAdapter();
if (cache != null) {
Resource eResource = eResource();
@SuppressWarnings("unchecked")
EList<Element> ownedElements = (EList<Element>) cache.get(eResource,
this, UMLPackage.Literals.ELEMENT__OWNED_ELEMENT);
if (ownedElements == null) {
cache.put(eResource, this,
UMLPackage.Literals.ELEMENT__OWNED_ELEMENT,
ownedElements = new DerivedUnionEObjectEList<Element>(
Element.class, this,
UMLPackage.DEPLOYMENT__OWNED_ELEMENT,
OWNED_ELEMENT_ESUBSETS));
}
return ownedElements;
}
return new DerivedUnionEObjectEList<Element>(Element.class, this,
UMLPackage.DEPLOYMENT__OWNED_ELEMENT, OWNED_ELEMENT_ESUBSETS);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT_CDO
*/
@Override
public EList<NamedElement> getSuppliers() {
if (suppliers == null) {
suppliers = createSuppliersList();
}
return suppliers;
}
private EList<NamedElement> createSuppliersList() {
return new SubsetSupersetEObjectResolvingEList<NamedElement>(
NamedElement.class, this, UMLPackage.DEPLOYMENT__SUPPLIER, null,
SUPPLIER_ESUBSETS);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT_CDO
*/
@Override
public EList<NamedElement> getClients() {
if (clients == null) {
clients = createClientsList();
}
return clients;
}
private EList<NamedElement> createClientsList() {
return new SubsetSupersetEObjectResolvingEList<NamedElement>(
NamedElement.class, this, UMLPackage.DEPLOYMENT__CLIENT, null,
CLIENT_ESUBSETS);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT_CDO
*/
public EList<DeployedArtifact> getDeployedArtifacts() {
if (deployedArtifacts == null) {
deployedArtifacts = createDeployedArtifactsList();
}
return deployedArtifacts;
}
private EList<DeployedArtifact> createDeployedArtifactsList() {
return new SubsetSupersetEObjectResolvingEList<DeployedArtifact>(
DeployedArtifact.class, this,
UMLPackage.DEPLOYMENT__DEPLOYED_ARTIFACT,
DEPLOYED_ARTIFACT_ESUPERSETS, null);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<DeploymentSpecification> getConfigurations() {
if (configurations == null) {
configurations = new EObjectContainmentWithInverseEList.Resolving<DeploymentSpecification>(
DeploymentSpecification.class, this,
UMLPackage.DEPLOYMENT__CONFIGURATION,
UMLPackage.DEPLOYMENT_SPECIFICATION__DEPLOYMENT);
}
return configurations;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public DeploymentSpecification createConfiguration(String name) {
DeploymentSpecification newConfiguration = (DeploymentSpecification) create(
UMLPackage.Literals.DEPLOYMENT_SPECIFICATION);
getConfigurations().add(newConfiguration);
if (name != null)
newConfiguration.setName(name);
return newConfiguration;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public DeploymentSpecification getConfiguration(String name) {
return getConfiguration(name, false, false);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public DeploymentSpecification getConfiguration(String name,
boolean ignoreCase, boolean createOnDemand) {
configurationLoop : for (DeploymentSpecification configuration : getConfigurations()) {
if (name != null && !(ignoreCase
? name.equalsIgnoreCase(configuration.getName())
: name.equals(configuration.getName())))
continue configurationLoop;
return configuration;
}
return createOnDemand
? createConfiguration(name)
: null;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public DeploymentTarget getLocation() {
if (eContainerFeatureID() != UMLPackage.DEPLOYMENT__LOCATION)
return null;
return (DeploymentTarget) eContainer();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public DeploymentTarget basicGetLocation() {
if (eContainerFeatureID() != UMLPackage.DEPLOYMENT__LOCATION)
return null;
return (DeploymentTarget) eInternalContainer();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetLocation(DeploymentTarget newLocation,
NotificationChain msgs) {
msgs = eBasicSetContainer((InternalEObject) newLocation,
UMLPackage.DEPLOYMENT__LOCATION, msgs);
Resource.Internal eInternalResource = eInternalResource();
if (eInternalResource == null || !eInternalResource.isLoading()) {
if (newLocation != null) {
EList<NamedElement> clients = getClients();
if (!clients.contains(newLocation)) {
clients.add(newLocation);
}
}
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setLocation(DeploymentTarget newLocation) {
if (newLocation != eInternalContainer()
|| (eContainerFeatureID() != UMLPackage.DEPLOYMENT__LOCATION
&& newLocation != null)) {
if (EcoreUtil.isAncestor(this, newLocation))
throw new IllegalArgumentException(
"Recursive containment not allowed for " + toString()); //$NON-NLS-1$
NotificationChain msgs = null;
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
if (newLocation != null)
msgs = ((InternalEObject) newLocation).eInverseAdd(this,
UMLPackage.DEPLOYMENT_TARGET__DEPLOYMENT,
DeploymentTarget.class, msgs);
msgs = basicSetLocation(newLocation, msgs);
if (msgs != null)
msgs.dispatch();
} else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
UMLPackage.DEPLOYMENT__LOCATION, newLocation, newLocation));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd,
int featureID, NotificationChain msgs) {
switch (featureID) {
case UMLPackage.DEPLOYMENT__EANNOTATIONS :
return ((InternalEList<InternalEObject>) (InternalEList<?>) getEAnnotations())
.basicAdd(otherEnd, msgs);
case UMLPackage.DEPLOYMENT__OWNING_TEMPLATE_PARAMETER :
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
return basicSetOwningTemplateParameter(
(TemplateParameter) otherEnd, msgs);
case UMLPackage.DEPLOYMENT__TEMPLATE_PARAMETER :
if (templateParameter != null)
msgs = ((InternalEObject) templateParameter).eInverseRemove(
this,
UMLPackage.TEMPLATE_PARAMETER__PARAMETERED_ELEMENT,
TemplateParameter.class, msgs);
return basicSetTemplateParameter((TemplateParameter) otherEnd,
msgs);
case UMLPackage.DEPLOYMENT__CONFIGURATION :
return ((InternalEList<InternalEObject>) (InternalEList<?>) getConfigurations())
.basicAdd(otherEnd, msgs);
case UMLPackage.DEPLOYMENT__LOCATION :
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
return basicSetLocation((DeploymentTarget) otherEnd, msgs);
}
return eDynamicInverseAdd(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd,
int featureID, NotificationChain msgs) {
switch (featureID) {
case UMLPackage.DEPLOYMENT__EANNOTATIONS :
return ((InternalEList<?>) getEAnnotations())
.basicRemove(otherEnd, msgs);
case UMLPackage.DEPLOYMENT__OWNED_COMMENT :
return ((InternalEList<?>) getOwnedComments())
.basicRemove(otherEnd, msgs);
case UMLPackage.DEPLOYMENT__NAME_EXPRESSION :
return basicSetNameExpression(null, msgs);
case UMLPackage.DEPLOYMENT__OWNING_TEMPLATE_PARAMETER :
return basicSetOwningTemplateParameter(null, msgs);
case UMLPackage.DEPLOYMENT__TEMPLATE_PARAMETER :
return basicSetTemplateParameter(null, msgs);
case UMLPackage.DEPLOYMENT__CONFIGURATION :
return ((InternalEList<?>) getConfigurations())
.basicRemove(otherEnd, msgs);
case UMLPackage.DEPLOYMENT__LOCATION :
return basicSetLocation(null, msgs);
}
return eDynamicInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eBasicRemoveFromContainerFeature(
NotificationChain msgs) {
switch (eContainerFeatureID()) {
case UMLPackage.DEPLOYMENT__OWNING_TEMPLATE_PARAMETER :
return eInternalContainer().eInverseRemove(this,
UMLPackage.TEMPLATE_PARAMETER__OWNED_PARAMETERED_ELEMENT,
TemplateParameter.class, msgs);
case UMLPackage.DEPLOYMENT__LOCATION :
return eInternalContainer().eInverseRemove(this,
UMLPackage.DEPLOYMENT_TARGET__DEPLOYMENT,
DeploymentTarget.class, msgs);
}
return eDynamicBasicRemoveFromContainer(msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case UMLPackage.DEPLOYMENT__EANNOTATIONS :
return getEAnnotations();
case UMLPackage.DEPLOYMENT__OWNED_COMMENT :
return getOwnedComments();
case UMLPackage.DEPLOYMENT__OWNED_ELEMENT :
return getOwnedElements();
case UMLPackage.DEPLOYMENT__OWNER :
if (resolve)
return getOwner();
return basicGetOwner();
case UMLPackage.DEPLOYMENT__CLIENT_DEPENDENCY :
return getClientDependencies();
case UMLPackage.DEPLOYMENT__NAME :
return getName();
case UMLPackage.DEPLOYMENT__NAME_EXPRESSION :
if (resolve)
return getNameExpression();
return basicGetNameExpression();
case UMLPackage.DEPLOYMENT__NAMESPACE :
if (resolve)
return getNamespace();
return basicGetNamespace();
case UMLPackage.DEPLOYMENT__QUALIFIED_NAME :
return getQualifiedName();
case UMLPackage.DEPLOYMENT__VISIBILITY :
return getVisibility();
case UMLPackage.DEPLOYMENT__OWNING_TEMPLATE_PARAMETER :
if (resolve)
return getOwningTemplateParameter();
return basicGetOwningTemplateParameter();
case UMLPackage.DEPLOYMENT__TEMPLATE_PARAMETER :
if (resolve)
return getTemplateParameter();
return basicGetTemplateParameter();
case UMLPackage.DEPLOYMENT__RELATED_ELEMENT :
return getRelatedElements();
case UMLPackage.DEPLOYMENT__SOURCE :
return getSources();
case UMLPackage.DEPLOYMENT__TARGET :
return getTargets();
case UMLPackage.DEPLOYMENT__CLIENT :
return getClients();
case UMLPackage.DEPLOYMENT__SUPPLIER :
return getSuppliers();
case UMLPackage.DEPLOYMENT__CONFIGURATION :
return getConfigurations();
case UMLPackage.DEPLOYMENT__DEPLOYED_ARTIFACT :
return getDeployedArtifacts();
case UMLPackage.DEPLOYMENT__LOCATION :
if (resolve)
return getLocation();
return basicGetLocation();
}
return eDynamicGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case UMLPackage.DEPLOYMENT__EANNOTATIONS :
getEAnnotations().clear();
getEAnnotations()
.addAll((Collection<? extends EAnnotation>) newValue);
return;
case UMLPackage.DEPLOYMENT__OWNED_COMMENT :
getOwnedComments().clear();
getOwnedComments()
.addAll((Collection<? extends Comment>) newValue);
return;
case UMLPackage.DEPLOYMENT__NAME :
setName((String) newValue);
return;
case UMLPackage.DEPLOYMENT__NAME_EXPRESSION :
setNameExpression((StringExpression) newValue);
return;
case UMLPackage.DEPLOYMENT__VISIBILITY :
setVisibility((VisibilityKind) newValue);
return;
case UMLPackage.DEPLOYMENT__OWNING_TEMPLATE_PARAMETER :
setOwningTemplateParameter((TemplateParameter) newValue);
return;
case UMLPackage.DEPLOYMENT__TEMPLATE_PARAMETER :
setTemplateParameter((TemplateParameter) newValue);
return;
case UMLPackage.DEPLOYMENT__CLIENT :
getClients().clear();
getClients()
.addAll((Collection<? extends NamedElement>) newValue);
return;
case UMLPackage.DEPLOYMENT__SUPPLIER :
getSuppliers().clear();
getSuppliers()
.addAll((Collection<? extends NamedElement>) newValue);
return;
case UMLPackage.DEPLOYMENT__CONFIGURATION :
getConfigurations().clear();
getConfigurations().addAll(
(Collection<? extends DeploymentSpecification>) newValue);
return;
case UMLPackage.DEPLOYMENT__DEPLOYED_ARTIFACT :
getDeployedArtifacts().clear();
getDeployedArtifacts()
.addAll((Collection<? extends DeployedArtifact>) newValue);
return;
case UMLPackage.DEPLOYMENT__LOCATION :
setLocation((DeploymentTarget) newValue);
return;
}
eDynamicSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case UMLPackage.DEPLOYMENT__EANNOTATIONS :
getEAnnotations().clear();
return;
case UMLPackage.DEPLOYMENT__OWNED_COMMENT :
getOwnedComments().clear();
return;
case UMLPackage.DEPLOYMENT__NAME :
unsetName();
return;
case UMLPackage.DEPLOYMENT__NAME_EXPRESSION :
setNameExpression((StringExpression) null);
return;
case UMLPackage.DEPLOYMENT__VISIBILITY :
unsetVisibility();
return;
case UMLPackage.DEPLOYMENT__OWNING_TEMPLATE_PARAMETER :
setOwningTemplateParameter((TemplateParameter) null);
return;
case UMLPackage.DEPLOYMENT__TEMPLATE_PARAMETER :
setTemplateParameter((TemplateParameter) null);
return;
case UMLPackage.DEPLOYMENT__CLIENT :
getClients().clear();
return;
case UMLPackage.DEPLOYMENT__SUPPLIER :
getSuppliers().clear();
return;
case UMLPackage.DEPLOYMENT__CONFIGURATION :
getConfigurations().clear();
return;
case UMLPackage.DEPLOYMENT__DEPLOYED_ARTIFACT :
getDeployedArtifacts().clear();
return;
case UMLPackage.DEPLOYMENT__LOCATION :
setLocation((DeploymentTarget) null);
return;
}
eDynamicUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case UMLPackage.DEPLOYMENT__EANNOTATIONS :
return eAnnotations != null && !eAnnotations.isEmpty();
case UMLPackage.DEPLOYMENT__OWNED_COMMENT :
return ownedComments != null && !ownedComments.isEmpty();
case UMLPackage.DEPLOYMENT__OWNED_ELEMENT :
return isSetOwnedElements();
case UMLPackage.DEPLOYMENT__OWNER :
return isSetOwner();
case UMLPackage.DEPLOYMENT__CLIENT_DEPENDENCY :
return !getClientDependencies().isEmpty();
case UMLPackage.DEPLOYMENT__NAME :
return isSetName();
case UMLPackage.DEPLOYMENT__NAME_EXPRESSION :
return nameExpression != null;
case UMLPackage.DEPLOYMENT__NAMESPACE :
return isSetNamespace();
case UMLPackage.DEPLOYMENT__QUALIFIED_NAME :
return QUALIFIED_NAME_EDEFAULT == null
? getQualifiedName() != null
: !QUALIFIED_NAME_EDEFAULT.equals(getQualifiedName());
case UMLPackage.DEPLOYMENT__VISIBILITY :
return isSetVisibility();
case UMLPackage.DEPLOYMENT__OWNING_TEMPLATE_PARAMETER :
return basicGetOwningTemplateParameter() != null;
case UMLPackage.DEPLOYMENT__TEMPLATE_PARAMETER :
return templateParameter != null;
case UMLPackage.DEPLOYMENT__RELATED_ELEMENT :
return isSetRelatedElements();
case UMLPackage.DEPLOYMENT__SOURCE :
return isSetSources();
case UMLPackage.DEPLOYMENT__TARGET :
return isSetTargets();
case UMLPackage.DEPLOYMENT__CLIENT :
return clients != null && !clients.isEmpty();
case UMLPackage.DEPLOYMENT__SUPPLIER :
return suppliers != null && !suppliers.isEmpty();
case UMLPackage.DEPLOYMENT__CONFIGURATION :
return configurations != null && !configurations.isEmpty();
case UMLPackage.DEPLOYMENT__DEPLOYED_ARTIFACT :
return deployedArtifacts != null
&& !deployedArtifacts.isEmpty();
case UMLPackage.DEPLOYMENT__LOCATION :
return basicGetLocation() != null;
}
return eDynamicIsSet(featureID);
}
/**
* The array of subset feature identifiers for the '{@link #getOwnedElements() <em>Owned Element</em>}' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOwnedElements()
* @generated
* @ordered
*/
protected static final int[] OWNED_ELEMENT_ESUBSETS = new int[]{
UMLPackage.DEPLOYMENT__OWNED_COMMENT,
UMLPackage.DEPLOYMENT__NAME_EXPRESSION,
UMLPackage.DEPLOYMENT__CONFIGURATION};
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Element getOwner() {
Element owner = basicGetOwner();
return owner != null && owner.eIsProxy()
? (Element) eResolveProxy((InternalEObject) owner)
: owner;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Element basicGetOwner() {
DeploymentTarget location = basicGetLocation();
if (location != null) {
return location;
}
return super.basicGetOwner();
}
/**
* The array of subset feature identifiers for the '{@link #getSuppliers() <em>Supplier</em>}' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSuppliers()
* @generated
* @ordered
*/
protected static final int[] SUPPLIER_ESUBSETS = new int[]{
UMLPackage.DEPLOYMENT__DEPLOYED_ARTIFACT};
/**
* The array of subset feature identifiers for the '{@link #getClients() <em>Client</em>}' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getClients()
* @generated
* @ordered
*/
protected static final int[] CLIENT_ESUBSETS = new int[]{
UMLPackage.DEPLOYMENT__LOCATION};
/**
* The array of superset feature identifiers for the '{@link #getDeployedArtifacts() <em>Deployed Artifact</em>}' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDeployedArtifacts()
* @generated
* @ordered
*/
protected static final int[] DEPLOYED_ARTIFACT_ESUPERSETS = new int[]{
UMLPackage.DEPLOYMENT__SUPPLIER};
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public DeployedArtifact getDeployedArtifact(String name) {
return getDeployedArtifact(name, false, null);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public DeployedArtifact getDeployedArtifact(String name, boolean ignoreCase,
EClass eClass) {
deployedArtifactLoop : for (DeployedArtifact deployedArtifact : getDeployedArtifacts()) {
if (eClass != null && !eClass.isInstance(deployedArtifact))
continue deployedArtifactLoop;
if (name != null && !(ignoreCase
? name.equalsIgnoreCase(deployedArtifact.getName())
: name.equals(deployedArtifact.getName())))
continue deployedArtifactLoop;
return deployedArtifact;
}
return null;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean isSetOwnedElements() {
return super.isSetOwnedElements()
|| eIsSet(UMLPackage.DEPLOYMENT__CONFIGURATION);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean isSetOwner() {
return super.isSetOwner() || eIsSet(UMLPackage.DEPLOYMENT__LOCATION);
}
} //DeploymentImpl