source: trunk/CrossPare/src/de/ugoe/cs/cpdp/decentApp/DECENTResourceTool.java @ 42

Last change on this file since 42 was 41, checked in by sherbold, 9 years ago
  • formatted code and added copyrights
  • Property svn:mime-type set to text/plain
File size: 1.7 KB
Line 
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
15package de.ugoe.cs.cpdp.decentApp;
16
17import org.eclipse.emf.ecore.EValidator;
18import org.eclipse.emf.ecore.util.EObjectValidator;
19
20import de.ugoe.cs.cpdp.decentApp.models.decent.DECENTPackage;
21import de.ugoe.cs.cpdp.decentApp.models.decent.impl.DECENTPackageImpl;
22import 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 */
30public 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}
Note: See TracBrowser for help on using the repository browser.