Skip to content
Snippets Groups Projects
Commit de065f88 authored by Florian Hölzl's avatar Florian Hölzl
Browse files

added improved base class => YELLOW

refs 437
parent d8bbfd29
No related branches found
No related tags found
No related merge requests found
......@@ -28,10 +28,14 @@ import org.fortiss.tooling.kernel.extension.data.IConstraintViolation;
* Base implementation for {@link IConstraintChecker}. It checks the model
* element against null and returns an unmodifiable empty list.
*
* @param <T>
* the model element class for elements to be checked by this
* constraint checker.
*
* @author mou
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 71E7C7994B89DFF53782600DB00DF8E1
* @ConQAT.Rating YELLOW Hash: 7A816E37EB8FA7634E27A501CA5C99A3
*/
public abstract class ConstraintCheckerBase<T extends EObject> implements
IConstraintChecker<T> {
......
......@@ -29,7 +29,7 @@ import org.fortiss.tooling.kernel.extension.data.IConstraintViolation;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 9DA8E3ED348BEB666713A27DF89CBD64
* @ConQAT.Rating YELLOW Hash: CC17BC4ED54FFD8211F02C90443F77C8
*/
public class ConstraintViolationBase<T extends EObject> implements
IConstraintViolation<T> {
......
/*--------------------------------------------------------------------------+
$Id$
| |
| Copyright 2011 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.tooling.kernel.extension.base;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.tooling.kernel.extension.IConstraintChecker;
import org.fortiss.tooling.kernel.extension.data.IConstraintViolation;
/**
* Base implementation for {@link IConstraintChecker}. It checks the model
* element against null and returns an unmodifiable empty list.
*
* @param <T>
* the model element class for elements to be checked by this
* constraint checker.
* @param <V>
* the model element class of violating elements. Use {@link EObject}
* as parameter value if you need multiple classes here.
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 63108397E80BABBB4828D0094A82C776
*/
public abstract class MultiViolationConstraintCheckerBase<T extends EObject, V extends EObject>
extends ConstraintCheckerBase<T> {
/** {@inheritDoc} */
@Override
public final List<? extends IConstraintViolation<V>> apply(T modelElement) {
List<IConstraintViolation<V>> results = new ArrayList<IConstraintViolation<V>>();
collectViolations(modelElement, results);
return results;
}
/** Collects the violations in the given result lists. */
protected abstract void collectViolations(T modelElement,
List<IConstraintViolation<V>> results);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment