Skip to content

Commit 934442c

Browse files
committed
ST6RI-896 Added Definition_directedUsage_SettingDelegate.
- Handles ActionDefinitions and ConstraintDefinitions specially, deriving "directedUsage" from "parameter" rather than "directedFeature".
1 parent 19d3867 commit 934442c

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*******************************************************************************
2+
* SysML 2 Pilot Implementation
3+
* Copyright (c) 2025 Model Driven Solutions, Inc.
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU Lesser General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU Lesser General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Lesser General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
*
18+
* @license LGPL-3.0-or-later <http://spdx.org/licenses/LGPL-3.0-or-later>
19+
*
20+
*******************************************************************************/
21+
22+
package org.omg.sysml.delegate.setting;
23+
24+
import org.eclipse.emf.common.util.EList;
25+
import org.eclipse.emf.ecore.EStructuralFeature;
26+
import org.eclipse.emf.ecore.InternalEObject;
27+
import org.eclipse.uml2.common.util.DerivedEObjectEList;
28+
import org.omg.sysml.lang.sysml.ActionDefinition;
29+
import org.omg.sysml.lang.sysml.ConstraintDefinition;
30+
import org.omg.sysml.lang.sysml.SysMLPackage;
31+
import org.omg.sysml.lang.sysml.Usage;
32+
33+
public class Definition_directedUsage_SettingDelegate extends DefaultDerivedPropertySettingDelegate {
34+
35+
public Definition_directedUsage_SettingDelegate(EStructuralFeature eStructuralFeature) {
36+
super(eStructuralFeature);
37+
}
38+
39+
@Override
40+
protected EList<?> basicGet(InternalEObject owner) {
41+
return owner instanceof ActionDefinition?
42+
new DerivedEObjectEList<>(Usage.class, owner, eStructuralFeature.getFeatureID(), new int[] {SysMLPackage.ACTION_DEFINITION__PARAMETER}):
43+
owner instanceof ConstraintDefinition?
44+
new DerivedEObjectEList<>(Usage.class, owner, eStructuralFeature.getFeatureID(), new int[] {SysMLPackage.CONSTRAINT_DEFINITION__PARAMETER}):
45+
super.basicGet(owner);
46+
}
47+
}

0 commit comments

Comments
 (0)