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

Provided register method for constraint verifier service.

refs 2590
parent 147f6789
No related branches found
No related tags found
No related merge requests found
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="org.fortiss.af3.verification" xmlns="http://www.w3.org/2001/XMLSchema">
<schema targetNamespace="org.fortiss.tooling.kernel" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appinfo>
<meta.schema plugin="org.fortiss.tooling.kernel" id="constraintVerifier" name="Constraint Verifier"/>
</appinfo>
<documentation>
[Enter description of this extension point.]
DEPRECATED use IConstraintVerificationService.registerConstraintVerifier() instead.
</documentation>
</annotation>
......
......@@ -6,7 +6,7 @@
<meta.schema plugin="org.fortiss.tooling.kernel" id="eclipseResourcePostLoadProvider" name="Eclipse Resource Post Load Provider"/>
</appinfo>
<documentation>
Registers a location provider for Eclipse resource based storage.
DEPRECATED use IPersistencyService instead.
</documentation>
</annotation>
......
......@@ -6,7 +6,7 @@
<meta.schema plugin="org.fortiss.tooling.kernel" id="eclipseResourceStorageLocationProvider" name="Eclipse Resource Storage Location Provider"/>
</appinfo>
<documentation>
Registers a location provider for Eclipse resource based storage.
DEPRECATED use IPersistencyService instead.
</documentation>
</annotation>
......
......@@ -29,6 +29,8 @@ import org.fortiss.tooling.kernel.extension.data.ITopLevelElement;
* @version $Rev$
* @ConQAT.Rating GREEN Hash: 9D7025FE2AE6D9B3CAE8A20352705445
*/
@Deprecated
// FIXME: move to IPersistencyService
public interface IEclipseResourcePostLoadProvider {
/**
......
......@@ -55,6 +55,14 @@ public final class ConstraintVerificationService extends
KernelIntrospectionSystemService.getInstance().registerService(this);
}
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override
public <T extends IConstraint> void registerConstraintVerifier(IConstraintVerifier<T> verifier,
Class<T> constraintElementClass) {
addHandler(constraintElementClass, (IConstraintVerifier<IConstraint>)verifier);
}
/** {@inheritDoc} */
@Override
public String getIntrospectionDescription() {
......
......@@ -3,6 +3,7 @@ package org.fortiss.tooling.kernel.service;
import java.util.List;
import java.util.function.Consumer;
import org.fortiss.tooling.kernel.extension.IConstraintVerifier;
import org.fortiss.tooling.kernel.internal.ConstraintVerificationService;
import org.fortiss.tooling.kernel.model.constraints.IConstrained;
import org.fortiss.tooling.kernel.model.constraints.IConstraint;
......@@ -34,26 +35,30 @@ public interface IConstraintVerificationService {
return INSTANCE;
}
/** Registers the given verifier with the service. */
<T extends IConstraint> void registerConstraintVerifier(IConstraintVerifier<T> verifier,
Class<T> constraintElementClass);
/**
* @param constraint
* Verifies <code>constraint</code>. The framework always runs the verification in a
* command. Should not yield any "useless" change because verification should always
* update the constraint status and the checksums anyways.
*/
public void verify(IConstraint constraint);
void verify(IConstraint constraint);
/**
* @param constraint
* @return <code>true</code> if <code>constraint</code> is up to date.
*/
public boolean isUpToDate(IConstraint constraint);
boolean isUpToDate(IConstraint constraint);
/**
* @param status
* @return A list of possible automatic fixes for the (constraint of) <code>status</code>.
* A status should be candidate to fixing if it is anything but successful or outdated.
*/
public List<IFix> fixes(IConstraintVerificationStatus status);
List<IFix> fixes(IConstraintVerificationStatus status);
/** Interface for a "fix". */
public interface IFix {
......@@ -61,13 +66,13 @@ public interface IConstraintVerificationService {
* Description of the fix. Useful to allow the user distinguish the fix in case there are
* several.
*/
public String getDescription();
String getDescription();
/**
* @param status
* Fixes (the constraint of) <code>status</code>.
*/
public void runFix(IConstraintVerificationStatus status);
void runFix(IConstraintVerificationStatus status);
}
/** Utils. We store them to avoid having again thousands of different classes for one topic. */
......
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