1+ /**
2+ * SysML 2 Pilot Implementation
3+ * Copyright (C) 2020 California Institute of Technology ("Caltech")
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+ package org.omg.sysml.xmi
21+
22+ import com.google.inject.Binder
23+ import org.eclipse.emf.ecore.resource.Resource
24+ import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl
25+ import org.eclipse.xtext.naming.IQualifiedNameConverter
26+ import org.eclipse.xtext.naming.IQualifiedNameProvider
27+ import org.eclipse.xtext.resource.IResourceDescriptions
28+ import org.eclipse.xtext.resource.generic.AbstractGenericResourceRuntimeModule
29+ import org.eclipse.xtext.resource.impl.ResourceSetBasedResourceDescriptions
30+ import org.omg.kerml.xtext.naming.KerMLQualifiedNameConverter
31+ import org.omg.kerml.xtext.naming.KerMLQualifiedNameProvider
32+ import org.omg.sysml.lang.sysml.util.IModelLibraryProvider
33+ import org.omg.sysml.xtext.library.SysMLLibraryProvider
34+
35+ class SysMLxRuntimeModule extends AbstractGenericResourceRuntimeModule {
36+
37+ public val EXTENSION = ' sysmlx'
38+ public static val SYSMLX_LANGUAGE_NAME = ' org.omg.sysml.sysmlx'
39+
40+ override protected getFileExtensions () {
41+ EXTENSION
42+ }
43+
44+ override protected getLanguageName () {
45+ SYSMLX_LANGUAGE_NAME
46+ }
47+
48+ override configure (Binder binder ) {
49+ super . configure(binder)
50+ binder. bind(Resource . Factory ). to(XMIResourceFactoryImpl )
51+ binder. bind(IResourceDescriptions ). to(ResourceSetBasedResourceDescriptions )
52+ }
53+
54+ override Class<? extends IQualifiedNameProvider > bindIQualifiedNameProvider () {
55+ KerMLQualifiedNameProvider
56+ }
57+
58+ def Class<? extends IQualifiedNameConverter > bindIQualifiedNameConverter () {
59+ KerMLQualifiedNameConverter
60+ }
61+
62+ def Class<? extends IModelLibraryProvider > bindIModelLLibraryProvider () {
63+ SysMLLibraryProvider
64+ }
65+ }
0 commit comments