Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.osbp.xtext.datainterchange/src/org/eclipse/osbp/xtext/datainterchange/validation/DataDSLValidator.xtend')
-rw-r--r--org.eclipse.osbp.xtext.datainterchange/src/org/eclipse/osbp/xtext/datainterchange/validation/DataDSLValidator.xtend19
1 files changed, 15 insertions, 4 deletions
diff --git a/org.eclipse.osbp.xtext.datainterchange/src/org/eclipse/osbp/xtext/datainterchange/validation/DataDSLValidator.xtend b/org.eclipse.osbp.xtext.datainterchange/src/org/eclipse/osbp/xtext/datainterchange/validation/DataDSLValidator.xtend
index 816e8f4..d9df899 100644
--- a/org.eclipse.osbp.xtext.datainterchange/src/org/eclipse/osbp/xtext/datainterchange/validation/DataDSLValidator.xtend
+++ b/org.eclipse.osbp.xtext.datainterchange/src/org/eclipse/osbp/xtext/datainterchange/validation/DataDSLValidator.xtend
@@ -41,10 +41,12 @@ class DataDSLValidator extends AbstractDataDSLValidator {
def checkPostFunctionInterchange(DataInterchangePostFunction post){
if(post !== null && post.doExecuteFunction !== null && post.doExecuteFunction.params !== null){
if(!post.doExecuteFunction.params.empty){
- if(post.doExecuteFunction.params.size >=2){
+ if(post.doExecuteFunction.params.size >=3){
var type1 = post.doExecuteFunction.params.get(0).parameterType.type.qualifiedName
var params = post.doExecuteFunction.params.get(1)
var type2 = params.parameterType.type.qualifiedName
+ var params1 = post.doExecuteFunction.params.get(2)
+ var type3 = params1.parameterType.type.qualifiedName
if(!type1.equals("java.nio.file.Path")){
error("The first parameter of the chosen post function must be from type java.nio.file.Path", post, DataDSLPackage.Literals.DATA_INTERCHANGE_POST_FUNCTION__DO_EXECUTE_FUNCTION)
@@ -53,8 +55,12 @@ class DataDSLValidator extends AbstractDataDSLValidator {
error("The second parameter of the chosen post function must be from type HashMap<String,Parameter>,
\nwith Parameter from org.eclipse.osbp.xtext.datainterchange.common.WorkerThreadRunnable.Parameter .",
post, DataDSLPackage.Literals.DATA_INTERCHANGE_POST_FUNCTION__DO_EXECUTE_FUNCTION)
+ }
+ if(!type3.equals("java.util.List")){
+ error("The third parameter of the chosen post function must be from type java.util.List",
+ post, DataDSLPackage.Literals.DATA_INTERCHANGE_POST_FUNCTION__DO_EXECUTE_FUNCTION)
}else{
- // check the first 2 parameters of the function
+ // check the 2 type of the HashMap, the second parameter of the post fucntion
var param0 = (params.parameterType.eContents.get(0) as JvmParameterizedTypeReference).qualifiedName // String
var param1 = (params.parameterType.eContents.get(1) as JvmParameterizedTypeReference).qualifiedName // org.eclipse.osbp.xtext.datainterchange.common.WorkerThreadRunnable.Parameter
if(!param0.equals("java.lang.String")){
@@ -68,13 +74,13 @@ class DataDSLValidator extends AbstractDataDSLValidator {
}
}
else{
- error("The chosen post function must have at least two parameters from types java.nio.file.Path and HashMap<String,Parameter> in that order!
+ error("The chosen post function must have at least tree parameters from types java.nio.file.Path, HashMap<String,Parameter> and java.util.List in that order!
\nWith Parameter from org.eclipse.osbp.xtext.datainterchange.common.WorkerThreadRunnable.Parameter.",
post, DataDSLPackage.Literals.DATA_INTERCHANGE_POST_FUNCTION__DO_EXECUTE_FUNCTION)
}
}
else{
- error("The chosen post function must have at least two parameters from types java.nio.file.Path and HashMap<String,Parameter> in that order!
+ error("The chosen post function must have at least two parameters from types java.nio.file.Path, HashMap<String,Parameter> and java.util.List in that order!
\nWith Parameter from org.eclipse.osbp.xtext.datainterchange.common.WorkerThreadRunnable.Parameter.",
post, DataDSLPackage.Literals.DATA_INTERCHANGE_POST_FUNCTION__DO_EXECUTE_FUNCTION )
}
@@ -273,4 +279,9 @@ class DataDSLValidator extends AbstractDataDSLValidator {
}
}
+// @Check
+// def void checkDateValue(DataInterchange interchange) {
+// // check Date value
+// }
+
}

Back to the top