aboutsummaryrefslogtreecommitdiffstats
path: root/Application/hu.bme.mit.inf.dslreasoner.application/xtend-gen/hu/bme/mit/inf/dslreasoner/application/validation/QueryAndMetamodelValidator.java
diff options
context:
space:
mode:
authorLibravatar OszkarSemerath <oszkar.semerath@gmail.com>2018-05-08 17:27:14 +0200
committerLibravatar OszkarSemerath <oszkar.semerath@gmail.com>2018-05-08 17:27:14 +0200
commitb4586542870d0e27b3d6da9fbd3eb30fd36d1d7f (patch)
tree57898cebbe0edf7a2228114cb095900a2d13d983 /Application/hu.bme.mit.inf.dslreasoner.application/xtend-gen/hu/bme/mit/inf/dslreasoner/application/validation/QueryAndMetamodelValidator.java
parentRefactored to the milestone version of Viatra 2.0 (diff)
downloadVIATRA-Generator-b4586542870d0e27b3d6da9fbd3eb30fd36d1d7f.tar.gz
VIATRA-Generator-b4586542870d0e27b3d6da9fbd3eb30fd36d1d7f.tar.zst
VIATRA-Generator-b4586542870d0e27b3d6da9fbd3eb30fd36d1d7f.zip
Regenerated Application Configuration Language
Diffstat (limited to 'Application/hu.bme.mit.inf.dslreasoner.application/xtend-gen/hu/bme/mit/inf/dslreasoner/application/validation/QueryAndMetamodelValidator.java')
-rw-r--r--Application/hu.bme.mit.inf.dslreasoner.application/xtend-gen/hu/bme/mit/inf/dslreasoner/application/validation/QueryAndMetamodelValidator.java23
1 files changed, 8 insertions, 15 deletions
diff --git a/Application/hu.bme.mit.inf.dslreasoner.application/xtend-gen/hu/bme/mit/inf/dslreasoner/application/validation/QueryAndMetamodelValidator.java b/Application/hu.bme.mit.inf.dslreasoner.application/xtend-gen/hu/bme/mit/inf/dslreasoner/application/validation/QueryAndMetamodelValidator.java
index 1365d64d..3ed13964 100644
--- a/Application/hu.bme.mit.inf.dslreasoner.application/xtend-gen/hu/bme/mit/inf/dslreasoner/application/validation/QueryAndMetamodelValidator.java
+++ b/Application/hu.bme.mit.inf.dslreasoner.application/xtend-gen/hu/bme/mit/inf/dslreasoner/application/validation/QueryAndMetamodelValidator.java
@@ -8,7 +8,6 @@ import java.util.LinkedList;
8import java.util.List; 8import java.util.List;
9import java.util.Set; 9import java.util.Set;
10import org.eclipse.emf.common.util.EList; 10import org.eclipse.emf.common.util.EList;
11import org.eclipse.emf.common.util.TreeIterator;
12import org.eclipse.emf.ecore.EAttribute; 11import org.eclipse.emf.ecore.EAttribute;
13import org.eclipse.emf.ecore.EClass; 12import org.eclipse.emf.ecore.EClass;
14import org.eclipse.emf.ecore.EClassifier; 13import org.eclipse.emf.ecore.EClassifier;
@@ -17,7 +16,7 @@ import org.eclipse.emf.ecore.EEnumLiteral;
17import org.eclipse.emf.ecore.ENamedElement; 16import org.eclipse.emf.ecore.ENamedElement;
18import org.eclipse.emf.ecore.EObject; 17import org.eclipse.emf.ecore.EObject;
19import org.eclipse.emf.ecore.EReference; 18import org.eclipse.emf.ecore.EReference;
20import org.eclipse.viatra.query.patternlanguage.patternLanguage.Pattern; 19import org.eclipse.viatra.query.patternlanguage.emf.vql.Pattern;
21import org.eclipse.xtend2.lib.StringConcatenation; 20import org.eclipse.xtend2.lib.StringConcatenation;
22import org.eclipse.xtext.xbase.lib.CollectionLiterals; 21import org.eclipse.xtext.xbase.lib.CollectionLiterals;
23import org.eclipse.xtext.xbase.lib.Functions.Function1; 22import org.eclipse.xtext.xbase.lib.Functions.Function1;
@@ -38,8 +37,7 @@ public class QueryAndMetamodelValidator {
38 List<EAttribute> _attributes = metamodel.getAttributes(); 37 List<EAttribute> _attributes = metamodel.getAttributes();
39 Iterable<ENamedElement> _plus_2 = Iterables.<ENamedElement>concat(_plus_1, _attributes); 38 Iterable<ENamedElement> _plus_2 = Iterables.<ENamedElement>concat(_plus_1, _attributes);
40 List<EReference> _references = metamodel.getReferences(); 39 List<EReference> _references = metamodel.getReferences();
41 Iterable<ENamedElement> _plus_3 = Iterables.<ENamedElement>concat(_plus_2, _references); 40 final Set<ENamedElement> elementsInMetamodel = IterableExtensions.<ENamedElement>toSet(Iterables.<ENamedElement>concat(_plus_2, _references));
42 final Set<ENamedElement> elementsInMetamodel = IterableExtensions.<ENamedElement>toSet(_plus_3);
43 final LinkedList<String> errors = new LinkedList<String>(); 41 final LinkedList<String> errors = new LinkedList<String>();
44 for (final Pattern pattern : patterns) { 42 for (final Pattern pattern : patterns) {
45 { 43 {
@@ -51,9 +49,9 @@ public class QueryAndMetamodelValidator {
51 StringConcatenation _builder = new StringConcatenation(); 49 StringConcatenation _builder = new StringConcatenation();
52 _builder.append("Pattern \""); 50 _builder.append("Pattern \"");
53 String _name = pattern.getName(); 51 String _name = pattern.getName();
54 _builder.append(_name, ""); 52 _builder.append(_name);
55 _builder.append("\" refers to an element \""); 53 _builder.append("\" refers to an element \"");
56 _builder.append(element, ""); 54 _builder.append(element);
57 _builder.append("\" that is not included to the selected metamodel!"); 55 _builder.append("\" that is not included to the selected metamodel!");
58 errors.add(_builder.toString()); 56 errors.add(_builder.toString());
59 } 57 }
@@ -64,11 +62,9 @@ public class QueryAndMetamodelValidator {
64 } 62 }
65 63
66 public Iterable<ENamedElement> getReferredNamedElements(final Pattern pattern) { 64 public Iterable<ENamedElement> getReferredNamedElements(final Pattern pattern) {
67 TreeIterator<EObject> _eAllContents = pattern.eAllContents(); 65 final List<EObject> elements = IteratorExtensions.<EObject>toList(pattern.eAllContents());
68 final List<EObject> elements = IteratorExtensions.<EObject>toList(_eAllContents);
69 final Function1<EObject, Iterable<ENamedElement>> _function = (EObject element) -> { 66 final Function1<EObject, Iterable<ENamedElement>> _function = (EObject element) -> {
70 EClass _eClass = element.eClass(); 67 final EList<EReference> references = element.eClass().getEAllReferences();
71 final EList<EReference> references = _eClass.getEAllReferences();
72 final Function1<EReference, Iterable<ENamedElement>> _function_1 = (EReference r) -> { 68 final Function1<EReference, Iterable<ENamedElement>> _function_1 = (EReference r) -> {
73 boolean _isMany = r.isMany(); 69 boolean _isMany = r.isMany();
74 if (_isMany) { 70 if (_isMany) {
@@ -83,11 +79,8 @@ public class QueryAndMetamodelValidator {
83 } 79 }
84 } 80 }
85 }; 81 };
86 List<Iterable<ENamedElement>> _map = ListExtensions.<EReference, Iterable<ENamedElement>>map(references, _function_1); 82 return Iterables.<ENamedElement>filter(Iterables.<ENamedElement>concat(ListExtensions.<EReference, Iterable<ENamedElement>>map(references, _function_1)), ENamedElement.class);
87 Iterable<ENamedElement> _flatten = Iterables.<ENamedElement>concat(_map);
88 return Iterables.<ENamedElement>filter(_flatten, ENamedElement.class);
89 }; 83 };
90 List<Iterable<ENamedElement>> _map = ListExtensions.<EObject, Iterable<ENamedElement>>map(elements, _function); 84 return Iterables.<ENamedElement>concat(ListExtensions.<EObject, Iterable<ENamedElement>>map(elements, _function));
91 return Iterables.<ENamedElement>concat(_map);
92 } 85 }
93} 86}