| /******************************************************************************* |
| * Copyright (c) 2015 E.D.Willink and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * E.D.Willink - initial API and implementation |
| *******************************************************************************/ |
| package org.eclipse.qvtd.pivot.qvtimperative.utilities; |
| |
| import org.eclipse.emf.ecore.resource.ResourceSet; |
| import org.eclipse.jdt.annotation.NonNull; |
| import org.eclipse.jdt.annotation.Nullable; |
| import org.eclipse.ocl.pivot.internal.resource.ASResourceFactoryRegistry; |
| import org.eclipse.ocl.pivot.internal.utilities.EnvironmentFactoryInternal; |
| import org.eclipse.ocl.pivot.resource.ProjectManager; |
| import org.eclipse.qvtd.pivot.qvtbase.utilities.QVTbase; |
| import org.eclipse.qvtd.pivot.qvtimperative.model.QVTimperativeLibrary; |
| |
| /** |
| * The QVTimperative facade refines the QVTbase and OCL facades to enforce use of the QVTimperative Standard Library. |
| */ |
| public class QVTimperative extends QVTbase |
| { |
| public static @NonNull QVTimperative newInstance(@NonNull ProjectManager projectManager, @Nullable ResourceSet externalResourceSet) { |
| EnvironmentFactoryInternal environmentFactory = ASResourceFactoryRegistry.INSTANCE.createEnvironmentFactory(projectManager, externalResourceSet); |
| environmentFactory.getStandardLibrary().setDefaultStandardLibraryURI(QVTimperativeLibrary.STDLIB_URI); |
| QVTimperative qvt = new QVTimperative(environmentFactory); |
| if (externalResourceSet != null) { |
| environmentFactory.adapt(externalResourceSet); |
| } |
| return qvt; |
| } |
| |
| public QVTimperative(@NonNull EnvironmentFactoryInternal environmentFactory) { |
| super(environmentFactory); |
| } |
| |
| // @Override |
| // public @NonNull QVTiEnvironmentFactory getEnvironmentFactory() { |
| // return (QVTiEnvironmentFactory) super.getEnvironmentFactory(); |
| // } |
| } |