diff options
author | 2019-02-05 23:54:03 +0100 | |
---|---|---|
committer | 2019-02-19 19:18:25 +0100 | |
commit | 7f7f934fe6ad11df96906d009eec68583fd46660 (patch) | |
tree | 17828b0e833bc89b2b796fcc7da6cb74d6ec3e9c /Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/naming/PackageNameProvider.java | |
parent | Generated files change (diff) | |
download | VIATRA-Generator-7f7f934fe6ad11df96906d009eec68583fd46660.tar.gz VIATRA-Generator-7f7f934fe6ad11df96906d009eec68583fd46660.tar.zst VIATRA-Generator-7f7f934fe6ad11df96906d009eec68583fd46660.zip |
[Stochastic] Fault tree transformation langauge
Diffstat (limited to 'Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/naming/PackageNameProvider.java')
-rw-r--r-- | Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/naming/PackageNameProvider.java | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/naming/PackageNameProvider.java b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/naming/PackageNameProvider.java new file mode 100644 index 00000000..5841dc75 --- /dev/null +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/naming/PackageNameProvider.java | |||
@@ -0,0 +1,46 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.faulttree.components.naming; | ||
2 | |||
3 | import com.google.inject.Inject; | ||
4 | import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.CftModel; | ||
5 | import org.eclipse.emf.ecore.EObject; | ||
6 | import org.eclipse.xtend.lib.annotations.FinalFieldsConstructor; | ||
7 | import org.eclipse.xtext.EcoreUtil2; | ||
8 | import org.eclipse.xtext.naming.IQualifiedNameConverter; | ||
9 | import org.eclipse.xtext.naming.QualifiedName; | ||
10 | import org.eclipse.xtext.xbase.lib.StringExtensions; | ||
11 | |||
12 | @SuppressWarnings("all") | ||
13 | public class PackageNameProvider { | ||
14 | private final IQualifiedNameConverter qualifiedNameConverter; | ||
15 | |||
16 | @FinalFieldsConstructor | ||
17 | @Inject | ||
18 | public PackageNameProvider(final IQualifiedNameConverter qualifiedNameConverter) { | ||
19 | super(); | ||
20 | this.qualifiedNameConverter = qualifiedNameConverter; | ||
21 | } | ||
22 | |||
23 | public QualifiedName getPackageName(final EObject eObj) { | ||
24 | QualifiedName _xblockexpression = null; | ||
25 | { | ||
26 | if ((eObj == null)) { | ||
27 | return QualifiedName.EMPTY; | ||
28 | } | ||
29 | CftModel _containerOfType = EcoreUtil2.<CftModel>getContainerOfType(eObj, CftModel.class); | ||
30 | String _packageName = null; | ||
31 | if (_containerOfType!=null) { | ||
32 | _packageName=_containerOfType.getPackageName(); | ||
33 | } | ||
34 | final String pacakgeName = _packageName; | ||
35 | QualifiedName _xifexpression = null; | ||
36 | boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(pacakgeName); | ||
37 | if (_isNullOrEmpty) { | ||
38 | _xifexpression = QualifiedName.EMPTY; | ||
39 | } else { | ||
40 | _xifexpression = this.qualifiedNameConverter.toQualifiedName(pacakgeName); | ||
41 | } | ||
42 | _xblockexpression = _xifexpression; | ||
43 | } | ||
44 | return _xblockexpression; | ||
45 | } | ||
46 | } | ||