Skip to content
This repository has been archived by the owner on Oct 12, 2021. It is now read-only.

Commit

Permalink
Refactored the Validator Interface and fixed failing unit tests.
Browse files Browse the repository at this point in the history
Change-Id: Ifc1ae0fdd43f5134301531dfbb6628f68e485641
Signed-off-by: Yash Khatri <yash.khatri@scania.com>
  • Loading branch information
yashkhatri committed Oct 11, 2018
1 parent f6a3eb7 commit b263ad3
Show file tree
Hide file tree
Showing 24 changed files with 694 additions and 944 deletions.
24 changes: 18 additions & 6 deletions src/main/java/org/eclipse/lyo/validation/Validator.java
Expand Up @@ -23,6 +23,7 @@
import org.eclipse.lyo.oslc4j.core.exception.OslcCoreApplicationException;
import org.eclipse.lyo.oslc4j.core.model.AbstractResource;
import org.eclipse.lyo.validation.shacl.ShaclShape;
import org.eclipse.lyo.validation.shacl.ValidationReport;
import org.eclipse.lyo.validation.shacl.ValidationResult;

/**
Expand All @@ -38,13 +39,16 @@ public interface Validator {
* @param resource Resource to be validated
*
* @return the validation result model
* @throws NoSuchMethodException
* @throws SecurityException
* @throws InstantiationException
*
* @see org.eclipse.lyo.validation.shacl.ShaclShapeFactory#createShaclShape(Class)
*/
ValidationResult validate(AbstractResource resource)
ValidationReport validate(AbstractResource resource)
throws OslcCoreApplicationException, URISyntaxException, ParseException,
IllegalAccessException, IllegalArgumentException, InvocationTargetException,
DatatypeConfigurationException;
DatatypeConfigurationException, InstantiationException, SecurityException, NoSuchMethodException;

/**
* Validate.
Expand All @@ -65,10 +69,15 @@ ValidationResult validate(AbstractResource resource)
* @throws InvocationTargetException the invocation target exception
* @throws DatatypeConfigurationException the datatype configuration exception
* @throws OslcCoreApplicationException the oslc core application exception
* @throws URISyntaxException
* @throws NoSuchMethodException
* @throws SecurityException
* @throws InstantiationException
* @throws IllegalArgumentException
*/
ValidationResult validate(Model dataModel, Model shapeModel)
ValidationReport validate(Model dataModel, Model shapeModel)
throws IllegalAccessException, InvocationTargetException,
DatatypeConfigurationException, OslcCoreApplicationException;
DatatypeConfigurationException, OslcCoreApplicationException, IllegalArgumentException, InstantiationException, SecurityException, NoSuchMethodException, URISyntaxException;

/**
* Validate <code>dataModel</code> against the {@link ShaclShape} that is constructed from
Expand All @@ -82,9 +91,12 @@ ValidationResult validate(Model dataModel, Model shapeModel)
* @param clazz Resource class with shape annotations
*
* @return Model with the validation results
* @throws NoSuchMethodException
* @throws SecurityException
* @throws InstantiationException
*/
ValidationResult validate(Model dataModel, Class<? extends AbstractResource> clazz)
ValidationReport validate(Model dataModel, Class<? extends AbstractResource> clazz)
throws IllegalAccessException, IllegalArgumentException, InvocationTargetException,
DatatypeConfigurationException, OslcCoreApplicationException, URISyntaxException,
ParseException;
ParseException, InstantiationException, SecurityException, NoSuchMethodException;
}

0 comments on commit b263ad3

Please sign in to comment.