1 | // Copyright 2015 Georg-August-Universität Göttingen, Germany |
---|
2 | // |
---|
3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
---|
4 | // you may not use this file except in compliance with the License. |
---|
5 | // You may obtain a copy of the License at |
---|
6 | // |
---|
7 | // http://www.apache.org/licenses/LICENSE-2.0 |
---|
8 | // |
---|
9 | // Unless required by applicable law or agreed to in writing, software |
---|
10 | // distributed under the License is distributed on an "AS IS" BASIS, |
---|
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
12 | // See the License for the specific language governing permissions and |
---|
13 | // limitations under the License. |
---|
14 | |
---|
15 | package de.ugoe.cs.cpdp.decentApp; |
---|
16 | |
---|
17 | import org.eclipse.emf.ecore.EValidator; |
---|
18 | import org.eclipse.emf.ecore.util.EObjectValidator; |
---|
19 | |
---|
20 | import de.ugoe.cs.cpdp.decentApp.models.decent.DECENTPackage; |
---|
21 | import de.ugoe.cs.cpdp.decentApp.models.decent.impl.DECENTPackageImpl; |
---|
22 | import de.ugoe.cs.cpdp.decentApp.models.decent.util.DECENTResourceFactoryImpl; |
---|
23 | |
---|
24 | /** |
---|
25 | * Class for handling decent model files |
---|
26 | * |
---|
27 | * @author Philip Makedonski, Fabian Trautsch |
---|
28 | * |
---|
29 | */ |
---|
30 | public class DECENTResourceTool extends ResourceTool { |
---|
31 | |
---|
32 | /** |
---|
33 | * Initializes the Tool Factory, from which the models can be loaded and inizializes the |
---|
34 | * validator. |
---|
35 | */ |
---|
36 | public DECENTResourceTool() { |
---|
37 | super(DECENTResourceTool.class.getName()); |
---|
38 | DECENTPackageImpl.init(); |
---|
39 | this.resourceFactory = new DECENTResourceFactoryImpl(); |
---|
40 | initializeValidator(); |
---|
41 | } |
---|
42 | |
---|
43 | /** |
---|
44 | * Inizializes the model validator |
---|
45 | */ |
---|
46 | @Override |
---|
47 | protected void initializeValidator() { |
---|
48 | super.initializeValidator(); |
---|
49 | EObjectValidator validator = new EObjectValidator(); |
---|
50 | EValidator.Registry.INSTANCE.put(DECENTPackage.eINSTANCE, validator); |
---|
51 | } |
---|
52 | |
---|
53 | } |
---|