diff options
author | 2018-05-08 17:27:14 +0200 | |
---|---|---|
committer | 2018-05-08 17:27:14 +0200 | |
commit | b4586542870d0e27b3d6da9fbd3eb30fd36d1d7f (patch) | |
tree | 57898cebbe0edf7a2228114cb095900a2d13d983 /Application/hu.bme.mit.inf.dslreasoner.application/xtend-gen/hu/bme/mit/inf/dslreasoner/application/validation/QueryAndMetamodelValidator.java | |
parent | Refactored to the milestone version of Viatra 2.0 (diff) | |
download | VIATRA-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.java | 23 |
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; | |||
8 | import java.util.List; | 8 | import java.util.List; |
9 | import java.util.Set; | 9 | import java.util.Set; |
10 | import org.eclipse.emf.common.util.EList; | 10 | import org.eclipse.emf.common.util.EList; |
11 | import org.eclipse.emf.common.util.TreeIterator; | ||
12 | import org.eclipse.emf.ecore.EAttribute; | 11 | import org.eclipse.emf.ecore.EAttribute; |
13 | import org.eclipse.emf.ecore.EClass; | 12 | import org.eclipse.emf.ecore.EClass; |
14 | import org.eclipse.emf.ecore.EClassifier; | 13 | import org.eclipse.emf.ecore.EClassifier; |
@@ -17,7 +16,7 @@ import org.eclipse.emf.ecore.EEnumLiteral; | |||
17 | import org.eclipse.emf.ecore.ENamedElement; | 16 | import org.eclipse.emf.ecore.ENamedElement; |
18 | import org.eclipse.emf.ecore.EObject; | 17 | import org.eclipse.emf.ecore.EObject; |
19 | import org.eclipse.emf.ecore.EReference; | 18 | import org.eclipse.emf.ecore.EReference; |
20 | import org.eclipse.viatra.query.patternlanguage.patternLanguage.Pattern; | 19 | import org.eclipse.viatra.query.patternlanguage.emf.vql.Pattern; |
21 | import org.eclipse.xtend2.lib.StringConcatenation; | 20 | import org.eclipse.xtend2.lib.StringConcatenation; |
22 | import org.eclipse.xtext.xbase.lib.CollectionLiterals; | 21 | import org.eclipse.xtext.xbase.lib.CollectionLiterals; |
23 | import org.eclipse.xtext.xbase.lib.Functions.Function1; | 22 | import 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 | } |