Commit 34103a6e authored by Johannes Eder's avatar Johannes Eder
Browse files

removed constraint utils

Issue-Ref: 3891
Issue-Url: https://af3-developer.fortiss.org/issues/3891

Signed-off-by: Johannes Eder's avatarJohannes Eder <eder@fortiss.org>
parent 76fece74
/*-------------------------------------------------------------------------+
| Copyright 2016 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.project.utils;
import static org.fortiss.af3.project.utils.ProjectUtils.getProjectConfigurationElement;
import java.util.List;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.af3.project.model.configuration.DevelopmentProcessConfiguration;
import org.fortiss.tooling.kernel.extension.base.ConstraintBases;
import org.fortiss.tooling.kernel.model.constraints.ConstraintInstance;
import org.fortiss.tooling.kernel.model.constraints.IConstraintInstanceContainer;
/**
* Constraints-related utility methods.
*
* @author aravantinos
*/
public class ConstraintsProjectUtils {
/** List of the constraints of the project of <code>context</code>. */
public static List<ConstraintInstance> getProjectConstraints(EObject context) {
DevelopmentProcessConfiguration config =
getProjectConfigurationElement(context, DevelopmentProcessConfiguration.class);
return config.getConstraintInstances();
}
/** Base class to simplify even more migrating from the old to the new constraint system. */
public static abstract class AF3ProjectConstraintBase extends ConstraintBases.ConstraintBase {
/** {@inheritDoc} */
@Override
public IConstraintInstanceContainer getConstraintInstanceContainer(EObject obj) {
return getProjectConfigurationElement(obj, DevelopmentProcessConfiguration.class);
}
}
/** Base class to simplify even more migrating from the old to the new constraint system. */
public static abstract class AF3ProjectConstraintCheckerBase
extends ConstraintBases.ConstraintCheckerBase {
/** {@inheritDoc} */
@Override
public IConstraintInstanceContainer getConstraintInstanceContainer(EObject obj) {
return getProjectConfigurationElement(obj, DevelopmentProcessConfiguration.class);
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment