Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'examples/headless-maven/incquery-demo/src/main/java/headless')
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/.ClassesInPackageHierarchyMatch.java._tracebin3602 -> 0 bytes
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/.ClassesInPackageHierarchyMatcher.java._tracebin6103 -> 0 bytes
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/.ClassesInPackageMatch.java._tracebin3602 -> 0 bytes
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/.ClassesInPackageMatcher.java._tracebin6103 -> 0 bytes
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/.EClassMatch.java._tracebin2741 -> 0 bytes
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/.EClassMatcher.java._tracebin3766 -> 0 bytes
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/.EClassNamesKeywordMatch.java._tracebin3602 -> 0 bytes
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/.EClassNamesKeywordMatcher.java._tracebin6103 -> 0 bytes
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/.EClassNamesMatch.java._tracebin3602 -> 0 bytes
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/.EClassNamesMatcher.java._tracebin6103 -> 0 bytes
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/.EObjectMatch.java._tracebin2495 -> 0 bytes
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/.EObjectMatcher.java._tracebin3397 -> 0 bytes
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/.EPackageMatch.java._tracebin2741 -> 0 bytes
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/.EPackageMatcher.java._tracebin3766 -> 0 bytes
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/.HeadlessQueries.java._tracebin240 -> 0 bytes
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/.HeadlessQueriesMatchers.java._tracebin527 -> 0 bytes
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/.SubPackageMatch.java._tracebin3602 -> 0 bytes
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/.SubPackageMatcher.java._tracebin6103 -> 0 bytes
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/ClassesInPackageHierarchyMatch.java181
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/ClassesInPackageHierarchyMatcher.java317
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/ClassesInPackageMatch.java181
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/ClassesInPackageMatcher.java310
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/EClassMatch.java157
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/EClassMatcher.java244
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/EClassNamesKeywordMatch.java180
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/EClassNamesKeywordMatcher.java312
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/EClassNamesMatch.java180
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/EClassNamesMatcher.java310
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/EObjectMatch.java157
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/EObjectMatcher.java244
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/EPackageMatch.java157
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/EPackageMatcher.java244
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/HeadlessQueries.java65
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/HeadlessQueriesMatchers.java54
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/SubPackageMatch.java180
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/SubPackageMatcher.java309
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/util/.ClassesInPackageHierarchyProcessor.java._tracebin732 -> 0 bytes
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/util/.ClassesInPackageHierarchyQuerySpecification.java._tracebin1388 -> 0 bytes
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/util/.ClassesInPackageProcessor.java._tracebin732 -> 0 bytes
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/util/.ClassesInPackageQuerySpecification.java._tracebin1388 -> 0 bytes
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/util/.EClassNamesKeywordProcessor.java._tracebin732 -> 0 bytes
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/util/.EClassNamesKeywordQuerySpecification.java._tracebin1757 -> 0 bytes
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/util/.EClassNamesProcessor.java._tracebin732 -> 0 bytes
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/util/.EClassNamesQuerySpecification.java._tracebin1388 -> 0 bytes
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/util/.EClassProcessor.java._tracebin609 -> 0 bytes
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/util/.EClassQuerySpecification.java._tracebin1388 -> 0 bytes
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/util/.EObjectProcessor.java._tracebin568 -> 0 bytes
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/util/.EObjectQuerySpecification.java._tracebin1388 -> 0 bytes
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/util/.EPackageProcessor.java._tracebin609 -> 0 bytes
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/util/.EPackageQuerySpecification.java._tracebin1388 -> 0 bytes
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/util/.SubPackageProcessor.java._tracebin732 -> 0 bytes
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/util/.SubPackageQuerySpecification.java._tracebin1388 -> 0 bytes
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/util/ClassesInPackageHierarchyProcessor.java29
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/util/ClassesInPackageHierarchyQuerySpecification.java150
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/util/ClassesInPackageProcessor.java29
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/util/ClassesInPackageQuerySpecification.java124
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/util/EClassNamesKeywordProcessor.java28
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/util/EClassNamesKeywordQuerySpecification.java142
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/util/EClassNamesProcessor.java28
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/util/EClassNamesQuerySpecification.java115
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/util/EClassProcessor.java27
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/util/EClassQuerySpecification.java123
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/util/EObjectProcessor.java27
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/util/EObjectQuerySpecification.java110
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/util/EPackageProcessor.java27
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/util/EPackageQuerySpecification.java124
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/util/SubPackageProcessor.java28
-rw-r--r--examples/headless-maven/incquery-demo/src/main/java/headless/util/SubPackageQuerySpecification.java122
68 files changed, 0 insertions, 5015 deletions
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/.ClassesInPackageHierarchyMatch.java._trace b/examples/headless-maven/incquery-demo/src/main/java/headless/.ClassesInPackageHierarchyMatch.java._trace
deleted file mode 100644
index 765d67252..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/.ClassesInPackageHierarchyMatch.java._trace
+++ /dev/null
Binary files differ
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/.ClassesInPackageHierarchyMatcher.java._trace b/examples/headless-maven/incquery-demo/src/main/java/headless/.ClassesInPackageHierarchyMatcher.java._trace
deleted file mode 100644
index eec5093ea..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/.ClassesInPackageHierarchyMatcher.java._trace
+++ /dev/null
Binary files differ
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/.ClassesInPackageMatch.java._trace b/examples/headless-maven/incquery-demo/src/main/java/headless/.ClassesInPackageMatch.java._trace
deleted file mode 100644
index e76129529..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/.ClassesInPackageMatch.java._trace
+++ /dev/null
Binary files differ
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/.ClassesInPackageMatcher.java._trace b/examples/headless-maven/incquery-demo/src/main/java/headless/.ClassesInPackageMatcher.java._trace
deleted file mode 100644
index 1f5095f35..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/.ClassesInPackageMatcher.java._trace
+++ /dev/null
Binary files differ
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/.EClassMatch.java._trace b/examples/headless-maven/incquery-demo/src/main/java/headless/.EClassMatch.java._trace
deleted file mode 100644
index 341925451..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/.EClassMatch.java._trace
+++ /dev/null
Binary files differ
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/.EClassMatcher.java._trace b/examples/headless-maven/incquery-demo/src/main/java/headless/.EClassMatcher.java._trace
deleted file mode 100644
index 25aab0115..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/.EClassMatcher.java._trace
+++ /dev/null
Binary files differ
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/.EClassNamesKeywordMatch.java._trace b/examples/headless-maven/incquery-demo/src/main/java/headless/.EClassNamesKeywordMatch.java._trace
deleted file mode 100644
index a07ff775d..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/.EClassNamesKeywordMatch.java._trace
+++ /dev/null
Binary files differ
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/.EClassNamesKeywordMatcher.java._trace b/examples/headless-maven/incquery-demo/src/main/java/headless/.EClassNamesKeywordMatcher.java._trace
deleted file mode 100644
index 4972254f4..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/.EClassNamesKeywordMatcher.java._trace
+++ /dev/null
Binary files differ
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/.EClassNamesMatch.java._trace b/examples/headless-maven/incquery-demo/src/main/java/headless/.EClassNamesMatch.java._trace
deleted file mode 100644
index 7c10fe6ca..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/.EClassNamesMatch.java._trace
+++ /dev/null
Binary files differ
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/.EClassNamesMatcher.java._trace b/examples/headless-maven/incquery-demo/src/main/java/headless/.EClassNamesMatcher.java._trace
deleted file mode 100644
index 12ae99c84..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/.EClassNamesMatcher.java._trace
+++ /dev/null
Binary files differ
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/.EObjectMatch.java._trace b/examples/headless-maven/incquery-demo/src/main/java/headless/.EObjectMatch.java._trace
deleted file mode 100644
index 78bab0ac5..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/.EObjectMatch.java._trace
+++ /dev/null
Binary files differ
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/.EObjectMatcher.java._trace b/examples/headless-maven/incquery-demo/src/main/java/headless/.EObjectMatcher.java._trace
deleted file mode 100644
index 8a9145159..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/.EObjectMatcher.java._trace
+++ /dev/null
Binary files differ
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/.EPackageMatch.java._trace b/examples/headless-maven/incquery-demo/src/main/java/headless/.EPackageMatch.java._trace
deleted file mode 100644
index ea961f4fe..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/.EPackageMatch.java._trace
+++ /dev/null
Binary files differ
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/.EPackageMatcher.java._trace b/examples/headless-maven/incquery-demo/src/main/java/headless/.EPackageMatcher.java._trace
deleted file mode 100644
index 55115c7a4..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/.EPackageMatcher.java._trace
+++ /dev/null
Binary files differ
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/.HeadlessQueries.java._trace b/examples/headless-maven/incquery-demo/src/main/java/headless/.HeadlessQueries.java._trace
deleted file mode 100644
index 53572aa84..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/.HeadlessQueries.java._trace
+++ /dev/null
Binary files differ
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/.HeadlessQueriesMatchers.java._trace b/examples/headless-maven/incquery-demo/src/main/java/headless/.HeadlessQueriesMatchers.java._trace
deleted file mode 100644
index 0128ae8ac..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/.HeadlessQueriesMatchers.java._trace
+++ /dev/null
Binary files differ
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/.SubPackageMatch.java._trace b/examples/headless-maven/incquery-demo/src/main/java/headless/.SubPackageMatch.java._trace
deleted file mode 100644
index 6701fbcae..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/.SubPackageMatch.java._trace
+++ /dev/null
Binary files differ
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/.SubPackageMatcher.java._trace b/examples/headless-maven/incquery-demo/src/main/java/headless/.SubPackageMatcher.java._trace
deleted file mode 100644
index 40f3949df..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/.SubPackageMatcher.java._trace
+++ /dev/null
Binary files differ
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/ClassesInPackageHierarchyMatch.java b/examples/headless-maven/incquery-demo/src/main/java/headless/ClassesInPackageHierarchyMatch.java
deleted file mode 100644
index 1f85f35a6..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/ClassesInPackageHierarchyMatch.java
+++ /dev/null
@@ -1,181 +0,0 @@
-package headless;
-
-import headless.util.ClassesInPackageHierarchyQuerySpecification;
-import java.util.Arrays;
-import java.util.List;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.incquery.runtime.api.IPatternMatch;
-import org.eclipse.incquery.runtime.api.impl.BasePatternMatch;
-import org.eclipse.incquery.runtime.exception.IncQueryException;
-
-/**
- * Pattern-specific match representation of the headless.classesInPackageHierarchy pattern,
- * to be used in conjunction with {@link ClassesInPackageHierarchyMatcher}.
- *
- * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
- * Each instance is a (possibly partial) substitution of pattern parameters,
- * usable to represent a match of the pattern in the result of a query,
- * or to specify the bound (fixed) input parameters when issuing a query.
- *
- * @see ClassesInPackageHierarchyMatcher
- * @see ClassesInPackageHierarchyProcessor
- *
- */
-@SuppressWarnings("all")
-public abstract class ClassesInPackageHierarchyMatch extends BasePatternMatch {
- private EPackage fRootP;
-
- private EClass fContainedClass;
-
- private static List<String> parameterNames = makeImmutableList("rootP", "containedClass");
-
- private ClassesInPackageHierarchyMatch(final EPackage pRootP, final EClass pContainedClass) {
- this.fRootP = pRootP;
- this.fContainedClass = pContainedClass;
-
- }
-
- @Override
- public Object get(final String parameterName) {
- if ("rootP".equals(parameterName)) return this.fRootP;
- if ("containedClass".equals(parameterName)) return this.fContainedClass;
- return null;
-
- }
-
- public EPackage getRootP() {
- return this.fRootP;
-
- }
-
- public EClass getContainedClass() {
- return this.fContainedClass;
-
- }
-
- @Override
- public boolean set(final String parameterName, final Object newValue) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- if ("rootP".equals(parameterName) ) {
- this.fRootP = (org.eclipse.emf.ecore.EPackage) newValue;
- return true;
- }
- if ("containedClass".equals(parameterName) ) {
- this.fContainedClass = (org.eclipse.emf.ecore.EClass) newValue;
- return true;
- }
- return false;
-
- }
-
- public void setRootP(final EPackage pRootP) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fRootP = pRootP;
-
- }
-
- public void setContainedClass(final EClass pContainedClass) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fContainedClass = pContainedClass;
-
- }
-
- @Override
- public String patternName() {
- return "headless.classesInPackageHierarchy";
-
- }
-
- @Override
- public List<String> parameterNames() {
- return ClassesInPackageHierarchyMatch.parameterNames;
-
- }
-
- @Override
- public Object[] toArray() {
- return new Object[]{fRootP, fContainedClass};
-
- }
-
- @Override
- public String prettyPrint() {
- StringBuilder result = new StringBuilder();
- result.append("\"rootP\"=" + prettyPrintValue(fRootP) + ", ");
- result.append("\"containedClass\"=" + prettyPrintValue(fContainedClass));
- return result.toString();
-
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((fRootP == null) ? 0 : fRootP.hashCode());
- result = prime * result + ((fContainedClass == null) ? 0 : fContainedClass.hashCode());
- return result;
-
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj)
- return true;
- if (!(obj instanceof ClassesInPackageHierarchyMatch)) { // this should be infrequent
- if (obj == null)
- return false;
- if (!(obj instanceof IPatternMatch))
- return false;
- IPatternMatch otherSig = (IPatternMatch) obj;
- if (!specification().equals(otherSig.specification()))
- return false;
- return Arrays.deepEquals(toArray(), otherSig.toArray());
- }
- ClassesInPackageHierarchyMatch other = (ClassesInPackageHierarchyMatch) obj;
- if (fRootP == null) {if (other.fRootP != null) return false;}
- else if (!fRootP.equals(other.fRootP)) return false;
- if (fContainedClass == null) {if (other.fContainedClass != null) return false;}
- else if (!fContainedClass.equals(other.fContainedClass)) return false;
- return true;
- }
-
- @Override
- public ClassesInPackageHierarchyQuerySpecification specification() {
- try {
- return ClassesInPackageHierarchyQuerySpecification.instance();
- } catch (IncQueryException ex) {
- // This cannot happen, as the match object can only be instantiated if the query specification exists
- throw new IllegalStateException (ex);
- }
-
- }
-
- @SuppressWarnings("all")
- static final class Mutable extends ClassesInPackageHierarchyMatch {
- Mutable(final EPackage pRootP, final EClass pContainedClass) {
- super(pRootP, pContainedClass);
-
- }
-
- @Override
- public boolean isMutable() {
- return true;
- }
- }
-
-
- @SuppressWarnings("all")
- static final class Immutable extends ClassesInPackageHierarchyMatch {
- Immutable(final EPackage pRootP, final EClass pContainedClass) {
- super(pRootP, pContainedClass);
-
- }
-
- @Override
- public boolean isMutable() {
- return false;
- }
- }
-
-}
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/ClassesInPackageHierarchyMatcher.java b/examples/headless-maven/incquery-demo/src/main/java/headless/ClassesInPackageHierarchyMatcher.java
deleted file mode 100644
index 1a9b0fd2c..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/ClassesInPackageHierarchyMatcher.java
+++ /dev/null
@@ -1,317 +0,0 @@
-package headless;
-
-import headless.ClassesInPackageHierarchyMatch;
-import headless.util.ClassesInPackageHierarchyQuerySpecification;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.incquery.runtime.api.IMatchProcessor;
-import org.eclipse.incquery.runtime.api.IQuerySpecification;
-import org.eclipse.incquery.runtime.api.IncQueryEngine;
-import org.eclipse.incquery.runtime.api.impl.BaseMatcher;
-import org.eclipse.incquery.runtime.exception.IncQueryException;
-import org.eclipse.incquery.runtime.matchers.tuple.Tuple;
-import org.eclipse.incquery.runtime.rete.misc.DeltaMonitor;
-
-/**
- * Generated pattern matcher API of the headless.classesInPackageHierarchy pattern,
- * providing pattern-specific query methods.
- *
- * <p>Use the pattern matcher on a given model via {@link #on(IncQueryEngine)},
- * e.g. in conjunction with {@link IncQueryEngine#on(Notifier)}.
- *
- * <p>Matches of the pattern will be represented as {@link ClassesInPackageHierarchyMatch}.
- *
- * <p>Original source:
- * <code><pre>
- * {@literal @}Edge(source = rootP, target = containedClass, label = "classIn+")
- * {@literal @}Format(color = "#0033ff")
- * pattern classesInPackageHierarchy(rootP: EPackage, containedClass: EClass)
- * {
- * find classesInPackage(rootP,containedClass);
- * } or {
- * find subPackage+(rootP,somePackage);
- * find classesInPackage(somePackage,containedClass);
- * }
- * </pre></code>
- *
- * @see ClassesInPackageHierarchyMatch
- * @see ClassesInPackageHierarchyProcessor
- * @see ClassesInPackageHierarchyQuerySpecification
- *
- */
-@SuppressWarnings("all")
-public class ClassesInPackageHierarchyMatcher extends BaseMatcher<ClassesInPackageHierarchyMatch> {
- /**
- * @return the singleton instance of the query specification of this pattern
- * @throws IncQueryException if the pattern definition could not be loaded
- *
- */
- public static IQuerySpecification<ClassesInPackageHierarchyMatcher> querySpecification() throws IncQueryException {
- return ClassesInPackageHierarchyQuerySpecification.instance();
- }
-
- /**
- * Initializes the pattern matcher within an existing EMF-IncQuery engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing EMF-IncQuery engine in which this matcher will be created.
- * @throws IncQueryException if an error occurs during pattern matcher creation
- *
- */
- public static ClassesInPackageHierarchyMatcher on(final IncQueryEngine engine) throws IncQueryException {
- // check if matcher already exists
- ClassesInPackageHierarchyMatcher matcher = engine.getExistingMatcher(querySpecification());
- if (matcher == null) {
- matcher = new ClassesInPackageHierarchyMatcher(engine);
- // do not have to "put" it into engine.matchers, reportMatcherInitialized() will take care of it
- }
- return matcher;
- }
-
- private final static int POSITION_ROOTP = 0;
-
- private final static int POSITION_CONTAINEDCLASS = 1;
-
- /**
- * Initializes the pattern matcher over a given EMF model root (recommended: Resource or ResourceSet).
- * If a pattern matcher is already constructed with the same root, only a light-weight reference is returned.
- * The scope of pattern matching will be the given EMF model root and below (see FAQ for more precise definition).
- * The match set will be incrementally refreshed upon updates from this scope.
- * <p>The matcher will be created within the managed {@link IncQueryEngine} belonging to the EMF model root, so
- * multiple matchers will reuse the same engine and benefit from increased performance and reduced memory footprint.
- * @param emfRoot the root of the EMF containment hierarchy where the pattern matcher will operate. Recommended: Resource or ResourceSet.
- * @throws IncQueryException if an error occurs during pattern matcher creation
- * @deprecated use {@link #on(IncQueryEngine)} instead, e.g. in conjunction with {@link IncQueryEngine#on(Notifier)}
- *
- */
- @Deprecated
- public ClassesInPackageHierarchyMatcher(final Notifier emfRoot) throws IncQueryException {
- this(IncQueryEngine.on(emfRoot));
- }
-
- /**
- * Initializes the pattern matcher within an existing EMF-IncQuery engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing EMF-IncQuery engine in which this matcher will be created.
- * @throws IncQueryException if an error occurs during pattern matcher creation
- * @deprecated use {@link #on(IncQueryEngine)} instead
- *
- */
- @Deprecated
- public ClassesInPackageHierarchyMatcher(final IncQueryEngine engine) throws IncQueryException {
- super(engine, querySpecification());
- }
-
- /**
- * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pRootP the fixed value of pattern parameter rootP, or null if not bound.
- * @param pContainedClass the fixed value of pattern parameter containedClass, or null if not bound.
- * @return matches represented as a ClassesInPackageHierarchyMatch object.
- *
- */
- public Collection<ClassesInPackageHierarchyMatch> getAllMatches(final EPackage pRootP, final EClass pContainedClass) {
- return rawGetAllMatches(new Object[]{pRootP, pContainedClass});
- }
-
- /**
- * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pRootP the fixed value of pattern parameter rootP, or null if not bound.
- * @param pContainedClass the fixed value of pattern parameter containedClass, or null if not bound.
- * @return a match represented as a ClassesInPackageHierarchyMatch object, or null if no match is found.
- *
- */
- public ClassesInPackageHierarchyMatch getOneArbitraryMatch(final EPackage pRootP, final EClass pContainedClass) {
- return rawGetOneArbitraryMatch(new Object[]{pRootP, pContainedClass});
- }
-
- /**
- * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
- * under any possible substitution of the unspecified parameters (if any).
- * @param pRootP the fixed value of pattern parameter rootP, or null if not bound.
- * @param pContainedClass the fixed value of pattern parameter containedClass, or null if not bound.
- * @return true if the input is a valid (partial) match of the pattern.
- *
- */
- public boolean hasMatch(final EPackage pRootP, final EClass pContainedClass) {
- return rawHasMatch(new Object[]{pRootP, pContainedClass});
- }
-
- /**
- * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pRootP the fixed value of pattern parameter rootP, or null if not bound.
- * @param pContainedClass the fixed value of pattern parameter containedClass, or null if not bound.
- * @return the number of pattern matches found.
- *
- */
- public int countMatches(final EPackage pRootP, final EClass pContainedClass) {
- return rawCountMatches(new Object[]{pRootP, pContainedClass});
- }
-
- /**
- * Executes the given processor on each match of the pattern that conforms to the given fixed values of some parameters.
- * @param pRootP the fixed value of pattern parameter rootP, or null if not bound.
- * @param pContainedClass the fixed value of pattern parameter containedClass, or null if not bound.
- * @param processor the action that will process each pattern match.
- *
- */
- public void forEachMatch(final EPackage pRootP, final EClass pContainedClass, final IMatchProcessor<? super ClassesInPackageHierarchyMatch> processor) {
- rawForEachMatch(new Object[]{pRootP, pContainedClass}, processor);
- }
-
- /**
- * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pRootP the fixed value of pattern parameter rootP, or null if not bound.
- * @param pContainedClass the fixed value of pattern parameter containedClass, or null if not bound.
- * @param processor the action that will process the selected match.
- * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
- *
- */
- public boolean forOneArbitraryMatch(final EPackage pRootP, final EClass pContainedClass, final IMatchProcessor<? super ClassesInPackageHierarchyMatch> processor) {
- return rawForOneArbitraryMatch(new Object[]{pRootP, pContainedClass}, processor);
- }
-
- /**
- * Registers a new filtered delta monitor on this pattern matcher.
- * The DeltaMonitor can be used to track changes (delta) in the set of filtered pattern matches from now on, considering those matches only that conform to the given fixed values of some parameters.
- * It can also be reset to track changes from a later point in time,
- * and changes can even be acknowledged on an individual basis.
- * See {@link DeltaMonitor} for details.
- * @param fillAtStart if true, all current matches are reported as new match events; if false, the delta monitor starts empty.
- * @param pRootP the fixed value of pattern parameter rootP, or null if not bound.
- * @param pContainedClass the fixed value of pattern parameter containedClass, or null if not bound.
- * @return the delta monitor.
- * @deprecated use the IncQuery Databinding API (IncQueryObservables) instead.
- *
- */
- @Deprecated
- public DeltaMonitor<ClassesInPackageHierarchyMatch> newFilteredDeltaMonitor(final boolean fillAtStart, final EPackage pRootP, final EClass pContainedClass) {
- return rawNewFilteredDeltaMonitor(fillAtStart, new Object[]{pRootP, pContainedClass});
- }
-
- /**
- * Returns a new (partial) Match object for the matcher.
- * This can be used e.g. to call the matcher with a partial match.
- * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pRootP the fixed value of pattern parameter rootP, or null if not bound.
- * @param pContainedClass the fixed value of pattern parameter containedClass, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public ClassesInPackageHierarchyMatch newMatch(final EPackage pRootP, final EClass pContainedClass) {
- return new ClassesInPackageHierarchyMatch.Immutable(pRootP, pContainedClass);
-
- }
-
- /**
- * Retrieve the set of values that occur in matches for rootP.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- protected Set<EPackage> rawAccumulateAllValuesOfrootP(final Object[] parameters) {
- Set<EPackage> results = new HashSet<EPackage>();
- rawAccumulateAllValues(POSITION_ROOTP, parameters, results);
- return results;
- }
-
- /**
- * Retrieve the set of values that occur in matches for rootP.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<EPackage> getAllValuesOfrootP() {
- return rawAccumulateAllValuesOfrootP(emptyArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for rootP.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<EPackage> getAllValuesOfrootP(final ClassesInPackageHierarchyMatch partialMatch) {
- return rawAccumulateAllValuesOfrootP(partialMatch.toArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for rootP.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<EPackage> getAllValuesOfrootP(final EClass pContainedClass) {
- return rawAccumulateAllValuesOfrootP(new Object[]{null, pContainedClass});
- }
-
- /**
- * Retrieve the set of values that occur in matches for containedClass.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- protected Set<EClass> rawAccumulateAllValuesOfcontainedClass(final Object[] parameters) {
- Set<EClass> results = new HashSet<EClass>();
- rawAccumulateAllValues(POSITION_CONTAINEDCLASS, parameters, results);
- return results;
- }
-
- /**
- * Retrieve the set of values that occur in matches for containedClass.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<EClass> getAllValuesOfcontainedClass() {
- return rawAccumulateAllValuesOfcontainedClass(emptyArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for containedClass.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<EClass> getAllValuesOfcontainedClass(final ClassesInPackageHierarchyMatch partialMatch) {
- return rawAccumulateAllValuesOfcontainedClass(partialMatch.toArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for containedClass.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<EClass> getAllValuesOfcontainedClass(final EPackage pRootP) {
- return rawAccumulateAllValuesOfcontainedClass(new Object[]{pRootP, null});
- }
-
- @Override
- protected ClassesInPackageHierarchyMatch tupleToMatch(final Tuple t) {
- try {
- return new ClassesInPackageHierarchyMatch.Immutable((org.eclipse.emf.ecore.EPackage) t.get(POSITION_ROOTP), (org.eclipse.emf.ecore.EClass) t.get(POSITION_CONTAINEDCLASS));
- } catch(ClassCastException e) {engine.getLogger().error("Element(s) in tuple not properly typed!",e); //throw new IncQueryRuntimeException(e.getMessage());
- return null;
- }
-
- }
-
- @Override
- protected ClassesInPackageHierarchyMatch arrayToMatch(final Object[] match) {
- try {
- return new ClassesInPackageHierarchyMatch.Immutable((org.eclipse.emf.ecore.EPackage) match[POSITION_ROOTP], (org.eclipse.emf.ecore.EClass) match[POSITION_CONTAINEDCLASS]);
- } catch(ClassCastException e) {engine.getLogger().error("Element(s) in array not properly typed!",e); //throw new IncQueryRuntimeException(e.getMessage());
- return null;
- }
-
- }
-
- @Override
- protected ClassesInPackageHierarchyMatch arrayToMatchMutable(final Object[] match) {
- try {
- return new ClassesInPackageHierarchyMatch.Mutable((org.eclipse.emf.ecore.EPackage) match[POSITION_ROOTP], (org.eclipse.emf.ecore.EClass) match[POSITION_CONTAINEDCLASS]);
- } catch(ClassCastException e) {engine.getLogger().error("Element(s) in array not properly typed!",e); //throw new IncQueryRuntimeException(e.getMessage());
- return null;
- }
-
- }
-}
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/ClassesInPackageMatch.java b/examples/headless-maven/incquery-demo/src/main/java/headless/ClassesInPackageMatch.java
deleted file mode 100644
index 88e1d99c7..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/ClassesInPackageMatch.java
+++ /dev/null
@@ -1,181 +0,0 @@
-package headless;
-
-import headless.util.ClassesInPackageQuerySpecification;
-import java.util.Arrays;
-import java.util.List;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.incquery.runtime.api.IPatternMatch;
-import org.eclipse.incquery.runtime.api.impl.BasePatternMatch;
-import org.eclipse.incquery.runtime.exception.IncQueryException;
-
-/**
- * Pattern-specific match representation of the headless.classesInPackage pattern,
- * to be used in conjunction with {@link ClassesInPackageMatcher}.
- *
- * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
- * Each instance is a (possibly partial) substitution of pattern parameters,
- * usable to represent a match of the pattern in the result of a query,
- * or to specify the bound (fixed) input parameters when issuing a query.
- *
- * @see ClassesInPackageMatcher
- * @see ClassesInPackageProcessor
- *
- */
-@SuppressWarnings("all")
-public abstract class ClassesInPackageMatch extends BasePatternMatch {
- private EPackage fP;
-
- private EClass fEc;
-
- private static List<String> parameterNames = makeImmutableList("p", "ec");
-
- private ClassesInPackageMatch(final EPackage pP, final EClass pEc) {
- this.fP = pP;
- this.fEc = pEc;
-
- }
-
- @Override
- public Object get(final String parameterName) {
- if ("p".equals(parameterName)) return this.fP;
- if ("ec".equals(parameterName)) return this.fEc;
- return null;
-
- }
-
- public EPackage getP() {
- return this.fP;
-
- }
-
- public EClass getEc() {
- return this.fEc;
-
- }
-
- @Override
- public boolean set(final String parameterName, final Object newValue) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- if ("p".equals(parameterName) ) {
- this.fP = (org.eclipse.emf.ecore.EPackage) newValue;
- return true;
- }
- if ("ec".equals(parameterName) ) {
- this.fEc = (org.eclipse.emf.ecore.EClass) newValue;
- return true;
- }
- return false;
-
- }
-
- public void setP(final EPackage pP) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fP = pP;
-
- }
-
- public void setEc(final EClass pEc) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fEc = pEc;
-
- }
-
- @Override
- public String patternName() {
- return "headless.classesInPackage";
-
- }
-
- @Override
- public List<String> parameterNames() {
- return ClassesInPackageMatch.parameterNames;
-
- }
-
- @Override
- public Object[] toArray() {
- return new Object[]{fP, fEc};
-
- }
-
- @Override
- public String prettyPrint() {
- StringBuilder result = new StringBuilder();
- result.append("\"p\"=" + prettyPrintValue(fP) + ", ");
- result.append("\"ec\"=" + prettyPrintValue(fEc));
- return result.toString();
-
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((fP == null) ? 0 : fP.hashCode());
- result = prime * result + ((fEc == null) ? 0 : fEc.hashCode());
- return result;
-
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj)
- return true;
- if (!(obj instanceof ClassesInPackageMatch)) { // this should be infrequent
- if (obj == null)
- return false;
- if (!(obj instanceof IPatternMatch))
- return false;
- IPatternMatch otherSig = (IPatternMatch) obj;
- if (!specification().equals(otherSig.specification()))
- return false;
- return Arrays.deepEquals(toArray(), otherSig.toArray());
- }
- ClassesInPackageMatch other = (ClassesInPackageMatch) obj;
- if (fP == null) {if (other.fP != null) return false;}
- else if (!fP.equals(other.fP)) return false;
- if (fEc == null) {if (other.fEc != null) return false;}
- else if (!fEc.equals(other.fEc)) return false;
- return true;
- }
-
- @Override
- public ClassesInPackageQuerySpecification specification() {
- try {
- return ClassesInPackageQuerySpecification.instance();
- } catch (IncQueryException ex) {
- // This cannot happen, as the match object can only be instantiated if the query specification exists
- throw new IllegalStateException (ex);
- }
-
- }
-
- @SuppressWarnings("all")
- static final class Mutable extends ClassesInPackageMatch {
- Mutable(final EPackage pP, final EClass pEc) {
- super(pP, pEc);
-
- }
-
- @Override
- public boolean isMutable() {
- return true;
- }
- }
-
-
- @SuppressWarnings("all")
- static final class Immutable extends ClassesInPackageMatch {
- Immutable(final EPackage pP, final EClass pEc) {
- super(pP, pEc);
-
- }
-
- @Override
- public boolean isMutable() {
- return false;
- }
- }
-
-}
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/ClassesInPackageMatcher.java b/examples/headless-maven/incquery-demo/src/main/java/headless/ClassesInPackageMatcher.java
deleted file mode 100644
index 545ed99e2..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/ClassesInPackageMatcher.java
+++ /dev/null
@@ -1,310 +0,0 @@
-package headless;
-
-import headless.ClassesInPackageMatch;
-import headless.util.ClassesInPackageQuerySpecification;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.incquery.runtime.api.IMatchProcessor;
-import org.eclipse.incquery.runtime.api.IQuerySpecification;
-import org.eclipse.incquery.runtime.api.IncQueryEngine;
-import org.eclipse.incquery.runtime.api.impl.BaseMatcher;
-import org.eclipse.incquery.runtime.exception.IncQueryException;
-import org.eclipse.incquery.runtime.matchers.tuple.Tuple;
-import org.eclipse.incquery.runtime.rete.misc.DeltaMonitor;
-
-/**
- * Generated pattern matcher API of the headless.classesInPackage pattern,
- * providing pattern-specific query methods.
- *
- * <p>Use the pattern matcher on a given model via {@link #on(IncQueryEngine)},
- * e.g. in conjunction with {@link IncQueryEngine#on(Notifier)}.
- *
- * <p>Matches of the pattern will be represented as {@link ClassesInPackageMatch}.
- *
- * <p>Original source:
- * <code><pre>
- * {@literal @}Edge(source = p, target = ec, label = "classIn")
- * pattern classesInPackage(p : EPackage, ec: EClass) { EPackage.eClassifiers(p,ec); }
- * </pre></code>
- *
- * @see ClassesInPackageMatch
- * @see ClassesInPackageProcessor
- * @see ClassesInPackageQuerySpecification
- *
- */
-@SuppressWarnings("all")
-public class ClassesInPackageMatcher extends BaseMatcher<ClassesInPackageMatch> {
- /**
- * @return the singleton instance of the query specification of this pattern
- * @throws IncQueryException if the pattern definition could not be loaded
- *
- */
- public static IQuerySpecification<ClassesInPackageMatcher> querySpecification() throws IncQueryException {
- return ClassesInPackageQuerySpecification.instance();
- }
-
- /**
- * Initializes the pattern matcher within an existing EMF-IncQuery engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing EMF-IncQuery engine in which this matcher will be created.
- * @throws IncQueryException if an error occurs during pattern matcher creation
- *
- */
- public static ClassesInPackageMatcher on(final IncQueryEngine engine) throws IncQueryException {
- // check if matcher already exists
- ClassesInPackageMatcher matcher = engine.getExistingMatcher(querySpecification());
- if (matcher == null) {
- matcher = new ClassesInPackageMatcher(engine);
- // do not have to "put" it into engine.matchers, reportMatcherInitialized() will take care of it
- }
- return matcher;
- }
-
- private final static int POSITION_P = 0;
-
- private final static int POSITION_EC = 1;
-
- /**
- * Initializes the pattern matcher over a given EMF model root (recommended: Resource or ResourceSet).
- * If a pattern matcher is already constructed with the same root, only a light-weight reference is returned.
- * The scope of pattern matching will be the given EMF model root and below (see FAQ for more precise definition).
- * The match set will be incrementally refreshed upon updates from this scope.
- * <p>The matcher will be created within the managed {@link IncQueryEngine} belonging to the EMF model root, so
- * multiple matchers will reuse the same engine and benefit from increased performance and reduced memory footprint.
- * @param emfRoot the root of the EMF containment hierarchy where the pattern matcher will operate. Recommended: Resource or ResourceSet.
- * @throws IncQueryException if an error occurs during pattern matcher creation
- * @deprecated use {@link #on(IncQueryEngine)} instead, e.g. in conjunction with {@link IncQueryEngine#on(Notifier)}
- *
- */
- @Deprecated
- public ClassesInPackageMatcher(final Notifier emfRoot) throws IncQueryException {
- this(IncQueryEngine.on(emfRoot));
- }
-
- /**
- * Initializes the pattern matcher within an existing EMF-IncQuery engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing EMF-IncQuery engine in which this matcher will be created.
- * @throws IncQueryException if an error occurs during pattern matcher creation
- * @deprecated use {@link #on(IncQueryEngine)} instead
- *
- */
- @Deprecated
- public ClassesInPackageMatcher(final IncQueryEngine engine) throws IncQueryException {
- super(engine, querySpecification());
- }
-
- /**
- * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pP the fixed value of pattern parameter p, or null if not bound.
- * @param pEc the fixed value of pattern parameter ec, or null if not bound.
- * @return matches represented as a ClassesInPackageMatch object.
- *
- */
- public Collection<ClassesInPackageMatch> getAllMatches(final EPackage pP, final EClass pEc) {
- return rawGetAllMatches(new Object[]{pP, pEc});
- }
-
- /**
- * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pP the fixed value of pattern parameter p, or null if not bound.
- * @param pEc the fixed value of pattern parameter ec, or null if not bound.
- * @return a match represented as a ClassesInPackageMatch object, or null if no match is found.
- *
- */
- public ClassesInPackageMatch getOneArbitraryMatch(final EPackage pP, final EClass pEc) {
- return rawGetOneArbitraryMatch(new Object[]{pP, pEc});
- }
-
- /**
- * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
- * under any possible substitution of the unspecified parameters (if any).
- * @param pP the fixed value of pattern parameter p, or null if not bound.
- * @param pEc the fixed value of pattern parameter ec, or null if not bound.
- * @return true if the input is a valid (partial) match of the pattern.
- *
- */
- public boolean hasMatch(final EPackage pP, final EClass pEc) {
- return rawHasMatch(new Object[]{pP, pEc});
- }
-
- /**
- * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pP the fixed value of pattern parameter p, or null if not bound.
- * @param pEc the fixed value of pattern parameter ec, or null if not bound.
- * @return the number of pattern matches found.
- *
- */
- public int countMatches(final EPackage pP, final EClass pEc) {
- return rawCountMatches(new Object[]{pP, pEc});
- }
-
- /**
- * Executes the given processor on each match of the pattern that conforms to the given fixed values of some parameters.
- * @param pP the fixed value of pattern parameter p, or null if not bound.
- * @param pEc the fixed value of pattern parameter ec, or null if not bound.
- * @param processor the action that will process each pattern match.
- *
- */
- public void forEachMatch(final EPackage pP, final EClass pEc, final IMatchProcessor<? super ClassesInPackageMatch> processor) {
- rawForEachMatch(new Object[]{pP, pEc}, processor);
- }
-
- /**
- * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pP the fixed value of pattern parameter p, or null if not bound.
- * @param pEc the fixed value of pattern parameter ec, or null if not bound.
- * @param processor the action that will process the selected match.
- * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
- *
- */
- public boolean forOneArbitraryMatch(final EPackage pP, final EClass pEc, final IMatchProcessor<? super ClassesInPackageMatch> processor) {
- return rawForOneArbitraryMatch(new Object[]{pP, pEc}, processor);
- }
-
- /**
- * Registers a new filtered delta monitor on this pattern matcher.
- * The DeltaMonitor can be used to track changes (delta) in the set of filtered pattern matches from now on, considering those matches only that conform to the given fixed values of some parameters.
- * It can also be reset to track changes from a later point in time,
- * and changes can even be acknowledged on an individual basis.
- * See {@link DeltaMonitor} for details.
- * @param fillAtStart if true, all current matches are reported as new match events; if false, the delta monitor starts empty.
- * @param pP the fixed value of pattern parameter p, or null if not bound.
- * @param pEc the fixed value of pattern parameter ec, or null if not bound.
- * @return the delta monitor.
- * @deprecated use the IncQuery Databinding API (IncQueryObservables) instead.
- *
- */
- @Deprecated
- public DeltaMonitor<ClassesInPackageMatch> newFilteredDeltaMonitor(final boolean fillAtStart, final EPackage pP, final EClass pEc) {
- return rawNewFilteredDeltaMonitor(fillAtStart, new Object[]{pP, pEc});
- }
-
- /**
- * Returns a new (partial) Match object for the matcher.
- * This can be used e.g. to call the matcher with a partial match.
- * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pP the fixed value of pattern parameter p, or null if not bound.
- * @param pEc the fixed value of pattern parameter ec, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public ClassesInPackageMatch newMatch(final EPackage pP, final EClass pEc) {
- return new ClassesInPackageMatch.Immutable(pP, pEc);
-
- }
-
- /**
- * Retrieve the set of values that occur in matches for p.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- protected Set<EPackage> rawAccumulateAllValuesOfp(final Object[] parameters) {
- Set<EPackage> results = new HashSet<EPackage>();
- rawAccumulateAllValues(POSITION_P, parameters, results);
- return results;
- }
-
- /**
- * Retrieve the set of values that occur in matches for p.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<EPackage> getAllValuesOfp() {
- return rawAccumulateAllValuesOfp(emptyArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for p.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<EPackage> getAllValuesOfp(final ClassesInPackageMatch partialMatch) {
- return rawAccumulateAllValuesOfp(partialMatch.toArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for p.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<EPackage> getAllValuesOfp(final EClass pEc) {
- return rawAccumulateAllValuesOfp(new Object[]{null, pEc});
- }
-
- /**
- * Retrieve the set of values that occur in matches for ec.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- protected Set<EClass> rawAccumulateAllValuesOfec(final Object[] parameters) {
- Set<EClass> results = new HashSet<EClass>();
- rawAccumulateAllValues(POSITION_EC, parameters, results);
- return results;
- }
-
- /**
- * Retrieve the set of values that occur in matches for ec.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<EClass> getAllValuesOfec() {
- return rawAccumulateAllValuesOfec(emptyArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for ec.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<EClass> getAllValuesOfec(final ClassesInPackageMatch partialMatch) {
- return rawAccumulateAllValuesOfec(partialMatch.toArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for ec.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<EClass> getAllValuesOfec(final EPackage pP) {
- return rawAccumulateAllValuesOfec(new Object[]{pP, null});
- }
-
- @Override
- protected ClassesInPackageMatch tupleToMatch(final Tuple t) {
- try {
- return new ClassesInPackageMatch.Immutable((org.eclipse.emf.ecore.EPackage) t.get(POSITION_P), (org.eclipse.emf.ecore.EClass) t.get(POSITION_EC));
- } catch(ClassCastException e) {engine.getLogger().error("Element(s) in tuple not properly typed!",e); //throw new IncQueryRuntimeException(e.getMessage());
- return null;
- }
-
- }
-
- @Override
- protected ClassesInPackageMatch arrayToMatch(final Object[] match) {
- try {
- return new ClassesInPackageMatch.Immutable((org.eclipse.emf.ecore.EPackage) match[POSITION_P], (org.eclipse.emf.ecore.EClass) match[POSITION_EC]);
- } catch(ClassCastException e) {engine.getLogger().error("Element(s) in array not properly typed!",e); //throw new IncQueryRuntimeException(e.getMessage());
- return null;
- }
-
- }
-
- @Override
- protected ClassesInPackageMatch arrayToMatchMutable(final Object[] match) {
- try {
- return new ClassesInPackageMatch.Mutable((org.eclipse.emf.ecore.EPackage) match[POSITION_P], (org.eclipse.emf.ecore.EClass) match[POSITION_EC]);
- } catch(ClassCastException e) {engine.getLogger().error("Element(s) in array not properly typed!",e); //throw new IncQueryRuntimeException(e.getMessage());
- return null;
- }
-
- }
-}
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/EClassMatch.java b/examples/headless-maven/incquery-demo/src/main/java/headless/EClassMatch.java
deleted file mode 100644
index 36b4790e5..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/EClassMatch.java
+++ /dev/null
@@ -1,157 +0,0 @@
-package headless;
-
-import headless.util.EClassQuerySpecification;
-import java.util.Arrays;
-import java.util.List;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.incquery.runtime.api.IPatternMatch;
-import org.eclipse.incquery.runtime.api.impl.BasePatternMatch;
-import org.eclipse.incquery.runtime.exception.IncQueryException;
-
-/**
- * Pattern-specific match representation of the headless.eClass pattern,
- * to be used in conjunction with {@link EClassMatcher}.
- *
- * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
- * Each instance is a (possibly partial) substitution of pattern parameters,
- * usable to represent a match of the pattern in the result of a query,
- * or to specify the bound (fixed) input parameters when issuing a query.
- *
- * @see EClassMatcher
- * @see EClassProcessor
- *
- */
-@SuppressWarnings("all")
-public abstract class EClassMatch extends BasePatternMatch {
- private EClass fEc;
-
- private static List<String> parameterNames = makeImmutableList("ec");
-
- private EClassMatch(final EClass pEc) {
- this.fEc = pEc;
-
- }
-
- @Override
- public Object get(final String parameterName) {
- if ("ec".equals(parameterName)) return this.fEc;
- return null;
-
- }
-
- public EClass getEc() {
- return this.fEc;
-
- }
-
- @Override
- public boolean set(final String parameterName, final Object newValue) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- if ("ec".equals(parameterName) ) {
- this.fEc = (org.eclipse.emf.ecore.EClass) newValue;
- return true;
- }
- return false;
-
- }
-
- public void setEc(final EClass pEc) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fEc = pEc;
-
- }
-
- @Override
- public String patternName() {
- return "headless.eClass";
-
- }
-
- @Override
- public List<String> parameterNames() {
- return EClassMatch.parameterNames;
-
- }
-
- @Override
- public Object[] toArray() {
- return new Object[]{fEc};
-
- }
-
- @Override
- public String prettyPrint() {
- StringBuilder result = new StringBuilder();
- result.append("\"ec\"=" + prettyPrintValue(fEc));
- return result.toString();
-
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((fEc == null) ? 0 : fEc.hashCode());
- return result;
-
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj)
- return true;
- if (!(obj instanceof EClassMatch)) { // this should be infrequent
- if (obj == null)
- return false;
- if (!(obj instanceof IPatternMatch))
- return false;
- IPatternMatch otherSig = (IPatternMatch) obj;
- if (!specification().equals(otherSig.specification()))
- return false;
- return Arrays.deepEquals(toArray(), otherSig.toArray());
- }
- EClassMatch other = (EClassMatch) obj;
- if (fEc == null) {if (other.fEc != null) return false;}
- else if (!fEc.equals(other.fEc)) return false;
- return true;
- }
-
- @Override
- public EClassQuerySpecification specification() {
- try {
- return EClassQuerySpecification.instance();
- } catch (IncQueryException ex) {
- // This cannot happen, as the match object can only be instantiated if the query specification exists
- throw new IllegalStateException (ex);
- }
-
- }
-
- @SuppressWarnings("all")
- static final class Mutable extends EClassMatch {
- Mutable(final EClass pEc) {
- super(pEc);
-
- }
-
- @Override
- public boolean isMutable() {
- return true;
- }
- }
-
-
- @SuppressWarnings("all")
- static final class Immutable extends EClassMatch {
- Immutable(final EClass pEc) {
- super(pEc);
-
- }
-
- @Override
- public boolean isMutable() {
- return false;
- }
- }
-
-}
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/EClassMatcher.java b/examples/headless-maven/incquery-demo/src/main/java/headless/EClassMatcher.java
deleted file mode 100644
index db49677a8..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/EClassMatcher.java
+++ /dev/null
@@ -1,244 +0,0 @@
-package headless;
-
-import headless.EClassMatch;
-import headless.util.EClassQuerySpecification;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.incquery.runtime.api.IMatchProcessor;
-import org.eclipse.incquery.runtime.api.IQuerySpecification;
-import org.eclipse.incquery.runtime.api.IncQueryEngine;
-import org.eclipse.incquery.runtime.api.impl.BaseMatcher;
-import org.eclipse.incquery.runtime.exception.IncQueryException;
-import org.eclipse.incquery.runtime.matchers.tuple.Tuple;
-import org.eclipse.incquery.runtime.rete.misc.DeltaMonitor;
-
-/**
- * Generated pattern matcher API of the headless.eClass pattern,
- * providing pattern-specific query methods.
- *
- * <p>Use the pattern matcher on a given model via {@link #on(IncQueryEngine)},
- * e.g. in conjunction with {@link IncQueryEngine#on(Notifier)}.
- *
- * <p>Matches of the pattern will be represented as {@link EClassMatch}.
- *
- * <p>Original source:
- * <code><pre>
- * {@literal @}Item(item = ec, label = "EC: $ec.name$")
- * {@literal @}Format(color = "#e8da2c")
- * pattern eClass(ec : EClass) { EClass(ec); }
- * </pre></code>
- *
- * @see EClassMatch
- * @see EClassProcessor
- * @see EClassQuerySpecification
- *
- */
-@SuppressWarnings("all")
-public class EClassMatcher extends BaseMatcher<EClassMatch> {
- /**
- * @return the singleton instance of the query specification of this pattern
- * @throws IncQueryException if the pattern definition could not be loaded
- *
- */
- public static IQuerySpecification<EClassMatcher> querySpecification() throws IncQueryException {
- return EClassQuerySpecification.instance();
- }
-
- /**
- * Initializes the pattern matcher within an existing EMF-IncQuery engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing EMF-IncQuery engine in which this matcher will be created.
- * @throws IncQueryException if an error occurs during pattern matcher creation
- *
- */
- public static EClassMatcher on(final IncQueryEngine engine) throws IncQueryException {
- // check if matcher already exists
- EClassMatcher matcher = engine.getExistingMatcher(querySpecification());
- if (matcher == null) {
- matcher = new EClassMatcher(engine);
- // do not have to "put" it into engine.matchers, reportMatcherInitialized() will take care of it
- }
- return matcher;
- }
-
- private final static int POSITION_EC = 0;
-
- /**
- * Initializes the pattern matcher over a given EMF model root (recommended: Resource or ResourceSet).
- * If a pattern matcher is already constructed with the same root, only a light-weight reference is returned.
- * The scope of pattern matching will be the given EMF model root and below (see FAQ for more precise definition).
- * The match set will be incrementally refreshed upon updates from this scope.
- * <p>The matcher will be created within the managed {@link IncQueryEngine} belonging to the EMF model root, so
- * multiple matchers will reuse the same engine and benefit from increased performance and reduced memory footprint.
- * @param emfRoot the root of the EMF containment hierarchy where the pattern matcher will operate. Recommended: Resource or ResourceSet.
- * @throws IncQueryException if an error occurs during pattern matcher creation
- * @deprecated use {@link #on(IncQueryEngine)} instead, e.g. in conjunction with {@link IncQueryEngine#on(Notifier)}
- *
- */
- @Deprecated
- public EClassMatcher(final Notifier emfRoot) throws IncQueryException {
- this(IncQueryEngine.on(emfRoot));
- }
-
- /**
- * Initializes the pattern matcher within an existing EMF-IncQuery engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing EMF-IncQuery engine in which this matcher will be created.
- * @throws IncQueryException if an error occurs during pattern matcher creation
- * @deprecated use {@link #on(IncQueryEngine)} instead
- *
- */
- @Deprecated
- public EClassMatcher(final IncQueryEngine engine) throws IncQueryException {
- super(engine, querySpecification());
- }
-
- /**
- * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pEc the fixed value of pattern parameter ec, or null if not bound.
- * @return matches represented as a EClassMatch object.
- *
- */
- public Collection<EClassMatch> getAllMatches(final EClass pEc) {
- return rawGetAllMatches(new Object[]{pEc});
- }
-
- /**
- * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pEc the fixed value of pattern parameter ec, or null if not bound.
- * @return a match represented as a EClassMatch object, or null if no match is found.
- *
- */
- public EClassMatch getOneArbitraryMatch(final EClass pEc) {
- return rawGetOneArbitraryMatch(new Object[]{pEc});
- }
-
- /**
- * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
- * under any possible substitution of the unspecified parameters (if any).
- * @param pEc the fixed value of pattern parameter ec, or null if not bound.
- * @return true if the input is a valid (partial) match of the pattern.
- *
- */
- public boolean hasMatch(final EClass pEc) {
- return rawHasMatch(new Object[]{pEc});
- }
-
- /**
- * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pEc the fixed value of pattern parameter ec, or null if not bound.
- * @return the number of pattern matches found.
- *
- */
- public int countMatches(final EClass pEc) {
- return rawCountMatches(new Object[]{pEc});
- }
-
- /**
- * Executes the given processor on each match of the pattern that conforms to the given fixed values of some parameters.
- * @param pEc the fixed value of pattern parameter ec, or null if not bound.
- * @param processor the action that will process each pattern match.
- *
- */
- public void forEachMatch(final EClass pEc, final IMatchProcessor<? super EClassMatch> processor) {
- rawForEachMatch(new Object[]{pEc}, processor);
- }
-
- /**
- * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pEc the fixed value of pattern parameter ec, or null if not bound.
- * @param processor the action that will process the selected match.
- * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
- *
- */
- public boolean forOneArbitraryMatch(final EClass pEc, final IMatchProcessor<? super EClassMatch> processor) {
- return rawForOneArbitraryMatch(new Object[]{pEc}, processor);
- }
-
- /**
- * Registers a new filtered delta monitor on this pattern matcher.
- * The DeltaMonitor can be used to track changes (delta) in the set of filtered pattern matches from now on, considering those matches only that conform to the given fixed values of some parameters.
- * It can also be reset to track changes from a later point in time,
- * and changes can even be acknowledged on an individual basis.
- * See {@link DeltaMonitor} for details.
- * @param fillAtStart if true, all current matches are reported as new match events; if false, the delta monitor starts empty.
- * @param pEc the fixed value of pattern parameter ec, or null if not bound.
- * @return the delta monitor.
- * @deprecated use the IncQuery Databinding API (IncQueryObservables) instead.
- *
- */
- @Deprecated
- public DeltaMonitor<EClassMatch> newFilteredDeltaMonitor(final boolean fillAtStart, final EClass pEc) {
- return rawNewFilteredDeltaMonitor(fillAtStart, new Object[]{pEc});
- }
-
- /**
- * Returns a new (partial) Match object for the matcher.
- * This can be used e.g. to call the matcher with a partial match.
- * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pEc the fixed value of pattern parameter ec, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public EClassMatch newMatch(final EClass pEc) {
- return new EClassMatch.Immutable(pEc);
-
- }
-
- /**
- * Retrieve the set of values that occur in matches for ec.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- protected Set<EClass> rawAccumulateAllValuesOfec(final Object[] parameters) {
- Set<EClass> results = new HashSet<EClass>();
- rawAccumulateAllValues(POSITION_EC, parameters, results);
- return results;
- }
-
- /**
- * Retrieve the set of values that occur in matches for ec.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<EClass> getAllValuesOfec() {
- return rawAccumulateAllValuesOfec(emptyArray());
- }
-
- @Override
- protected EClassMatch tupleToMatch(final Tuple t) {
- try {
- return new EClassMatch.Immutable((org.eclipse.emf.ecore.EClass) t.get(POSITION_EC));
- } catch(ClassCastException e) {engine.getLogger().error("Element(s) in tuple not properly typed!",e); //throw new IncQueryRuntimeException(e.getMessage());
- return null;
- }
-
- }
-
- @Override
- protected EClassMatch arrayToMatch(final Object[] match) {
- try {
- return new EClassMatch.Immutable((org.eclipse.emf.ecore.EClass) match[POSITION_EC]);
- } catch(ClassCastException e) {engine.getLogger().error("Element(s) in array not properly typed!",e); //throw new IncQueryRuntimeException(e.getMessage());
- return null;
- }
-
- }
-
- @Override
- protected EClassMatch arrayToMatchMutable(final Object[] match) {
- try {
- return new EClassMatch.Mutable((org.eclipse.emf.ecore.EClass) match[POSITION_EC]);
- } catch(ClassCastException e) {engine.getLogger().error("Element(s) in array not properly typed!",e); //throw new IncQueryRuntimeException(e.getMessage());
- return null;
- }
-
- }
-}
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/EClassNamesKeywordMatch.java b/examples/headless-maven/incquery-demo/src/main/java/headless/EClassNamesKeywordMatch.java
deleted file mode 100644
index 9275dd407..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/EClassNamesKeywordMatch.java
+++ /dev/null
@@ -1,180 +0,0 @@
-package headless;
-
-import headless.util.EClassNamesKeywordQuerySpecification;
-import java.util.Arrays;
-import java.util.List;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.incquery.runtime.api.IPatternMatch;
-import org.eclipse.incquery.runtime.api.impl.BasePatternMatch;
-import org.eclipse.incquery.runtime.exception.IncQueryException;
-
-/**
- * Pattern-specific match representation of the headless.eClassNamesKeyword pattern,
- * to be used in conjunction with {@link EClassNamesKeywordMatcher}.
- *
- * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
- * Each instance is a (possibly partial) substitution of pattern parameters,
- * usable to represent a match of the pattern in the result of a query,
- * or to specify the bound (fixed) input parameters when issuing a query.
- *
- * @see EClassNamesKeywordMatcher
- * @see EClassNamesKeywordProcessor
- *
- */
-@SuppressWarnings("all")
-public abstract class EClassNamesKeywordMatch extends BasePatternMatch {
- private EClass fC;
-
- private String fN;
-
- private static List<String> parameterNames = makeImmutableList("c", "n");
-
- private EClassNamesKeywordMatch(final EClass pC, final String pN) {
- this.fC = pC;
- this.fN = pN;
-
- }
-
- @Override
- public Object get(final String parameterName) {
- if ("c".equals(parameterName)) return this.fC;
- if ("n".equals(parameterName)) return this.fN;
- return null;
-
- }
-
- public EClass getC() {
- return this.fC;
-
- }
-
- public String getN() {
- return this.fN;
-
- }
-
- @Override
- public boolean set(final String parameterName, final Object newValue) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- if ("c".equals(parameterName) ) {
- this.fC = (org.eclipse.emf.ecore.EClass) newValue;
- return true;
- }
- if ("n".equals(parameterName) ) {
- this.fN = (java.lang.String) newValue;
- return true;
- }
- return false;
-
- }
-
- public void setC(final EClass pC) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fC = pC;
-
- }
-
- public void setN(final String pN) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fN = pN;
-
- }
-
- @Override
- public String patternName() {
- return "headless.eClassNamesKeyword";
-
- }
-
- @Override
- public List<String> parameterNames() {
- return EClassNamesKeywordMatch.parameterNames;
-
- }
-
- @Override
- public Object[] toArray() {
- return new Object[]{fC, fN};
-
- }
-
- @Override
- public String prettyPrint() {
- StringBuilder result = new StringBuilder();
- result.append("\"c\"=" + prettyPrintValue(fC) + ", ");
- result.append("\"n\"=" + prettyPrintValue(fN));
- return result.toString();
-
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((fC == null) ? 0 : fC.hashCode());
- result = prime * result + ((fN == null) ? 0 : fN.hashCode());
- return result;
-
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj)
- return true;
- if (!(obj instanceof EClassNamesKeywordMatch)) { // this should be infrequent
- if (obj == null)
- return false;
- if (!(obj instanceof IPatternMatch))
- return false;
- IPatternMatch otherSig = (IPatternMatch) obj;
- if (!specification().equals(otherSig.specification()))
- return false;
- return Arrays.deepEquals(toArray(), otherSig.toArray());
- }
- EClassNamesKeywordMatch other = (EClassNamesKeywordMatch) obj;
- if (fC == null) {if (other.fC != null) return false;}
- else if (!fC.equals(other.fC)) return false;
- if (fN == null) {if (other.fN != null) return false;}
- else if (!fN.equals(other.fN)) return false;
- return true;
- }
-
- @Override
- public EClassNamesKeywordQuerySpecification specification() {
- try {
- return EClassNamesKeywordQuerySpecification.instance();
- } catch (IncQueryException ex) {
- // This cannot happen, as the match object can only be instantiated if the query specification exists
- throw new IllegalStateException (ex);
- }
-
- }
-
- @SuppressWarnings("all")
- static final class Mutable extends EClassNamesKeywordMatch {
- Mutable(final EClass pC, final String pN) {
- super(pC, pN);
-
- }
-
- @Override
- public boolean isMutable() {
- return true;
- }
- }
-
-
- @SuppressWarnings("all")
- static final class Immutable extends EClassNamesKeywordMatch {
- Immutable(final EClass pC, final String pN) {
- super(pC, pN);
-
- }
-
- @Override
- public boolean isMutable() {
- return false;
- }
- }
-
-}
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/EClassNamesKeywordMatcher.java b/examples/headless-maven/incquery-demo/src/main/java/headless/EClassNamesKeywordMatcher.java
deleted file mode 100644
index 18501b6ca..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/EClassNamesKeywordMatcher.java
+++ /dev/null
@@ -1,312 +0,0 @@
-package headless;
-
-import headless.EClassNamesKeywordMatch;
-import headless.util.EClassNamesKeywordQuerySpecification;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.incquery.runtime.api.IMatchProcessor;
-import org.eclipse.incquery.runtime.api.IQuerySpecification;
-import org.eclipse.incquery.runtime.api.IncQueryEngine;
-import org.eclipse.incquery.runtime.api.impl.BaseMatcher;
-import org.eclipse.incquery.runtime.exception.IncQueryException;
-import org.eclipse.incquery.runtime.matchers.tuple.Tuple;
-import org.eclipse.incquery.runtime.rete.misc.DeltaMonitor;
-
-/**
- * Generated pattern matcher API of the headless.eClassNamesKeyword pattern,
- * providing pattern-specific query methods.
- *
- * <p>Use the pattern matcher on a given model via {@link #on(IncQueryEngine)},
- * e.g. in conjunction with {@link IncQueryEngine#on(Notifier)}.
- *
- * <p>Matches of the pattern will be represented as {@link EClassNamesKeywordMatch}.
- *
- * <p>Original source:
- * <code><pre>
- * pattern eClassNamesKeyword(c: EClass, n: EString)
- * {
- * EClass.name(c,n);
- * check("A" == n);
- * }
- * </pre></code>
- *
- * @see EClassNamesKeywordMatch
- * @see EClassNamesKeywordProcessor
- * @see EClassNamesKeywordQuerySpecification
- *
- */
-@SuppressWarnings("all")
-public class EClassNamesKeywordMatcher extends BaseMatcher<EClassNamesKeywordMatch> {
- /**
- * @return the singleton instance of the query specification of this pattern
- * @throws IncQueryException if the pattern definition could not be loaded
- *
- */
- public static IQuerySpecification<EClassNamesKeywordMatcher> querySpecification() throws IncQueryException {
- return EClassNamesKeywordQuerySpecification.instance();
- }
-
- /**
- * Initializes the pattern matcher within an existing EMF-IncQuery engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing EMF-IncQuery engine in which this matcher will be created.
- * @throws IncQueryException if an error occurs during pattern matcher creation
- *
- */
- public static EClassNamesKeywordMatcher on(final IncQueryEngine engine) throws IncQueryException {
- // check if matcher already exists
- EClassNamesKeywordMatcher matcher = engine.getExistingMatcher(querySpecification());
- if (matcher == null) {
- matcher = new EClassNamesKeywordMatcher(engine);
- // do not have to "put" it into engine.matchers, reportMatcherInitialized() will take care of it
- }
- return matcher;
- }
-
- private final static int POSITION_C = 0;
-
- private final static int POSITION_N = 1;
-
- /**
- * Initializes the pattern matcher over a given EMF model root (recommended: Resource or ResourceSet).
- * If a pattern matcher is already constructed with the same root, only a light-weight reference is returned.
- * The scope of pattern matching will be the given EMF model root and below (see FAQ for more precise definition).
- * The match set will be incrementally refreshed upon updates from this scope.
- * <p>The matcher will be created within the managed {@link IncQueryEngine} belonging to the EMF model root, so
- * multiple matchers will reuse the same engine and benefit from increased performance and reduced memory footprint.
- * @param emfRoot the root of the EMF containment hierarchy where the pattern matcher will operate. Recommended: Resource or ResourceSet.
- * @throws IncQueryException if an error occurs during pattern matcher creation
- * @deprecated use {@link #on(IncQueryEngine)} instead, e.g. in conjunction with {@link IncQueryEngine#on(Notifier)}
- *
- */
- @Deprecated
- public EClassNamesKeywordMatcher(final Notifier emfRoot) throws IncQueryException {
- this(IncQueryEngine.on(emfRoot));
- }
-
- /**
- * Initializes the pattern matcher within an existing EMF-IncQuery engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing EMF-IncQuery engine in which this matcher will be created.
- * @throws IncQueryException if an error occurs during pattern matcher creation
- * @deprecated use {@link #on(IncQueryEngine)} instead
- *
- */
- @Deprecated
- public EClassNamesKeywordMatcher(final IncQueryEngine engine) throws IncQueryException {
- super(engine, querySpecification());
- }
-
- /**
- * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pC the fixed value of pattern parameter c, or null if not bound.
- * @param pN the fixed value of pattern parameter n, or null if not bound.
- * @return matches represented as a EClassNamesKeywordMatch object.
- *
- */
- public Collection<EClassNamesKeywordMatch> getAllMatches(final EClass pC, final String pN) {
- return rawGetAllMatches(new Object[]{pC, pN});
- }
-
- /**
- * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pC the fixed value of pattern parameter c, or null if not bound.
- * @param pN the fixed value of pattern parameter n, or null if not bound.
- * @return a match represented as a EClassNamesKeywordMatch object, or null if no match is found.
- *
- */
- public EClassNamesKeywordMatch getOneArbitraryMatch(final EClass pC, final String pN) {
- return rawGetOneArbitraryMatch(new Object[]{pC, pN});
- }
-
- /**
- * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
- * under any possible substitution of the unspecified parameters (if any).
- * @param pC the fixed value of pattern parameter c, or null if not bound.
- * @param pN the fixed value of pattern parameter n, or null if not bound.
- * @return true if the input is a valid (partial) match of the pattern.
- *
- */
- public boolean hasMatch(final EClass pC, final String pN) {
- return rawHasMatch(new Object[]{pC, pN});
- }
-
- /**
- * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pC the fixed value of pattern parameter c, or null if not bound.
- * @param pN the fixed value of pattern parameter n, or null if not bound.
- * @return the number of pattern matches found.
- *
- */
- public int countMatches(final EClass pC, final String pN) {
- return rawCountMatches(new Object[]{pC, pN});
- }
-
- /**
- * Executes the given processor on each match of the pattern that conforms to the given fixed values of some parameters.
- * @param pC the fixed value of pattern parameter c, or null if not bound.
- * @param pN the fixed value of pattern parameter n, or null if not bound.
- * @param processor the action that will process each pattern match.
- *
- */
- public void forEachMatch(final EClass pC, final String pN, final IMatchProcessor<? super EClassNamesKeywordMatch> processor) {
- rawForEachMatch(new Object[]{pC, pN}, processor);
- }
-
- /**
- * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pC the fixed value of pattern parameter c, or null if not bound.
- * @param pN the fixed value of pattern parameter n, or null if not bound.
- * @param processor the action that will process the selected match.
- * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
- *
- */
- public boolean forOneArbitraryMatch(final EClass pC, final String pN, final IMatchProcessor<? super EClassNamesKeywordMatch> processor) {
- return rawForOneArbitraryMatch(new Object[]{pC, pN}, processor);
- }
-
- /**
- * Registers a new filtered delta monitor on this pattern matcher.
- * The DeltaMonitor can be used to track changes (delta) in the set of filtered pattern matches from now on, considering those matches only that conform to the given fixed values of some parameters.
- * It can also be reset to track changes from a later point in time,
- * and changes can even be acknowledged on an individual basis.
- * See {@link DeltaMonitor} for details.
- * @param fillAtStart if true, all current matches are reported as new match events; if false, the delta monitor starts empty.
- * @param pC the fixed value of pattern parameter c, or null if not bound.
- * @param pN the fixed value of pattern parameter n, or null if not bound.
- * @return the delta monitor.
- * @deprecated use the IncQuery Databinding API (IncQueryObservables) instead.
- *
- */
- @Deprecated
- public DeltaMonitor<EClassNamesKeywordMatch> newFilteredDeltaMonitor(final boolean fillAtStart, final EClass pC, final String pN) {
- return rawNewFilteredDeltaMonitor(fillAtStart, new Object[]{pC, pN});
- }
-
- /**
- * Returns a new (partial) Match object for the matcher.
- * This can be used e.g. to call the matcher with a partial match.
- * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pC the fixed value of pattern parameter c, or null if not bound.
- * @param pN the fixed value of pattern parameter n, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public EClassNamesKeywordMatch newMatch(final EClass pC, final String pN) {
- return new EClassNamesKeywordMatch.Immutable(pC, pN);
-
- }
-
- /**
- * Retrieve the set of values that occur in matches for c.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- protected Set<EClass> rawAccumulateAllValuesOfc(final Object[] parameters) {
- Set<EClass> results = new HashSet<EClass>();
- rawAccumulateAllValues(POSITION_C, parameters, results);
- return results;
- }
-
- /**
- * Retrieve the set of values that occur in matches for c.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<EClass> getAllValuesOfc() {
- return rawAccumulateAllValuesOfc(emptyArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for c.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<EClass> getAllValuesOfc(final EClassNamesKeywordMatch partialMatch) {
- return rawAccumulateAllValuesOfc(partialMatch.toArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for c.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<EClass> getAllValuesOfc(final String pN) {
- return rawAccumulateAllValuesOfc(new Object[]{null, pN});
- }
-
- /**
- * Retrieve the set of values that occur in matches for n.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- protected Set<String> rawAccumulateAllValuesOfn(final Object[] parameters) {
- Set<String> results = new HashSet<String>();
- rawAccumulateAllValues(POSITION_N, parameters, results);
- return results;
- }
-
- /**
- * Retrieve the set of values that occur in matches for n.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<String> getAllValuesOfn() {
- return rawAccumulateAllValuesOfn(emptyArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for n.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<String> getAllValuesOfn(final EClassNamesKeywordMatch partialMatch) {
- return rawAccumulateAllValuesOfn(partialMatch.toArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for n.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<String> getAllValuesOfn(final EClass pC) {
- return rawAccumulateAllValuesOfn(new Object[]{pC, null});
- }
-
- @Override
- protected EClassNamesKeywordMatch tupleToMatch(final Tuple t) {
- try {
- return new EClassNamesKeywordMatch.Immutable((org.eclipse.emf.ecore.EClass) t.get(POSITION_C), (java.lang.String) t.get(POSITION_N));
- } catch(ClassCastException e) {engine.getLogger().error("Element(s) in tuple not properly typed!",e); //throw new IncQueryRuntimeException(e.getMessage());
- return null;
- }
-
- }
-
- @Override
- protected EClassNamesKeywordMatch arrayToMatch(final Object[] match) {
- try {
- return new EClassNamesKeywordMatch.Immutable((org.eclipse.emf.ecore.EClass) match[POSITION_C], (java.lang.String) match[POSITION_N]);
- } catch(ClassCastException e) {engine.getLogger().error("Element(s) in array not properly typed!",e); //throw new IncQueryRuntimeException(e.getMessage());
- return null;
- }
-
- }
-
- @Override
- protected EClassNamesKeywordMatch arrayToMatchMutable(final Object[] match) {
- try {
- return new EClassNamesKeywordMatch.Mutable((org.eclipse.emf.ecore.EClass) match[POSITION_C], (java.lang.String) match[POSITION_N]);
- } catch(ClassCastException e) {engine.getLogger().error("Element(s) in array not properly typed!",e); //throw new IncQueryRuntimeException(e.getMessage());
- return null;
- }
-
- }
-}
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/EClassNamesMatch.java b/examples/headless-maven/incquery-demo/src/main/java/headless/EClassNamesMatch.java
deleted file mode 100644
index 53e6f28d0..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/EClassNamesMatch.java
+++ /dev/null
@@ -1,180 +0,0 @@
-package headless;
-
-import headless.util.EClassNamesQuerySpecification;
-import java.util.Arrays;
-import java.util.List;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.incquery.runtime.api.IPatternMatch;
-import org.eclipse.incquery.runtime.api.impl.BasePatternMatch;
-import org.eclipse.incquery.runtime.exception.IncQueryException;
-
-/**
- * Pattern-specific match representation of the headless.eClassNames pattern,
- * to be used in conjunction with {@link EClassNamesMatcher}.
- *
- * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
- * Each instance is a (possibly partial) substitution of pattern parameters,
- * usable to represent a match of the pattern in the result of a query,
- * or to specify the bound (fixed) input parameters when issuing a query.
- *
- * @see EClassNamesMatcher
- * @see EClassNamesProcessor
- *
- */
-@SuppressWarnings("all")
-public abstract class EClassNamesMatch extends BasePatternMatch {
- private EClass fC;
-
- private String fN;
-
- private static List<String> parameterNames = makeImmutableList("c", "n");
-
- private EClassNamesMatch(final EClass pC, final String pN) {
- this.fC = pC;
- this.fN = pN;
-
- }
-
- @Override
- public Object get(final String parameterName) {
- if ("c".equals(parameterName)) return this.fC;
- if ("n".equals(parameterName)) return this.fN;
- return null;
-
- }
-
- public EClass getC() {
- return this.fC;
-
- }
-
- public String getN() {
- return this.fN;
-
- }
-
- @Override
- public boolean set(final String parameterName, final Object newValue) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- if ("c".equals(parameterName) ) {
- this.fC = (org.eclipse.emf.ecore.EClass) newValue;
- return true;
- }
- if ("n".equals(parameterName) ) {
- this.fN = (java.lang.String) newValue;
- return true;
- }
- return false;
-
- }
-
- public void setC(final EClass pC) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fC = pC;
-
- }
-
- public void setN(final String pN) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fN = pN;
-
- }
-
- @Override
- public String patternName() {
- return "headless.eClassNames";
-
- }
-
- @Override
- public List<String> parameterNames() {
- return EClassNamesMatch.parameterNames;
-
- }
-
- @Override
- public Object[] toArray() {
- return new Object[]{fC, fN};
-
- }
-
- @Override
- public String prettyPrint() {
- StringBuilder result = new StringBuilder();
- result.append("\"c\"=" + prettyPrintValue(fC) + ", ");
- result.append("\"n\"=" + prettyPrintValue(fN));
- return result.toString();
-
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((fC == null) ? 0 : fC.hashCode());
- result = prime * result + ((fN == null) ? 0 : fN.hashCode());
- return result;
-
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj)
- return true;
- if (!(obj instanceof EClassNamesMatch)) { // this should be infrequent
- if (obj == null)
- return false;
- if (!(obj instanceof IPatternMatch))
- return false;
- IPatternMatch otherSig = (IPatternMatch) obj;
- if (!specification().equals(otherSig.specification()))
- return false;
- return Arrays.deepEquals(toArray(), otherSig.toArray());
- }
- EClassNamesMatch other = (EClassNamesMatch) obj;
- if (fC == null) {if (other.fC != null) return false;}
- else if (!fC.equals(other.fC)) return false;
- if (fN == null) {if (other.fN != null) return false;}
- else if (!fN.equals(other.fN)) return false;
- return true;
- }
-
- @Override
- public EClassNamesQuerySpecification specification() {
- try {
- return EClassNamesQuerySpecification.instance();
- } catch (IncQueryException ex) {
- // This cannot happen, as the match object can only be instantiated if the query specification exists
- throw new IllegalStateException (ex);
- }
-
- }
-
- @SuppressWarnings("all")
- static final class Mutable extends EClassNamesMatch {
- Mutable(final EClass pC, final String pN) {
- super(pC, pN);
-
- }
-
- @Override
- public boolean isMutable() {
- return true;
- }
- }
-
-
- @SuppressWarnings("all")
- static final class Immutable extends EClassNamesMatch {
- Immutable(final EClass pC, final String pN) {
- super(pC, pN);
-
- }
-
- @Override
- public boolean isMutable() {
- return false;
- }
- }
-
-}
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/EClassNamesMatcher.java b/examples/headless-maven/incquery-demo/src/main/java/headless/EClassNamesMatcher.java
deleted file mode 100644
index 8680eae48..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/EClassNamesMatcher.java
+++ /dev/null
@@ -1,310 +0,0 @@
-package headless;
-
-import headless.EClassNamesMatch;
-import headless.util.EClassNamesQuerySpecification;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.incquery.runtime.api.IMatchProcessor;
-import org.eclipse.incquery.runtime.api.IQuerySpecification;
-import org.eclipse.incquery.runtime.api.IncQueryEngine;
-import org.eclipse.incquery.runtime.api.impl.BaseMatcher;
-import org.eclipse.incquery.runtime.exception.IncQueryException;
-import org.eclipse.incquery.runtime.matchers.tuple.Tuple;
-import org.eclipse.incquery.runtime.rete.misc.DeltaMonitor;
-
-/**
- * Generated pattern matcher API of the headless.eClassNames pattern,
- * providing pattern-specific query methods.
- *
- * <p>Use the pattern matcher on a given model via {@link #on(IncQueryEngine)},
- * e.g. in conjunction with {@link IncQueryEngine#on(Notifier)}.
- *
- * <p>Matches of the pattern will be represented as {@link EClassNamesMatch}.
- *
- * <p>Original source:
- * <code><pre>
- * pattern eClassNames(c: EClass, n : EString)= {
- * EClass.name(c,n);
- * }
- * </pre></code>
- *
- * @see EClassNamesMatch
- * @see EClassNamesProcessor
- * @see EClassNamesQuerySpecification
- *
- */
-@SuppressWarnings("all")
-public class EClassNamesMatcher extends BaseMatcher<EClassNamesMatch> {
- /**
- * @return the singleton instance of the query specification of this pattern
- * @throws IncQueryException if the pattern definition could not be loaded
- *
- */
- public static IQuerySpecification<EClassNamesMatcher> querySpecification() throws IncQueryException {
- return EClassNamesQuerySpecification.instance();
- }
-
- /**
- * Initializes the pattern matcher within an existing EMF-IncQuery engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing EMF-IncQuery engine in which this matcher will be created.
- * @throws IncQueryException if an error occurs during pattern matcher creation
- *
- */
- public static EClassNamesMatcher on(final IncQueryEngine engine) throws IncQueryException {
- // check if matcher already exists
- EClassNamesMatcher matcher = engine.getExistingMatcher(querySpecification());
- if (matcher == null) {
- matcher = new EClassNamesMatcher(engine);
- // do not have to "put" it into engine.matchers, reportMatcherInitialized() will take care of it
- }
- return matcher;
- }
-
- private final static int POSITION_C = 0;
-
- private final static int POSITION_N = 1;
-
- /**
- * Initializes the pattern matcher over a given EMF model root (recommended: Resource or ResourceSet).
- * If a pattern matcher is already constructed with the same root, only a light-weight reference is returned.
- * The scope of pattern matching will be the given EMF model root and below (see FAQ for more precise definition).
- * The match set will be incrementally refreshed upon updates from this scope.
- * <p>The matcher will be created within the managed {@link IncQueryEngine} belonging to the EMF model root, so
- * multiple matchers will reuse the same engine and benefit from increased performance and reduced memory footprint.
- * @param emfRoot the root of the EMF containment hierarchy where the pattern matcher will operate. Recommended: Resource or ResourceSet.
- * @throws IncQueryException if an error occurs during pattern matcher creation
- * @deprecated use {@link #on(IncQueryEngine)} instead, e.g. in conjunction with {@link IncQueryEngine#on(Notifier)}
- *
- */
- @Deprecated
- public EClassNamesMatcher(final Notifier emfRoot) throws IncQueryException {
- this(IncQueryEngine.on(emfRoot));
- }
-
- /**
- * Initializes the pattern matcher within an existing EMF-IncQuery engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing EMF-IncQuery engine in which this matcher will be created.
- * @throws IncQueryException if an error occurs during pattern matcher creation
- * @deprecated use {@link #on(IncQueryEngine)} instead
- *
- */
- @Deprecated
- public EClassNamesMatcher(final IncQueryEngine engine) throws IncQueryException {
- super(engine, querySpecification());
- }
-
- /**
- * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pC the fixed value of pattern parameter c, or null if not bound.
- * @param pN the fixed value of pattern parameter n, or null if not bound.
- * @return matches represented as a EClassNamesMatch object.
- *
- */
- public Collection<EClassNamesMatch> getAllMatches(final EClass pC, final String pN) {
- return rawGetAllMatches(new Object[]{pC, pN});
- }
-
- /**
- * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pC the fixed value of pattern parameter c, or null if not bound.
- * @param pN the fixed value of pattern parameter n, or null if not bound.
- * @return a match represented as a EClassNamesMatch object, or null if no match is found.
- *
- */
- public EClassNamesMatch getOneArbitraryMatch(final EClass pC, final String pN) {
- return rawGetOneArbitraryMatch(new Object[]{pC, pN});
- }
-
- /**
- * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
- * under any possible substitution of the unspecified parameters (if any).
- * @param pC the fixed value of pattern parameter c, or null if not bound.
- * @param pN the fixed value of pattern parameter n, or null if not bound.
- * @return true if the input is a valid (partial) match of the pattern.
- *
- */
- public boolean hasMatch(final EClass pC, final String pN) {
- return rawHasMatch(new Object[]{pC, pN});
- }
-
- /**
- * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pC the fixed value of pattern parameter c, or null if not bound.
- * @param pN the fixed value of pattern parameter n, or null if not bound.
- * @return the number of pattern matches found.
- *
- */
- public int countMatches(final EClass pC, final String pN) {
- return rawCountMatches(new Object[]{pC, pN});
- }
-
- /**
- * Executes the given processor on each match of the pattern that conforms to the given fixed values of some parameters.
- * @param pC the fixed value of pattern parameter c, or null if not bound.
- * @param pN the fixed value of pattern parameter n, or null if not bound.
- * @param processor the action that will process each pattern match.
- *
- */
- public void forEachMatch(final EClass pC, final String pN, final IMatchProcessor<? super EClassNamesMatch> processor) {
- rawForEachMatch(new Object[]{pC, pN}, processor);
- }
-
- /**
- * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pC the fixed value of pattern parameter c, or null if not bound.
- * @param pN the fixed value of pattern parameter n, or null if not bound.
- * @param processor the action that will process the selected match.
- * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
- *
- */
- public boolean forOneArbitraryMatch(final EClass pC, final String pN, final IMatchProcessor<? super EClassNamesMatch> processor) {
- return rawForOneArbitraryMatch(new Object[]{pC, pN}, processor);
- }
-
- /**
- * Registers a new filtered delta monitor on this pattern matcher.
- * The DeltaMonitor can be used to track changes (delta) in the set of filtered pattern matches from now on, considering those matches only that conform to the given fixed values of some parameters.
- * It can also be reset to track changes from a later point in time,
- * and changes can even be acknowledged on an individual basis.
- * See {@link DeltaMonitor} for details.
- * @param fillAtStart if true, all current matches are reported as new match events; if false, the delta monitor starts empty.
- * @param pC the fixed value of pattern parameter c, or null if not bound.
- * @param pN the fixed value of pattern parameter n, or null if not bound.
- * @return the delta monitor.
- * @deprecated use the IncQuery Databinding API (IncQueryObservables) instead.
- *
- */
- @Deprecated
- public DeltaMonitor<EClassNamesMatch> newFilteredDeltaMonitor(final boolean fillAtStart, final EClass pC, final String pN) {
- return rawNewFilteredDeltaMonitor(fillAtStart, new Object[]{pC, pN});
- }
-
- /**
- * Returns a new (partial) Match object for the matcher.
- * This can be used e.g. to call the matcher with a partial match.
- * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pC the fixed value of pattern parameter c, or null if not bound.
- * @param pN the fixed value of pattern parameter n, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public EClassNamesMatch newMatch(final EClass pC, final String pN) {
- return new EClassNamesMatch.Immutable(pC, pN);
-
- }
-
- /**
- * Retrieve the set of values that occur in matches for c.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- protected Set<EClass> rawAccumulateAllValuesOfc(final Object[] parameters) {
- Set<EClass> results = new HashSet<EClass>();
- rawAccumulateAllValues(POSITION_C, parameters, results);
- return results;
- }
-
- /**
- * Retrieve the set of values that occur in matches for c.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<EClass> getAllValuesOfc() {
- return rawAccumulateAllValuesOfc(emptyArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for c.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<EClass> getAllValuesOfc(final EClassNamesMatch partialMatch) {
- return rawAccumulateAllValuesOfc(partialMatch.toArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for c.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<EClass> getAllValuesOfc(final String pN) {
- return rawAccumulateAllValuesOfc(new Object[]{null, pN});
- }
-
- /**
- * Retrieve the set of values that occur in matches for n.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- protected Set<String> rawAccumulateAllValuesOfn(final Object[] parameters) {
- Set<String> results = new HashSet<String>();
- rawAccumulateAllValues(POSITION_N, parameters, results);
- return results;
- }
-
- /**
- * Retrieve the set of values that occur in matches for n.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<String> getAllValuesOfn() {
- return rawAccumulateAllValuesOfn(emptyArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for n.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<String> getAllValuesOfn(final EClassNamesMatch partialMatch) {
- return rawAccumulateAllValuesOfn(partialMatch.toArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for n.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<String> getAllValuesOfn(final EClass pC) {
- return rawAccumulateAllValuesOfn(new Object[]{pC, null});
- }
-
- @Override
- protected EClassNamesMatch tupleToMatch(final Tuple t) {
- try {
- return new EClassNamesMatch.Immutable((org.eclipse.emf.ecore.EClass) t.get(POSITION_C), (java.lang.String) t.get(POSITION_N));
- } catch(ClassCastException e) {engine.getLogger().error("Element(s) in tuple not properly typed!",e); //throw new IncQueryRuntimeException(e.getMessage());
- return null;
- }
-
- }
-
- @Override
- protected EClassNamesMatch arrayToMatch(final Object[] match) {
- try {
- return new EClassNamesMatch.Immutable((org.eclipse.emf.ecore.EClass) match[POSITION_C], (java.lang.String) match[POSITION_N]);
- } catch(ClassCastException e) {engine.getLogger().error("Element(s) in array not properly typed!",e); //throw new IncQueryRuntimeException(e.getMessage());
- return null;
- }
-
- }
-
- @Override
- protected EClassNamesMatch arrayToMatchMutable(final Object[] match) {
- try {
- return new EClassNamesMatch.Mutable((org.eclipse.emf.ecore.EClass) match[POSITION_C], (java.lang.String) match[POSITION_N]);
- } catch(ClassCastException e) {engine.getLogger().error("Element(s) in array not properly typed!",e); //throw new IncQueryRuntimeException(e.getMessage());
- return null;
- }
-
- }
-}
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/EObjectMatch.java b/examples/headless-maven/incquery-demo/src/main/java/headless/EObjectMatch.java
deleted file mode 100644
index bfbe23637..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/EObjectMatch.java
+++ /dev/null
@@ -1,157 +0,0 @@
-package headless;
-
-import headless.util.EObjectQuerySpecification;
-import java.util.Arrays;
-import java.util.List;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.incquery.runtime.api.IPatternMatch;
-import org.eclipse.incquery.runtime.api.impl.BasePatternMatch;
-import org.eclipse.incquery.runtime.exception.IncQueryException;
-
-/**
- * Pattern-specific match representation of the headless.eObject pattern,
- * to be used in conjunction with {@link EObjectMatcher}.
- *
- * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
- * Each instance is a (possibly partial) substitution of pattern parameters,
- * usable to represent a match of the pattern in the result of a query,
- * or to specify the bound (fixed) input parameters when issuing a query.
- *
- * @see EObjectMatcher
- * @see EObjectProcessor
- *
- */
-@SuppressWarnings("all")
-public abstract class EObjectMatch extends BasePatternMatch {
- private EObject fO;
-
- private static List<String> parameterNames = makeImmutableList("o");
-
- private EObjectMatch(final EObject pO) {
- this.fO = pO;
-
- }
-
- @Override
- public Object get(final String parameterName) {
- if ("o".equals(parameterName)) return this.fO;
- return null;
-
- }
-
- public EObject getO() {
- return this.fO;
-
- }
-
- @Override
- public boolean set(final String parameterName, final Object newValue) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- if ("o".equals(parameterName) ) {
- this.fO = (org.eclipse.emf.ecore.EObject) newValue;
- return true;
- }
- return false;
-
- }
-
- public void setO(final EObject pO) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fO = pO;
-
- }
-
- @Override
- public String patternName() {
- return "headless.eObject";
-
- }
-
- @Override
- public List<String> parameterNames() {
- return EObjectMatch.parameterNames;
-
- }
-
- @Override
- public Object[] toArray() {
- return new Object[]{fO};
-
- }
-
- @Override
- public String prettyPrint() {
- StringBuilder result = new StringBuilder();
- result.append("\"o\"=" + prettyPrintValue(fO));
- return result.toString();
-
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((fO == null) ? 0 : fO.hashCode());
- return result;
-
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj)
- return true;
- if (!(obj instanceof EObjectMatch)) { // this should be infrequent
- if (obj == null)
- return false;
- if (!(obj instanceof IPatternMatch))
- return false;
- IPatternMatch otherSig = (IPatternMatch) obj;
- if (!specification().equals(otherSig.specification()))
- return false;
- return Arrays.deepEquals(toArray(), otherSig.toArray());
- }
- EObjectMatch other = (EObjectMatch) obj;
- if (fO == null) {if (other.fO != null) return false;}
- else if (!fO.equals(other.fO)) return false;
- return true;
- }
-
- @Override
- public EObjectQuerySpecification specification() {
- try {
- return EObjectQuerySpecification.instance();
- } catch (IncQueryException ex) {
- // This cannot happen, as the match object can only be instantiated if the query specification exists
- throw new IllegalStateException (ex);
- }
-
- }
-
- @SuppressWarnings("all")
- static final class Mutable extends EObjectMatch {
- Mutable(final EObject pO) {
- super(pO);
-
- }
-
- @Override
- public boolean isMutable() {
- return true;
- }
- }
-
-
- @SuppressWarnings("all")
- static final class Immutable extends EObjectMatch {
- Immutable(final EObject pO) {
- super(pO);
-
- }
-
- @Override
- public boolean isMutable() {
- return false;
- }
- }
-
-}
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/EObjectMatcher.java b/examples/headless-maven/incquery-demo/src/main/java/headless/EObjectMatcher.java
deleted file mode 100644
index 85281778f..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/EObjectMatcher.java
+++ /dev/null
@@ -1,244 +0,0 @@
-package headless;
-
-import headless.EObjectMatch;
-import headless.util.EObjectQuerySpecification;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.incquery.runtime.api.IMatchProcessor;
-import org.eclipse.incquery.runtime.api.IQuerySpecification;
-import org.eclipse.incquery.runtime.api.IncQueryEngine;
-import org.eclipse.incquery.runtime.api.impl.BaseMatcher;
-import org.eclipse.incquery.runtime.exception.IncQueryException;
-import org.eclipse.incquery.runtime.matchers.tuple.Tuple;
-import org.eclipse.incquery.runtime.rete.misc.DeltaMonitor;
-
-/**
- * Generated pattern matcher API of the headless.eObject pattern,
- * providing pattern-specific query methods.
- *
- * <p>Use the pattern matcher on a given model via {@link #on(IncQueryEngine)},
- * e.g. in conjunction with {@link IncQueryEngine#on(Notifier)}.
- *
- * <p>Matches of the pattern will be represented as {@link EObjectMatch}.
- *
- * <p>Original source:
- * <code><pre>
- * pattern eObject(o) {
- * EObject(o);
- * }
- * </pre></code>
- *
- * @see EObjectMatch
- * @see EObjectProcessor
- * @see EObjectQuerySpecification
- *
- */
-@SuppressWarnings("all")
-public class EObjectMatcher extends BaseMatcher<EObjectMatch> {
- /**
- * @return the singleton instance of the query specification of this pattern
- * @throws IncQueryException if the pattern definition could not be loaded
- *
- */
- public static IQuerySpecification<EObjectMatcher> querySpecification() throws IncQueryException {
- return EObjectQuerySpecification.instance();
- }
-
- /**
- * Initializes the pattern matcher within an existing EMF-IncQuery engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing EMF-IncQuery engine in which this matcher will be created.
- * @throws IncQueryException if an error occurs during pattern matcher creation
- *
- */
- public static EObjectMatcher on(final IncQueryEngine engine) throws IncQueryException {
- // check if matcher already exists
- EObjectMatcher matcher = engine.getExistingMatcher(querySpecification());
- if (matcher == null) {
- matcher = new EObjectMatcher(engine);
- // do not have to "put" it into engine.matchers, reportMatcherInitialized() will take care of it
- }
- return matcher;
- }
-
- private final static int POSITION_O = 0;
-
- /**
- * Initializes the pattern matcher over a given EMF model root (recommended: Resource or ResourceSet).
- * If a pattern matcher is already constructed with the same root, only a light-weight reference is returned.
- * The scope of pattern matching will be the given EMF model root and below (see FAQ for more precise definition).
- * The match set will be incrementally refreshed upon updates from this scope.
- * <p>The matcher will be created within the managed {@link IncQueryEngine} belonging to the EMF model root, so
- * multiple matchers will reuse the same engine and benefit from increased performance and reduced memory footprint.
- * @param emfRoot the root of the EMF containment hierarchy where the pattern matcher will operate. Recommended: Resource or ResourceSet.
- * @throws IncQueryException if an error occurs during pattern matcher creation
- * @deprecated use {@link #on(IncQueryEngine)} instead, e.g. in conjunction with {@link IncQueryEngine#on(Notifier)}
- *
- */
- @Deprecated
- public EObjectMatcher(final Notifier emfRoot) throws IncQueryException {
- this(IncQueryEngine.on(emfRoot));
- }
-
- /**
- * Initializes the pattern matcher within an existing EMF-IncQuery engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing EMF-IncQuery engine in which this matcher will be created.
- * @throws IncQueryException if an error occurs during pattern matcher creation
- * @deprecated use {@link #on(IncQueryEngine)} instead
- *
- */
- @Deprecated
- public EObjectMatcher(final IncQueryEngine engine) throws IncQueryException {
- super(engine, querySpecification());
- }
-
- /**
- * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pO the fixed value of pattern parameter o, or null if not bound.
- * @return matches represented as a EObjectMatch object.
- *
- */
- public Collection<EObjectMatch> getAllMatches(final EObject pO) {
- return rawGetAllMatches(new Object[]{pO});
- }
-
- /**
- * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pO the fixed value of pattern parameter o, or null if not bound.
- * @return a match represented as a EObjectMatch object, or null if no match is found.
- *
- */
- public EObjectMatch getOneArbitraryMatch(final EObject pO) {
- return rawGetOneArbitraryMatch(new Object[]{pO});
- }
-
- /**
- * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
- * under any possible substitution of the unspecified parameters (if any).
- * @param pO the fixed value of pattern parameter o, or null if not bound.
- * @return true if the input is a valid (partial) match of the pattern.
- *
- */
- public boolean hasMatch(final EObject pO) {
- return rawHasMatch(new Object[]{pO});
- }
-
- /**
- * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pO the fixed value of pattern parameter o, or null if not bound.
- * @return the number of pattern matches found.
- *
- */
- public int countMatches(final EObject pO) {
- return rawCountMatches(new Object[]{pO});
- }
-
- /**
- * Executes the given processor on each match of the pattern that conforms to the given fixed values of some parameters.
- * @param pO the fixed value of pattern parameter o, or null if not bound.
- * @param processor the action that will process each pattern match.
- *
- */
- public void forEachMatch(final EObject pO, final IMatchProcessor<? super EObjectMatch> processor) {
- rawForEachMatch(new Object[]{pO}, processor);
- }
-
- /**
- * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pO the fixed value of pattern parameter o, or null if not bound.
- * @param processor the action that will process the selected match.
- * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
- *
- */
- public boolean forOneArbitraryMatch(final EObject pO, final IMatchProcessor<? super EObjectMatch> processor) {
- return rawForOneArbitraryMatch(new Object[]{pO}, processor);
- }
-
- /**
- * Registers a new filtered delta monitor on this pattern matcher.
- * The DeltaMonitor can be used to track changes (delta) in the set of filtered pattern matches from now on, considering those matches only that conform to the given fixed values of some parameters.
- * It can also be reset to track changes from a later point in time,
- * and changes can even be acknowledged on an individual basis.
- * See {@link DeltaMonitor} for details.
- * @param fillAtStart if true, all current matches are reported as new match events; if false, the delta monitor starts empty.
- * @param pO the fixed value of pattern parameter o, or null if not bound.
- * @return the delta monitor.
- * @deprecated use the IncQuery Databinding API (IncQueryObservables) instead.
- *
- */
- @Deprecated
- public DeltaMonitor<EObjectMatch> newFilteredDeltaMonitor(final boolean fillAtStart, final EObject pO) {
- return rawNewFilteredDeltaMonitor(fillAtStart, new Object[]{pO});
- }
-
- /**
- * Returns a new (partial) Match object for the matcher.
- * This can be used e.g. to call the matcher with a partial match.
- * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pO the fixed value of pattern parameter o, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public EObjectMatch newMatch(final EObject pO) {
- return new EObjectMatch.Immutable(pO);
-
- }
-
- /**
- * Retrieve the set of values that occur in matches for o.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- protected Set<EObject> rawAccumulateAllValuesOfo(final Object[] parameters) {
- Set<EObject> results = new HashSet<EObject>();
- rawAccumulateAllValues(POSITION_O, parameters, results);
- return results;
- }
-
- /**
- * Retrieve the set of values that occur in matches for o.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<EObject> getAllValuesOfo() {
- return rawAccumulateAllValuesOfo(emptyArray());
- }
-
- @Override
- protected EObjectMatch tupleToMatch(final Tuple t) {
- try {
- return new EObjectMatch.Immutable((org.eclipse.emf.ecore.EObject) t.get(POSITION_O));
- } catch(ClassCastException e) {engine.getLogger().error("Element(s) in tuple not properly typed!",e); //throw new IncQueryRuntimeException(e.getMessage());
- return null;
- }
-
- }
-
- @Override
- protected EObjectMatch arrayToMatch(final Object[] match) {
- try {
- return new EObjectMatch.Immutable((org.eclipse.emf.ecore.EObject) match[POSITION_O]);
- } catch(ClassCastException e) {engine.getLogger().error("Element(s) in array not properly typed!",e); //throw new IncQueryRuntimeException(e.getMessage());
- return null;
- }
-
- }
-
- @Override
- protected EObjectMatch arrayToMatchMutable(final Object[] match) {
- try {
- return new EObjectMatch.Mutable((org.eclipse.emf.ecore.EObject) match[POSITION_O]);
- } catch(ClassCastException e) {engine.getLogger().error("Element(s) in array not properly typed!",e); //throw new IncQueryRuntimeException(e.getMessage());
- return null;
- }
-
- }
-}
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/EPackageMatch.java b/examples/headless-maven/incquery-demo/src/main/java/headless/EPackageMatch.java
deleted file mode 100644
index dbea20e28..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/EPackageMatch.java
+++ /dev/null
@@ -1,157 +0,0 @@
-package headless;
-
-import headless.util.EPackageQuerySpecification;
-import java.util.Arrays;
-import java.util.List;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.incquery.runtime.api.IPatternMatch;
-import org.eclipse.incquery.runtime.api.impl.BasePatternMatch;
-import org.eclipse.incquery.runtime.exception.IncQueryException;
-
-/**
- * Pattern-specific match representation of the headless.ePackage pattern,
- * to be used in conjunction with {@link EPackageMatcher}.
- *
- * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
- * Each instance is a (possibly partial) substitution of pattern parameters,
- * usable to represent a match of the pattern in the result of a query,
- * or to specify the bound (fixed) input parameters when issuing a query.
- *
- * @see EPackageMatcher
- * @see EPackageProcessor
- *
- */
-@SuppressWarnings("all")
-public abstract class EPackageMatch extends BasePatternMatch {
- private EPackage fP;
-
- private static List<String> parameterNames = makeImmutableList("p");
-
- private EPackageMatch(final EPackage pP) {
- this.fP = pP;
-
- }
-
- @Override
- public Object get(final String parameterName) {
- if ("p".equals(parameterName)) return this.fP;
- return null;
-
- }
-
- public EPackage getP() {
- return this.fP;
-
- }
-
- @Override
- public boolean set(final String parameterName, final Object newValue) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- if ("p".equals(parameterName) ) {
- this.fP = (org.eclipse.emf.ecore.EPackage) newValue;
- return true;
- }
- return false;
-
- }
-
- public void setP(final EPackage pP) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fP = pP;
-
- }
-
- @Override
- public String patternName() {
- return "headless.ePackage";
-
- }
-
- @Override
- public List<String> parameterNames() {
- return EPackageMatch.parameterNames;
-
- }
-
- @Override
- public Object[] toArray() {
- return new Object[]{fP};
-
- }
-
- @Override
- public String prettyPrint() {
- StringBuilder result = new StringBuilder();
- result.append("\"p\"=" + prettyPrintValue(fP));
- return result.toString();
-
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((fP == null) ? 0 : fP.hashCode());
- return result;
-
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj)
- return true;
- if (!(obj instanceof EPackageMatch)) { // this should be infrequent
- if (obj == null)
- return false;
- if (!(obj instanceof IPatternMatch))
- return false;
- IPatternMatch otherSig = (IPatternMatch) obj;
- if (!specification().equals(otherSig.specification()))
- return false;
- return Arrays.deepEquals(toArray(), otherSig.toArray());
- }
- EPackageMatch other = (EPackageMatch) obj;
- if (fP == null) {if (other.fP != null) return false;}
- else if (!fP.equals(other.fP)) return false;
- return true;
- }
-
- @Override
- public EPackageQuerySpecification specification() {
- try {
- return EPackageQuerySpecification.instance();
- } catch (IncQueryException ex) {
- // This cannot happen, as the match object can only be instantiated if the query specification exists
- throw new IllegalStateException (ex);
- }
-
- }
-
- @SuppressWarnings("all")
- static final class Mutable extends EPackageMatch {
- Mutable(final EPackage pP) {
- super(pP);
-
- }
-
- @Override
- public boolean isMutable() {
- return true;
- }
- }
-
-
- @SuppressWarnings("all")
- static final class Immutable extends EPackageMatch {
- Immutable(final EPackage pP) {
- super(pP);
-
- }
-
- @Override
- public boolean isMutable() {
- return false;
- }
- }
-
-}
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/EPackageMatcher.java b/examples/headless-maven/incquery-demo/src/main/java/headless/EPackageMatcher.java
deleted file mode 100644
index 984dcf3a2..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/EPackageMatcher.java
+++ /dev/null
@@ -1,244 +0,0 @@
-package headless;
-
-import headless.EPackageMatch;
-import headless.util.EPackageQuerySpecification;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.incquery.runtime.api.IMatchProcessor;
-import org.eclipse.incquery.runtime.api.IQuerySpecification;
-import org.eclipse.incquery.runtime.api.IncQueryEngine;
-import org.eclipse.incquery.runtime.api.impl.BaseMatcher;
-import org.eclipse.incquery.runtime.exception.IncQueryException;
-import org.eclipse.incquery.runtime.matchers.tuple.Tuple;
-import org.eclipse.incquery.runtime.rete.misc.DeltaMonitor;
-
-/**
- * Generated pattern matcher API of the headless.ePackage pattern,
- * providing pattern-specific query methods.
- *
- * <p>Use the pattern matcher on a given model via {@link #on(IncQueryEngine)},
- * e.g. in conjunction with {@link IncQueryEngine#on(Notifier)}.
- *
- * <p>Matches of the pattern will be represented as {@link EPackageMatch}.
- *
- * <p>Original source:
- * <code><pre>
- * {@literal @}Item(item = p, label = "P: $p.name$")
- * {@literal @}Format(color = "#791662", textColor = "#ffffff")
- * pattern ePackage(p : EPackage) { EPackage(p); }
- * </pre></code>
- *
- * @see EPackageMatch
- * @see EPackageProcessor
- * @see EPackageQuerySpecification
- *
- */
-@SuppressWarnings("all")
-public class EPackageMatcher extends BaseMatcher<EPackageMatch> {
- /**
- * @return the singleton instance of the query specification of this pattern
- * @throws IncQueryException if the pattern definition could not be loaded
- *
- */
- public static IQuerySpecification<EPackageMatcher> querySpecification() throws IncQueryException {
- return EPackageQuerySpecification.instance();
- }
-
- /**
- * Initializes the pattern matcher within an existing EMF-IncQuery engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing EMF-IncQuery engine in which this matcher will be created.
- * @throws IncQueryException if an error occurs during pattern matcher creation
- *
- */
- public static EPackageMatcher on(final IncQueryEngine engine) throws IncQueryException {
- // check if matcher already exists
- EPackageMatcher matcher = engine.getExistingMatcher(querySpecification());
- if (matcher == null) {
- matcher = new EPackageMatcher(engine);
- // do not have to "put" it into engine.matchers, reportMatcherInitialized() will take care of it
- }
- return matcher;
- }
-
- private final static int POSITION_P = 0;
-
- /**
- * Initializes the pattern matcher over a given EMF model root (recommended: Resource or ResourceSet).
- * If a pattern matcher is already constructed with the same root, only a light-weight reference is returned.
- * The scope of pattern matching will be the given EMF model root and below (see FAQ for more precise definition).
- * The match set will be incrementally refreshed upon updates from this scope.
- * <p>The matcher will be created within the managed {@link IncQueryEngine} belonging to the EMF model root, so
- * multiple matchers will reuse the same engine and benefit from increased performance and reduced memory footprint.
- * @param emfRoot the root of the EMF containment hierarchy where the pattern matcher will operate. Recommended: Resource or ResourceSet.
- * @throws IncQueryException if an error occurs during pattern matcher creation
- * @deprecated use {@link #on(IncQueryEngine)} instead, e.g. in conjunction with {@link IncQueryEngine#on(Notifier)}
- *
- */
- @Deprecated
- public EPackageMatcher(final Notifier emfRoot) throws IncQueryException {
- this(IncQueryEngine.on(emfRoot));
- }
-
- /**
- * Initializes the pattern matcher within an existing EMF-IncQuery engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing EMF-IncQuery engine in which this matcher will be created.
- * @throws IncQueryException if an error occurs during pattern matcher creation
- * @deprecated use {@link #on(IncQueryEngine)} instead
- *
- */
- @Deprecated
- public EPackageMatcher(final IncQueryEngine engine) throws IncQueryException {
- super(engine, querySpecification());
- }
-
- /**
- * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pP the fixed value of pattern parameter p, or null if not bound.
- * @return matches represented as a EPackageMatch object.
- *
- */
- public Collection<EPackageMatch> getAllMatches(final EPackage pP) {
- return rawGetAllMatches(new Object[]{pP});
- }
-
- /**
- * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pP the fixed value of pattern parameter p, or null if not bound.
- * @return a match represented as a EPackageMatch object, or null if no match is found.
- *
- */
- public EPackageMatch getOneArbitraryMatch(final EPackage pP) {
- return rawGetOneArbitraryMatch(new Object[]{pP});
- }
-
- /**
- * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
- * under any possible substitution of the unspecified parameters (if any).
- * @param pP the fixed value of pattern parameter p, or null if not bound.
- * @return true if the input is a valid (partial) match of the pattern.
- *
- */
- public boolean hasMatch(final EPackage pP) {
- return rawHasMatch(new Object[]{pP});
- }
-
- /**
- * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pP the fixed value of pattern parameter p, or null if not bound.
- * @return the number of pattern matches found.
- *
- */
- public int countMatches(final EPackage pP) {
- return rawCountMatches(new Object[]{pP});
- }
-
- /**
- * Executes the given processor on each match of the pattern that conforms to the given fixed values of some parameters.
- * @param pP the fixed value of pattern parameter p, or null if not bound.
- * @param processor the action that will process each pattern match.
- *
- */
- public void forEachMatch(final EPackage pP, final IMatchProcessor<? super EPackageMatch> processor) {
- rawForEachMatch(new Object[]{pP}, processor);
- }
-
- /**
- * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pP the fixed value of pattern parameter p, or null if not bound.
- * @param processor the action that will process the selected match.
- * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
- *
- */
- public boolean forOneArbitraryMatch(final EPackage pP, final IMatchProcessor<? super EPackageMatch> processor) {
- return rawForOneArbitraryMatch(new Object[]{pP}, processor);
- }
-
- /**
- * Registers a new filtered delta monitor on this pattern matcher.
- * The DeltaMonitor can be used to track changes (delta) in the set of filtered pattern matches from now on, considering those matches only that conform to the given fixed values of some parameters.
- * It can also be reset to track changes from a later point in time,
- * and changes can even be acknowledged on an individual basis.
- * See {@link DeltaMonitor} for details.
- * @param fillAtStart if true, all current matches are reported as new match events; if false, the delta monitor starts empty.
- * @param pP the fixed value of pattern parameter p, or null if not bound.
- * @return the delta monitor.
- * @deprecated use the IncQuery Databinding API (IncQueryObservables) instead.
- *
- */
- @Deprecated
- public DeltaMonitor<EPackageMatch> newFilteredDeltaMonitor(final boolean fillAtStart, final EPackage pP) {
- return rawNewFilteredDeltaMonitor(fillAtStart, new Object[]{pP});
- }
-
- /**
- * Returns a new (partial) Match object for the matcher.
- * This can be used e.g. to call the matcher with a partial match.
- * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pP the fixed value of pattern parameter p, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public EPackageMatch newMatch(final EPackage pP) {
- return new EPackageMatch.Immutable(pP);
-
- }
-
- /**
- * Retrieve the set of values that occur in matches for p.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- protected Set<EPackage> rawAccumulateAllValuesOfp(final Object[] parameters) {
- Set<EPackage> results = new HashSet<EPackage>();
- rawAccumulateAllValues(POSITION_P, parameters, results);
- return results;
- }
-
- /**
- * Retrieve the set of values that occur in matches for p.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<EPackage> getAllValuesOfp() {
- return rawAccumulateAllValuesOfp(emptyArray());
- }
-
- @Override
- protected EPackageMatch tupleToMatch(final Tuple t) {
- try {
- return new EPackageMatch.Immutable((org.eclipse.emf.ecore.EPackage) t.get(POSITION_P));
- } catch(ClassCastException e) {engine.getLogger().error("Element(s) in tuple not properly typed!",e); //throw new IncQueryRuntimeException(e.getMessage());
- return null;
- }
-
- }
-
- @Override
- protected EPackageMatch arrayToMatch(final Object[] match) {
- try {
- return new EPackageMatch.Immutable((org.eclipse.emf.ecore.EPackage) match[POSITION_P]);
- } catch(ClassCastException e) {engine.getLogger().error("Element(s) in array not properly typed!",e); //throw new IncQueryRuntimeException(e.getMessage());
- return null;
- }
-
- }
-
- @Override
- protected EPackageMatch arrayToMatchMutable(final Object[] match) {
- try {
- return new EPackageMatch.Mutable((org.eclipse.emf.ecore.EPackage) match[POSITION_P]);
- } catch(ClassCastException e) {engine.getLogger().error("Element(s) in array not properly typed!",e); //throw new IncQueryRuntimeException(e.getMessage());
- return null;
- }
-
- }
-}
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/HeadlessQueries.java b/examples/headless-maven/incquery-demo/src/main/java/headless/HeadlessQueries.java
deleted file mode 100644
index 1422e5b4e..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/HeadlessQueries.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package headless;
-
-import headless.ClassesInPackageHierarchyMatcher;
-import headless.ClassesInPackageMatcher;
-import headless.EClassMatcher;
-import headless.EClassNamesKeywordMatcher;
-import headless.EClassNamesMatcher;
-import headless.EObjectMatcher;
-import headless.EPackageMatcher;
-import headless.SubPackageMatcher;
-import org.eclipse.incquery.runtime.api.impl.BaseGeneratedPatternGroup;
-import org.eclipse.incquery.runtime.exception.IncQueryException;
-
-/**
- * A pattern group formed of all patterns defined in headlessQueries.eiq.
- *
- * <p>Use the static instance as any {@link org.eclipse.incquery.runtime.api.IPatternGroup}, to conveniently prepare
- * an EMF-IncQuery engine for matching all patterns originally defined in file headlessQueries.eiq,
- * in order to achieve better performance than one-by-one on-demand matcher initialization.
- *
- * <p> From package headless, the group contains the definition of the following patterns: <ul>
- * <li>eClassNames</li>
- * <li>eClassNamesKeyword</li>
- * <li>eObject</li>
- * <li>classesInPackage</li>
- * <li>subPackage</li>
- * <li>classesInPackageHierarchy</li>
- * <li>ePackage</li>
- * <li>eClass</li>
- * </ul>
- *
- * @see IPatternGroup
- *
- */
-@SuppressWarnings("all")
-public final class HeadlessQueries extends BaseGeneratedPatternGroup {
- /**
- * Access the pattern group.
- *
- * @return the singleton instance of the group
- * @throws IncQueryException if there was an error loading the generated code of pattern specifications
- *
- */
- public static HeadlessQueries instance() throws IncQueryException {
- if (INSTANCE == null) {
- INSTANCE = new HeadlessQueries();
- }
- return INSTANCE;
-
- }
-
- private static HeadlessQueries INSTANCE;
-
- private HeadlessQueries() throws IncQueryException {
- querySpecifications.add(EClassNamesKeywordMatcher.querySpecification());
- querySpecifications.add(EObjectMatcher.querySpecification());
- querySpecifications.add(SubPackageMatcher.querySpecification());
- querySpecifications.add(ClassesInPackageMatcher.querySpecification());
- querySpecifications.add(EClassNamesMatcher.querySpecification());
- querySpecifications.add(ClassesInPackageHierarchyMatcher.querySpecification());
- querySpecifications.add(EPackageMatcher.querySpecification());
- querySpecifications.add(EClassMatcher.querySpecification());
-
- }
-}
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/HeadlessQueriesMatchers.java b/examples/headless-maven/incquery-demo/src/main/java/headless/HeadlessQueriesMatchers.java
deleted file mode 100644
index f621bc06b..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/HeadlessQueriesMatchers.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package headless;
-
-import headless.ClassesInPackageHierarchyMatcher;
-import headless.ClassesInPackageMatcher;
-import headless.EClassMatcher;
-import headless.EClassNamesKeywordMatcher;
-import headless.EClassNamesMatcher;
-import headless.EObjectMatcher;
-import headless.EPackageMatcher;
-import headless.SubPackageMatcher;
-import org.eclipse.incquery.runtime.api.IncQueryEngine;
-import org.eclipse.incquery.runtime.exception.IncQueryException;
-
-@SuppressWarnings("all")
-public final class HeadlessQueriesMatchers {
- private IncQueryEngine engine;
-
- public HeadlessQueriesMatchers(final IncQueryEngine engine) {
- this.engine = engine;
-
- }
-
- public ClassesInPackageMatcher getClassesInPackageMatcher() throws IncQueryException {
- return ClassesInPackageMatcher.on(engine);
- }
-
- public EClassNamesKeywordMatcher getEClassNamesKeywordMatcher() throws IncQueryException {
- return EClassNamesKeywordMatcher.on(engine);
- }
-
- public EPackageMatcher getEPackageMatcher() throws IncQueryException {
- return EPackageMatcher.on(engine);
- }
-
- public SubPackageMatcher getSubPackageMatcher() throws IncQueryException {
- return SubPackageMatcher.on(engine);
- }
-
- public EClassMatcher getEClassMatcher() throws IncQueryException {
- return EClassMatcher.on(engine);
- }
-
- public EObjectMatcher getEObjectMatcher() throws IncQueryException {
- return EObjectMatcher.on(engine);
- }
-
- public EClassNamesMatcher getEClassNamesMatcher() throws IncQueryException {
- return EClassNamesMatcher.on(engine);
- }
-
- public ClassesInPackageHierarchyMatcher getClassesInPackageHierarchyMatcher() throws IncQueryException {
- return ClassesInPackageHierarchyMatcher.on(engine);
- }
-}
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/SubPackageMatch.java b/examples/headless-maven/incquery-demo/src/main/java/headless/SubPackageMatch.java
deleted file mode 100644
index ef025c83e..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/SubPackageMatch.java
+++ /dev/null
@@ -1,180 +0,0 @@
-package headless;
-
-import headless.util.SubPackageQuerySpecification;
-import java.util.Arrays;
-import java.util.List;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.incquery.runtime.api.IPatternMatch;
-import org.eclipse.incquery.runtime.api.impl.BasePatternMatch;
-import org.eclipse.incquery.runtime.exception.IncQueryException;
-
-/**
- * Pattern-specific match representation of the headless.subPackage pattern,
- * to be used in conjunction with {@link SubPackageMatcher}.
- *
- * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
- * Each instance is a (possibly partial) substitution of pattern parameters,
- * usable to represent a match of the pattern in the result of a query,
- * or to specify the bound (fixed) input parameters when issuing a query.
- *
- * @see SubPackageMatcher
- * @see SubPackageProcessor
- *
- */
-@SuppressWarnings("all")
-public abstract class SubPackageMatch extends BasePatternMatch {
- private EPackage fP;
-
- private EPackage fSp;
-
- private static List<String> parameterNames = makeImmutableList("p", "sp");
-
- private SubPackageMatch(final EPackage pP, final EPackage pSp) {
- this.fP = pP;
- this.fSp = pSp;
-
- }
-
- @Override
- public Object get(final String parameterName) {
- if ("p".equals(parameterName)) return this.fP;
- if ("sp".equals(parameterName)) return this.fSp;
- return null;
-
- }
-
- public EPackage getP() {
- return this.fP;
-
- }
-
- public EPackage getSp() {
- return this.fSp;
-
- }
-
- @Override
- public boolean set(final String parameterName, final Object newValue) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- if ("p".equals(parameterName) ) {
- this.fP = (org.eclipse.emf.ecore.EPackage) newValue;
- return true;
- }
- if ("sp".equals(parameterName) ) {
- this.fSp = (org.eclipse.emf.ecore.EPackage) newValue;
- return true;
- }
- return false;
-
- }
-
- public void setP(final EPackage pP) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fP = pP;
-
- }
-
- public void setSp(final EPackage pSp) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fSp = pSp;
-
- }
-
- @Override
- public String patternName() {
- return "headless.subPackage";
-
- }
-
- @Override
- public List<String> parameterNames() {
- return SubPackageMatch.parameterNames;
-
- }
-
- @Override
- public Object[] toArray() {
- return new Object[]{fP, fSp};
-
- }
-
- @Override
- public String prettyPrint() {
- StringBuilder result = new StringBuilder();
- result.append("\"p\"=" + prettyPrintValue(fP) + ", ");
- result.append("\"sp\"=" + prettyPrintValue(fSp));
- return result.toString();
-
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((fP == null) ? 0 : fP.hashCode());
- result = prime * result + ((fSp == null) ? 0 : fSp.hashCode());
- return result;
-
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj)
- return true;
- if (!(obj instanceof SubPackageMatch)) { // this should be infrequent
- if (obj == null)
- return false;
- if (!(obj instanceof IPatternMatch))
- return false;
- IPatternMatch otherSig = (IPatternMatch) obj;
- if (!specification().equals(otherSig.specification()))
- return false;
- return Arrays.deepEquals(toArray(), otherSig.toArray());
- }
- SubPackageMatch other = (SubPackageMatch) obj;
- if (fP == null) {if (other.fP != null) return false;}
- else if (!fP.equals(other.fP)) return false;
- if (fSp == null) {if (other.fSp != null) return false;}
- else if (!fSp.equals(other.fSp)) return false;
- return true;
- }
-
- @Override
- public SubPackageQuerySpecification specification() {
- try {
- return SubPackageQuerySpecification.instance();
- } catch (IncQueryException ex) {
- // This cannot happen, as the match object can only be instantiated if the query specification exists
- throw new IllegalStateException (ex);
- }
-
- }
-
- @SuppressWarnings("all")
- static final class Mutable extends SubPackageMatch {
- Mutable(final EPackage pP, final EPackage pSp) {
- super(pP, pSp);
-
- }
-
- @Override
- public boolean isMutable() {
- return true;
- }
- }
-
-
- @SuppressWarnings("all")
- static final class Immutable extends SubPackageMatch {
- Immutable(final EPackage pP, final EPackage pSp) {
- super(pP, pSp);
-
- }
-
- @Override
- public boolean isMutable() {
- return false;
- }
- }
-
-}
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/SubPackageMatcher.java b/examples/headless-maven/incquery-demo/src/main/java/headless/SubPackageMatcher.java
deleted file mode 100644
index f6efd184e..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/SubPackageMatcher.java
+++ /dev/null
@@ -1,309 +0,0 @@
-package headless;
-
-import headless.SubPackageMatch;
-import headless.util.SubPackageQuerySpecification;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.incquery.runtime.api.IMatchProcessor;
-import org.eclipse.incquery.runtime.api.IQuerySpecification;
-import org.eclipse.incquery.runtime.api.IncQueryEngine;
-import org.eclipse.incquery.runtime.api.impl.BaseMatcher;
-import org.eclipse.incquery.runtime.exception.IncQueryException;
-import org.eclipse.incquery.runtime.matchers.tuple.Tuple;
-import org.eclipse.incquery.runtime.rete.misc.DeltaMonitor;
-
-/**
- * Generated pattern matcher API of the headless.subPackage pattern,
- * providing pattern-specific query methods.
- *
- * <p>Use the pattern matcher on a given model via {@link #on(IncQueryEngine)},
- * e.g. in conjunction with {@link IncQueryEngine#on(Notifier)}.
- *
- * <p>Matches of the pattern will be represented as {@link SubPackageMatch}.
- *
- * <p>Original source:
- * <code><pre>
- * {@literal @}Edge(source = p, target = sp, label = "sub")
- * pattern subPackage(p: EPackage, sp: EPackage){ EPackage.eSubpackages(p,sp); }
- * </pre></code>
- *
- * @see SubPackageMatch
- * @see SubPackageProcessor
- * @see SubPackageQuerySpecification
- *
- */
-@SuppressWarnings("all")
-public class SubPackageMatcher extends BaseMatcher<SubPackageMatch> {
- /**
- * @return the singleton instance of the query specification of this pattern
- * @throws IncQueryException if the pattern definition could not be loaded
- *
- */
- public static IQuerySpecification<SubPackageMatcher> querySpecification() throws IncQueryException {
- return SubPackageQuerySpecification.instance();
- }
-
- /**
- * Initializes the pattern matcher within an existing EMF-IncQuery engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing EMF-IncQuery engine in which this matcher will be created.
- * @throws IncQueryException if an error occurs during pattern matcher creation
- *
- */
- public static SubPackageMatcher on(final IncQueryEngine engine) throws IncQueryException {
- // check if matcher already exists
- SubPackageMatcher matcher = engine.getExistingMatcher(querySpecification());
- if (matcher == null) {
- matcher = new SubPackageMatcher(engine);
- // do not have to "put" it into engine.matchers, reportMatcherInitialized() will take care of it
- }
- return matcher;
- }
-
- private final static int POSITION_P = 0;
-
- private final static int POSITION_SP = 1;
-
- /**
- * Initializes the pattern matcher over a given EMF model root (recommended: Resource or ResourceSet).
- * If a pattern matcher is already constructed with the same root, only a light-weight reference is returned.
- * The scope of pattern matching will be the given EMF model root and below (see FAQ for more precise definition).
- * The match set will be incrementally refreshed upon updates from this scope.
- * <p>The matcher will be created within the managed {@link IncQueryEngine} belonging to the EMF model root, so
- * multiple matchers will reuse the same engine and benefit from increased performance and reduced memory footprint.
- * @param emfRoot the root of the EMF containment hierarchy where the pattern matcher will operate. Recommended: Resource or ResourceSet.
- * @throws IncQueryException if an error occurs during pattern matcher creation
- * @deprecated use {@link #on(IncQueryEngine)} instead, e.g. in conjunction with {@link IncQueryEngine#on(Notifier)}
- *
- */
- @Deprecated
- public SubPackageMatcher(final Notifier emfRoot) throws IncQueryException {
- this(IncQueryEngine.on(emfRoot));
- }
-
- /**
- * Initializes the pattern matcher within an existing EMF-IncQuery engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing EMF-IncQuery engine in which this matcher will be created.
- * @throws IncQueryException if an error occurs during pattern matcher creation
- * @deprecated use {@link #on(IncQueryEngine)} instead
- *
- */
- @Deprecated
- public SubPackageMatcher(final IncQueryEngine engine) throws IncQueryException {
- super(engine, querySpecification());
- }
-
- /**
- * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pP the fixed value of pattern parameter p, or null if not bound.
- * @param pSp the fixed value of pattern parameter sp, or null if not bound.
- * @return matches represented as a SubPackageMatch object.
- *
- */
- public Collection<SubPackageMatch> getAllMatches(final EPackage pP, final EPackage pSp) {
- return rawGetAllMatches(new Object[]{pP, pSp});
- }
-
- /**
- * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pP the fixed value of pattern parameter p, or null if not bound.
- * @param pSp the fixed value of pattern parameter sp, or null if not bound.
- * @return a match represented as a SubPackageMatch object, or null if no match is found.
- *
- */
- public SubPackageMatch getOneArbitraryMatch(final EPackage pP, final EPackage pSp) {
- return rawGetOneArbitraryMatch(new Object[]{pP, pSp});
- }
-
- /**
- * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
- * under any possible substitution of the unspecified parameters (if any).
- * @param pP the fixed value of pattern parameter p, or null if not bound.
- * @param pSp the fixed value of pattern parameter sp, or null if not bound.
- * @return true if the input is a valid (partial) match of the pattern.
- *
- */
- public boolean hasMatch(final EPackage pP, final EPackage pSp) {
- return rawHasMatch(new Object[]{pP, pSp});
- }
-
- /**
- * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pP the fixed value of pattern parameter p, or null if not bound.
- * @param pSp the fixed value of pattern parameter sp, or null if not bound.
- * @return the number of pattern matches found.
- *
- */
- public int countMatches(final EPackage pP, final EPackage pSp) {
- return rawCountMatches(new Object[]{pP, pSp});
- }
-
- /**
- * Executes the given processor on each match of the pattern that conforms to the given fixed values of some parameters.
- * @param pP the fixed value of pattern parameter p, or null if not bound.
- * @param pSp the fixed value of pattern parameter sp, or null if not bound.
- * @param processor the action that will process each pattern match.
- *
- */
- public void forEachMatch(final EPackage pP, final EPackage pSp, final IMatchProcessor<? super SubPackageMatch> processor) {
- rawForEachMatch(new Object[]{pP, pSp}, processor);
- }
-
- /**
- * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pP the fixed value of pattern parameter p, or null if not bound.
- * @param pSp the fixed value of pattern parameter sp, or null if not bound.
- * @param processor the action that will process the selected match.
- * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
- *
- */
- public boolean forOneArbitraryMatch(final EPackage pP, final EPackage pSp, final IMatchProcessor<? super SubPackageMatch> processor) {
- return rawForOneArbitraryMatch(new Object[]{pP, pSp}, processor);
- }
-
- /**
- * Registers a new filtered delta monitor on this pattern matcher.
- * The DeltaMonitor can be used to track changes (delta) in the set of filtered pattern matches from now on, considering those matches only that conform to the given fixed values of some parameters.
- * It can also be reset to track changes from a later point in time,
- * and changes can even be acknowledged on an individual basis.
- * See {@link DeltaMonitor} for details.
- * @param fillAtStart if true, all current matches are reported as new match events; if false, the delta monitor starts empty.
- * @param pP the fixed value of pattern parameter p, or null if not bound.
- * @param pSp the fixed value of pattern parameter sp, or null if not bound.
- * @return the delta monitor.
- * @deprecated use the IncQuery Databinding API (IncQueryObservables) instead.
- *
- */
- @Deprecated
- public DeltaMonitor<SubPackageMatch> newFilteredDeltaMonitor(final boolean fillAtStart, final EPackage pP, final EPackage pSp) {
- return rawNewFilteredDeltaMonitor(fillAtStart, new Object[]{pP, pSp});
- }
-
- /**
- * Returns a new (partial) Match object for the matcher.
- * This can be used e.g. to call the matcher with a partial match.
- * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pP the fixed value of pattern parameter p, or null if not bound.
- * @param pSp the fixed value of pattern parameter sp, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public SubPackageMatch newMatch(final EPackage pP, final EPackage pSp) {
- return new SubPackageMatch.Immutable(pP, pSp);
-
- }
-
- /**
- * Retrieve the set of values that occur in matches for p.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- protected Set<EPackage> rawAccumulateAllValuesOfp(final Object[] parameters) {
- Set<EPackage> results = new HashSet<EPackage>();
- rawAccumulateAllValues(POSITION_P, parameters, results);
- return results;
- }
-
- /**
- * Retrieve the set of values that occur in matches for p.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<EPackage> getAllValuesOfp() {
- return rawAccumulateAllValuesOfp(emptyArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for p.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<EPackage> getAllValuesOfp(final SubPackageMatch partialMatch) {
- return rawAccumulateAllValuesOfp(partialMatch.toArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for p.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<EPackage> getAllValuesOfp(final EPackage pSp) {
- return rawAccumulateAllValuesOfp(new Object[]{null, pSp});
- }
-
- /**
- * Retrieve the set of values that occur in matches for sp.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- protected Set<EPackage> rawAccumulateAllValuesOfsp(final Object[] parameters) {
- Set<EPackage> results = new HashSet<EPackage>();
- rawAccumulateAllValues(POSITION_SP, parameters, results);
- return results;
- }
-
- /**
- * Retrieve the set of values that occur in matches for sp.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<EPackage> getAllValuesOfsp() {
- return rawAccumulateAllValuesOfsp(emptyArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for sp.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<EPackage> getAllValuesOfsp(final SubPackageMatch partialMatch) {
- return rawAccumulateAllValuesOfsp(partialMatch.toArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for sp.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<EPackage> getAllValuesOfsp(final EPackage pP) {
- return rawAccumulateAllValuesOfsp(new Object[]{pP, null});
- }
-
- @Override
- protected SubPackageMatch tupleToMatch(final Tuple t) {
- try {
- return new SubPackageMatch.Immutable((org.eclipse.emf.ecore.EPackage) t.get(POSITION_P), (org.eclipse.emf.ecore.EPackage) t.get(POSITION_SP));
- } catch(ClassCastException e) {engine.getLogger().error("Element(s) in tuple not properly typed!",e); //throw new IncQueryRuntimeException(e.getMessage());
- return null;
- }
-
- }
-
- @Override
- protected SubPackageMatch arrayToMatch(final Object[] match) {
- try {
- return new SubPackageMatch.Immutable((org.eclipse.emf.ecore.EPackage) match[POSITION_P], (org.eclipse.emf.ecore.EPackage) match[POSITION_SP]);
- } catch(ClassCastException e) {engine.getLogger().error("Element(s) in array not properly typed!",e); //throw new IncQueryRuntimeException(e.getMessage());
- return null;
- }
-
- }
-
- @Override
- protected SubPackageMatch arrayToMatchMutable(final Object[] match) {
- try {
- return new SubPackageMatch.Mutable((org.eclipse.emf.ecore.EPackage) match[POSITION_P], (org.eclipse.emf.ecore.EPackage) match[POSITION_SP]);
- } catch(ClassCastException e) {engine.getLogger().error("Element(s) in array not properly typed!",e); //throw new IncQueryRuntimeException(e.getMessage());
- return null;
- }
-
- }
-}
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/util/.ClassesInPackageHierarchyProcessor.java._trace b/examples/headless-maven/incquery-demo/src/main/java/headless/util/.ClassesInPackageHierarchyProcessor.java._trace
deleted file mode 100644
index a62fc233b..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/util/.ClassesInPackageHierarchyProcessor.java._trace
+++ /dev/null
Binary files differ
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/util/.ClassesInPackageHierarchyQuerySpecification.java._trace b/examples/headless-maven/incquery-demo/src/main/java/headless/util/.ClassesInPackageHierarchyQuerySpecification.java._trace
deleted file mode 100644
index 720d37133..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/util/.ClassesInPackageHierarchyQuerySpecification.java._trace
+++ /dev/null
Binary files differ
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/util/.ClassesInPackageProcessor.java._trace b/examples/headless-maven/incquery-demo/src/main/java/headless/util/.ClassesInPackageProcessor.java._trace
deleted file mode 100644
index 8d4eca078..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/util/.ClassesInPackageProcessor.java._trace
+++ /dev/null
Binary files differ
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/util/.ClassesInPackageQuerySpecification.java._trace b/examples/headless-maven/incquery-demo/src/main/java/headless/util/.ClassesInPackageQuerySpecification.java._trace
deleted file mode 100644
index ade6f3f53..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/util/.ClassesInPackageQuerySpecification.java._trace
+++ /dev/null
Binary files differ
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/util/.EClassNamesKeywordProcessor.java._trace b/examples/headless-maven/incquery-demo/src/main/java/headless/util/.EClassNamesKeywordProcessor.java._trace
deleted file mode 100644
index 6c1ede283..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/util/.EClassNamesKeywordProcessor.java._trace
+++ /dev/null
Binary files differ
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/util/.EClassNamesKeywordQuerySpecification.java._trace b/examples/headless-maven/incquery-demo/src/main/java/headless/util/.EClassNamesKeywordQuerySpecification.java._trace
deleted file mode 100644
index fe755febf..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/util/.EClassNamesKeywordQuerySpecification.java._trace
+++ /dev/null
Binary files differ
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/util/.EClassNamesProcessor.java._trace b/examples/headless-maven/incquery-demo/src/main/java/headless/util/.EClassNamesProcessor.java._trace
deleted file mode 100644
index ec767c05f..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/util/.EClassNamesProcessor.java._trace
+++ /dev/null
Binary files differ
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/util/.EClassNamesQuerySpecification.java._trace b/examples/headless-maven/incquery-demo/src/main/java/headless/util/.EClassNamesQuerySpecification.java._trace
deleted file mode 100644
index e1bdf7342..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/util/.EClassNamesQuerySpecification.java._trace
+++ /dev/null
Binary files differ
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/util/.EClassProcessor.java._trace b/examples/headless-maven/incquery-demo/src/main/java/headless/util/.EClassProcessor.java._trace
deleted file mode 100644
index c240f9837..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/util/.EClassProcessor.java._trace
+++ /dev/null
Binary files differ
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/util/.EClassQuerySpecification.java._trace b/examples/headless-maven/incquery-demo/src/main/java/headless/util/.EClassQuerySpecification.java._trace
deleted file mode 100644
index dad8fb125..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/util/.EClassQuerySpecification.java._trace
+++ /dev/null
Binary files differ
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/util/.EObjectProcessor.java._trace b/examples/headless-maven/incquery-demo/src/main/java/headless/util/.EObjectProcessor.java._trace
deleted file mode 100644
index 652509383..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/util/.EObjectProcessor.java._trace
+++ /dev/null
Binary files differ
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/util/.EObjectQuerySpecification.java._trace b/examples/headless-maven/incquery-demo/src/main/java/headless/util/.EObjectQuerySpecification.java._trace
deleted file mode 100644
index 29577970d..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/util/.EObjectQuerySpecification.java._trace
+++ /dev/null
Binary files differ
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/util/.EPackageProcessor.java._trace b/examples/headless-maven/incquery-demo/src/main/java/headless/util/.EPackageProcessor.java._trace
deleted file mode 100644
index 018e3717b..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/util/.EPackageProcessor.java._trace
+++ /dev/null
Binary files differ
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/util/.EPackageQuerySpecification.java._trace b/examples/headless-maven/incquery-demo/src/main/java/headless/util/.EPackageQuerySpecification.java._trace
deleted file mode 100644
index 0b789a50d..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/util/.EPackageQuerySpecification.java._trace
+++ /dev/null
Binary files differ
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/util/.SubPackageProcessor.java._trace b/examples/headless-maven/incquery-demo/src/main/java/headless/util/.SubPackageProcessor.java._trace
deleted file mode 100644
index 2514a9349..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/util/.SubPackageProcessor.java._trace
+++ /dev/null
Binary files differ
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/util/.SubPackageQuerySpecification.java._trace b/examples/headless-maven/incquery-demo/src/main/java/headless/util/.SubPackageQuerySpecification.java._trace
deleted file mode 100644
index b8e00ac71..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/util/.SubPackageQuerySpecification.java._trace
+++ /dev/null
Binary files differ
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/util/ClassesInPackageHierarchyProcessor.java b/examples/headless-maven/incquery-demo/src/main/java/headless/util/ClassesInPackageHierarchyProcessor.java
deleted file mode 100644
index 57aa6228e..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/util/ClassesInPackageHierarchyProcessor.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package headless.util;
-
-import headless.ClassesInPackageHierarchyMatch;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.incquery.runtime.api.IMatchProcessor;
-
-/**
- * A match processor tailored for the headless.classesInPackageHierarchy pattern.
- *
- * Clients should derive an (anonymous) class that implements the abstract process().
- *
- */
-@SuppressWarnings("all")
-public abstract class ClassesInPackageHierarchyProcessor implements IMatchProcessor<ClassesInPackageHierarchyMatch> {
- /**
- * Defines the action that is to be executed on each match.
- * @param pRootP the value of pattern parameter rootP in the currently processed match
- * @param pContainedClass the value of pattern parameter containedClass in the currently processed match
- *
- */
- public abstract void process(final EPackage pRootP, final EClass pContainedClass);
-
- @Override
- public void process(final ClassesInPackageHierarchyMatch match) {
- process(match.getRootP(), match.getContainedClass());
-
- }
-}
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/util/ClassesInPackageHierarchyQuerySpecification.java b/examples/headless-maven/incquery-demo/src/main/java/headless/util/ClassesInPackageHierarchyQuerySpecification.java
deleted file mode 100644
index a23bb91cf..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/util/ClassesInPackageHierarchyQuerySpecification.java
+++ /dev/null
@@ -1,150 +0,0 @@
-package headless.util;
-
-import com.google.common.collect.Sets;
-import headless.ClassesInPackageHierarchyMatcher;
-import headless.util.ClassesInPackageQuerySpecification;
-import headless.util.SubPackageQuerySpecification;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.incquery.runtime.api.IncQueryEngine;
-import org.eclipse.incquery.runtime.api.impl.BaseGeneratedQuerySpecification;
-import org.eclipse.incquery.runtime.context.EMFPatternMatcherContext;
-import org.eclipse.incquery.runtime.exception.IncQueryException;
-import org.eclipse.incquery.runtime.extensibility.IQuerySpecificationProvider;
-import org.eclipse.incquery.runtime.matchers.psystem.PBody;
-import org.eclipse.incquery.runtime.matchers.psystem.PParameter;
-import org.eclipse.incquery.runtime.matchers.psystem.PQuery.PQueryStatus;
-import org.eclipse.incquery.runtime.matchers.psystem.PVariable;
-import org.eclipse.incquery.runtime.matchers.psystem.annotations.PAnnotation;
-import org.eclipse.incquery.runtime.matchers.psystem.annotations.ParameterReference;
-import org.eclipse.incquery.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.incquery.runtime.matchers.psystem.basicenumerables.BinaryTransitiveClosure;
-import org.eclipse.incquery.runtime.matchers.psystem.basicenumerables.PositivePatternCall;
-import org.eclipse.incquery.runtime.matchers.psystem.basicenumerables.TypeUnary;
-import org.eclipse.incquery.runtime.matchers.tuple.FlatTuple;
-
-/**
- * A pattern-specific query specification that can instantiate ClassesInPackageHierarchyMatcher in a type-safe way.
- *
- * @see ClassesInPackageHierarchyMatcher
- * @see ClassesInPackageHierarchyMatch
- *
- */
-@SuppressWarnings("all")
-public final class ClassesInPackageHierarchyQuerySpecification extends BaseGeneratedQuerySpecification<ClassesInPackageHierarchyMatcher> {
- /**
- * @return the singleton instance of the query specification
- * @throws IncQueryException if the pattern definition could not be loaded
- *
- */
- public static ClassesInPackageHierarchyQuerySpecification instance() throws IncQueryException {
- try {
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- processInitializerError(err);
- throw err;
- }
-
- }
-
- @Override
- protected ClassesInPackageHierarchyMatcher instantiate(final IncQueryEngine engine) throws IncQueryException {
- return ClassesInPackageHierarchyMatcher.on(engine);
- }
-
- @Override
- public String getFullyQualifiedName() {
- return "headless.classesInPackageHierarchy";
-
- }
-
- @Override
- public List<String> getParameterNames() {
- return Arrays.asList("rootP","containedClass");
- }
-
- @Override
- public List<PParameter> getParameters() {
- return Arrays.asList(new PParameter("rootP", "org.eclipse.emf.ecore.EPackage"),new PParameter("containedClass", "org.eclipse.emf.ecore.EClass"));
- }
-
- @Override
- public Set<PBody> doGetContainedBodies() throws IncQueryException {
- EMFPatternMatcherContext context = new EMFPatternMatcherContext();
- Set<PBody> bodies = Sets.newHashSet();
- {
- PBody body = new PBody(this);
- PVariable var_rootP = body.getOrCreateVariableByName("rootP");
- PVariable var_containedClass = body.getOrCreateVariableByName("containedClass");
- body.setExportedParameters(Arrays.asList(
- new ExportedParameter(body, var_rootP, "rootP"),
- new ExportedParameter(body, var_containedClass, "containedClass")
- ));
-
- new TypeUnary(body, var_rootP, getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EPackage"), "http://www.eclipse.org/emf/2002/Ecore/EPackage");
-
- new TypeUnary(body, var_containedClass, getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EClass"), "http://www.eclipse.org/emf/2002/Ecore/EClass");
- new PositivePatternCall(body, new FlatTuple(var_rootP, var_containedClass), ClassesInPackageQuerySpecification.instance());
- bodies.add(body);
- }{
- PBody body = new PBody(this);
- PVariable var_rootP = body.getOrCreateVariableByName("rootP");
- PVariable var_containedClass = body.getOrCreateVariableByName("containedClass");
- PVariable var_somePackage = body.getOrCreateVariableByName("somePackage");
- body.setExportedParameters(Arrays.asList(
- new ExportedParameter(body, var_rootP, "rootP"),
- new ExportedParameter(body, var_containedClass, "containedClass")
- ));
-
- new TypeUnary(body, var_rootP, getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EPackage"), "http://www.eclipse.org/emf/2002/Ecore/EPackage");
-
- new TypeUnary(body, var_containedClass, getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EClass"), "http://www.eclipse.org/emf/2002/Ecore/EClass");
- new BinaryTransitiveClosure(body, new FlatTuple(var_rootP, var_somePackage), SubPackageQuerySpecification.instance().instance());
- new PositivePatternCall(body, new FlatTuple(var_somePackage, var_containedClass), ClassesInPackageQuerySpecification.instance());
- bodies.add(body);
- }{
- PAnnotation annotation = new PAnnotation("Edge");
- annotation.addAttribute("source",new ParameterReference("rootP"));
- annotation.addAttribute("target",new ParameterReference("containedClass"));
- annotation.addAttribute("label","classIn+");
- addAnnotation(annotation);
- }
- {
- PAnnotation annotation = new PAnnotation("Format");
- annotation.addAttribute("color","#0033ff");
- addAnnotation(annotation);
- }
- setStatus(PQueryStatus.OK);
- return bodies;
- }
-
- private ClassesInPackageHierarchyQuerySpecification() throws IncQueryException {
- super();
- setStatus(PQueryStatus.UNINITIALIZED);
- }
-
- @SuppressWarnings("all")
- public static class Provider implements IQuerySpecificationProvider<ClassesInPackageHierarchyQuerySpecification> {
- @Override
- public ClassesInPackageHierarchyQuerySpecification get() throws IncQueryException {
- return instance();
- }
- }
-
-
- @SuppressWarnings("all")
- private static class LazyHolder {
- private final static ClassesInPackageHierarchyQuerySpecification INSTANCE = make();
-
- public static ClassesInPackageHierarchyQuerySpecification make() {
- try {
- return new ClassesInPackageHierarchyQuerySpecification();
- } catch (IncQueryException ex) {
- throw new RuntimeException (ex);
- }
-
- }
- }
-
-}
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/util/ClassesInPackageProcessor.java b/examples/headless-maven/incquery-demo/src/main/java/headless/util/ClassesInPackageProcessor.java
deleted file mode 100644
index cc79754c6..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/util/ClassesInPackageProcessor.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package headless.util;
-
-import headless.ClassesInPackageMatch;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.incquery.runtime.api.IMatchProcessor;
-
-/**
- * A match processor tailored for the headless.classesInPackage pattern.
- *
- * Clients should derive an (anonymous) class that implements the abstract process().
- *
- */
-@SuppressWarnings("all")
-public abstract class ClassesInPackageProcessor implements IMatchProcessor<ClassesInPackageMatch> {
- /**
- * Defines the action that is to be executed on each match.
- * @param pP the value of pattern parameter p in the currently processed match
- * @param pEc the value of pattern parameter ec in the currently processed match
- *
- */
- public abstract void process(final EPackage pP, final EClass pEc);
-
- @Override
- public void process(final ClassesInPackageMatch match) {
- process(match.getP(), match.getEc());
-
- }
-}
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/util/ClassesInPackageQuerySpecification.java b/examples/headless-maven/incquery-demo/src/main/java/headless/util/ClassesInPackageQuerySpecification.java
deleted file mode 100644
index 3c99c1514..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/util/ClassesInPackageQuerySpecification.java
+++ /dev/null
@@ -1,124 +0,0 @@
-package headless.util;
-
-import com.google.common.collect.Sets;
-import headless.ClassesInPackageMatcher;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.incquery.runtime.api.IncQueryEngine;
-import org.eclipse.incquery.runtime.api.impl.BaseGeneratedQuerySpecification;
-import org.eclipse.incquery.runtime.context.EMFPatternMatcherContext;
-import org.eclipse.incquery.runtime.exception.IncQueryException;
-import org.eclipse.incquery.runtime.extensibility.IQuerySpecificationProvider;
-import org.eclipse.incquery.runtime.matchers.psystem.PBody;
-import org.eclipse.incquery.runtime.matchers.psystem.PParameter;
-import org.eclipse.incquery.runtime.matchers.psystem.PQuery.PQueryStatus;
-import org.eclipse.incquery.runtime.matchers.psystem.PVariable;
-import org.eclipse.incquery.runtime.matchers.psystem.annotations.PAnnotation;
-import org.eclipse.incquery.runtime.matchers.psystem.annotations.ParameterReference;
-import org.eclipse.incquery.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.incquery.runtime.matchers.psystem.basicenumerables.TypeBinary;
-import org.eclipse.incquery.runtime.matchers.psystem.basicenumerables.TypeUnary;
-
-/**
- * A pattern-specific query specification that can instantiate ClassesInPackageMatcher in a type-safe way.
- *
- * @see ClassesInPackageMatcher
- * @see ClassesInPackageMatch
- *
- */
-@SuppressWarnings("all")
-public final class ClassesInPackageQuerySpecification extends BaseGeneratedQuerySpecification<ClassesInPackageMatcher> {
- /**
- * @return the singleton instance of the query specification
- * @throws IncQueryException if the pattern definition could not be loaded
- *
- */
- public static ClassesInPackageQuerySpecification instance() throws IncQueryException {
- try {
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- processInitializerError(err);
- throw err;
- }
-
- }
-
- @Override
- protected ClassesInPackageMatcher instantiate(final IncQueryEngine engine) throws IncQueryException {
- return ClassesInPackageMatcher.on(engine);
- }
-
- @Override
- public String getFullyQualifiedName() {
- return "headless.classesInPackage";
-
- }
-
- @Override
- public List<String> getParameterNames() {
- return Arrays.asList("p","ec");
- }
-
- @Override
- public List<PParameter> getParameters() {
- return Arrays.asList(new PParameter("p", "org.eclipse.emf.ecore.EPackage"),new PParameter("ec", "org.eclipse.emf.ecore.EClass"));
- }
-
- @Override
- public Set<PBody> doGetContainedBodies() throws IncQueryException {
- EMFPatternMatcherContext context = new EMFPatternMatcherContext();
- Set<PBody> bodies = Sets.newHashSet();
- {
- PBody body = new PBody(this);
- PVariable var_p = body.getOrCreateVariableByName("p");
- PVariable var_ec = body.getOrCreateVariableByName("ec");
- body.setExportedParameters(Arrays.asList(
- new ExportedParameter(body, var_p, "p"),
- new ExportedParameter(body, var_ec, "ec")
- ));
-
-
- new TypeUnary(body, var_ec, getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EClass"), "http://www.eclipse.org/emf/2002/Ecore/EClass");
- new TypeBinary(body, context, var_p, var_ec, getFeatureLiteral("http://www.eclipse.org/emf/2002/Ecore", "EPackage", "eClassifiers"), "http://www.eclipse.org/emf/2002/Ecore/EPackage.eClassifiers");
- bodies.add(body);
- }{
- PAnnotation annotation = new PAnnotation("Edge");
- annotation.addAttribute("source",new ParameterReference("p"));
- annotation.addAttribute("target",new ParameterReference("ec"));
- annotation.addAttribute("label","classIn");
- addAnnotation(annotation);
- }
- setStatus(PQueryStatus.OK);
- return bodies;
- }
-
- private ClassesInPackageQuerySpecification() throws IncQueryException {
- super();
- setStatus(PQueryStatus.UNINITIALIZED);
- }
-
- @SuppressWarnings("all")
- public static class Provider implements IQuerySpecificationProvider<ClassesInPackageQuerySpecification> {
- @Override
- public ClassesInPackageQuerySpecification get() throws IncQueryException {
- return instance();
- }
- }
-
-
- @SuppressWarnings("all")
- private static class LazyHolder {
- private final static ClassesInPackageQuerySpecification INSTANCE = make();
-
- public static ClassesInPackageQuerySpecification make() {
- try {
- return new ClassesInPackageQuerySpecification();
- } catch (IncQueryException ex) {
- throw new RuntimeException (ex);
- }
-
- }
- }
-
-}
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/util/EClassNamesKeywordProcessor.java b/examples/headless-maven/incquery-demo/src/main/java/headless/util/EClassNamesKeywordProcessor.java
deleted file mode 100644
index 01c559dbb..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/util/EClassNamesKeywordProcessor.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package headless.util;
-
-import headless.EClassNamesKeywordMatch;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.incquery.runtime.api.IMatchProcessor;
-
-/**
- * A match processor tailored for the headless.eClassNamesKeyword pattern.
- *
- * Clients should derive an (anonymous) class that implements the abstract process().
- *
- */
-@SuppressWarnings("all")
-public abstract class EClassNamesKeywordProcessor implements IMatchProcessor<EClassNamesKeywordMatch> {
- /**
- * Defines the action that is to be executed on each match.
- * @param pC the value of pattern parameter c in the currently processed match
- * @param pN the value of pattern parameter n in the currently processed match
- *
- */
- public abstract void process(final EClass pC, final String pN);
-
- @Override
- public void process(final EClassNamesKeywordMatch match) {
- process(match.getC(), match.getN());
-
- }
-}
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/util/EClassNamesKeywordQuerySpecification.java b/examples/headless-maven/incquery-demo/src/main/java/headless/util/EClassNamesKeywordQuerySpecification.java
deleted file mode 100644
index cdccb8ef9..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/util/EClassNamesKeywordQuerySpecification.java
+++ /dev/null
@@ -1,142 +0,0 @@
-package headless.util;
-
-import com.google.common.base.Objects;
-import com.google.common.collect.Sets;
-import headless.EClassNamesKeywordMatcher;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.incquery.runtime.api.IncQueryEngine;
-import org.eclipse.incquery.runtime.api.impl.BaseGeneratedQuerySpecification;
-import org.eclipse.incquery.runtime.context.EMFPatternMatcherContext;
-import org.eclipse.incquery.runtime.exception.IncQueryException;
-import org.eclipse.incquery.runtime.extensibility.IQuerySpecificationProvider;
-import org.eclipse.incquery.runtime.matchers.psystem.IExpressionEvaluator;
-import org.eclipse.incquery.runtime.matchers.psystem.IValueProvider;
-import org.eclipse.incquery.runtime.matchers.psystem.PBody;
-import org.eclipse.incquery.runtime.matchers.psystem.PParameter;
-import org.eclipse.incquery.runtime.matchers.psystem.PQuery.PQueryStatus;
-import org.eclipse.incquery.runtime.matchers.psystem.PVariable;
-import org.eclipse.incquery.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.incquery.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation;
-import org.eclipse.incquery.runtime.matchers.psystem.basicenumerables.TypeBinary;
-import org.eclipse.incquery.runtime.matchers.psystem.basicenumerables.TypeUnary;
-
-/**
- * A pattern-specific query specification that can instantiate EClassNamesKeywordMatcher in a type-safe way.
- *
- * @see EClassNamesKeywordMatcher
- * @see EClassNamesKeywordMatch
- *
- */
-@SuppressWarnings("all")
-public final class EClassNamesKeywordQuerySpecification extends BaseGeneratedQuerySpecification<EClassNamesKeywordMatcher> {
- /**
- * @return the singleton instance of the query specification
- * @throws IncQueryException if the pattern definition could not be loaded
- *
- */
- public static EClassNamesKeywordQuerySpecification instance() throws IncQueryException {
- try {
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- processInitializerError(err);
- throw err;
- }
-
- }
-
- @Override
- protected EClassNamesKeywordMatcher instantiate(final IncQueryEngine engine) throws IncQueryException {
- return EClassNamesKeywordMatcher.on(engine);
- }
-
- @Override
- public String getFullyQualifiedName() {
- return "headless.eClassNamesKeyword";
-
- }
-
- @Override
- public List<String> getParameterNames() {
- return Arrays.asList("c","n");
- }
-
- @Override
- public List<PParameter> getParameters() {
- return Arrays.asList(new PParameter("c", "org.eclipse.emf.ecore.EClass"),new PParameter("n", "java.lang.String"));
- }
-
- @Override
- public Set<PBody> doGetContainedBodies() throws IncQueryException {
- EMFPatternMatcherContext context = new EMFPatternMatcherContext();
- Set<PBody> bodies = Sets.newHashSet();
- {
- PBody body = new PBody(this);
- PVariable var_c = body.getOrCreateVariableByName("c");
- PVariable var_n = body.getOrCreateVariableByName("n");
- body.setExportedParameters(Arrays.asList(
- new ExportedParameter(body, var_c, "c"),
- new ExportedParameter(body, var_n, "n")
- ));
-
-
- new TypeUnary(body, var_c, getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EClass"), "http://www.eclipse.org/emf/2002/Ecore/EClass");
- new TypeBinary(body, context, var_c, var_n, getFeatureLiteral("http://www.eclipse.org/emf/2002/Ecore", "ENamedElement", "name"), "http://www.eclipse.org/emf/2002/Ecore/ENamedElement.name");
- new ExpressionEvaluation(body, new IExpressionEvaluator() {
- @Override
- public String getShortDescription() {
- return "Expression evaluation from pattern eClassNamesKeyword";
- }
-
- @Override
- public Iterable<String> getInputParameterNames() {
- return Arrays.asList("n");
- }
-
- @Override
- public Object evaluateExpression(IValueProvider provider) throws Exception {
- java.lang.String n = (java.lang.String) provider.getValue("n");
- return evaluateExpression_1_1(n);
- }
-
- }, null);
- bodies.add(body);
- }setStatus(PQueryStatus.OK);
- return bodies;
- }
-
- private EClassNamesKeywordQuerySpecification() throws IncQueryException {
- super();
- setStatus(PQueryStatus.UNINITIALIZED);
- }
-
- @SuppressWarnings("all")
- public static class Provider implements IQuerySpecificationProvider<EClassNamesKeywordQuerySpecification> {
- @Override
- public EClassNamesKeywordQuerySpecification get() throws IncQueryException {
- return instance();
- }
- }
-
-
- @SuppressWarnings("all")
- private static class LazyHolder {
- private final static EClassNamesKeywordQuerySpecification INSTANCE = make();
-
- public static EClassNamesKeywordQuerySpecification make() {
- try {
- return new EClassNamesKeywordQuerySpecification();
- } catch (IncQueryException ex) {
- throw new RuntimeException (ex);
- }
-
- }
- }
-
-
- private boolean evaluateExpression_1_1(final String n) {
- boolean _equals = Objects.equal("A", n);
- return _equals;
- }
-}
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/util/EClassNamesProcessor.java b/examples/headless-maven/incquery-demo/src/main/java/headless/util/EClassNamesProcessor.java
deleted file mode 100644
index 86e743794..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/util/EClassNamesProcessor.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package headless.util;
-
-import headless.EClassNamesMatch;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.incquery.runtime.api.IMatchProcessor;
-
-/**
- * A match processor tailored for the headless.eClassNames pattern.
- *
- * Clients should derive an (anonymous) class that implements the abstract process().
- *
- */
-@SuppressWarnings("all")
-public abstract class EClassNamesProcessor implements IMatchProcessor<EClassNamesMatch> {
- /**
- * Defines the action that is to be executed on each match.
- * @param pC the value of pattern parameter c in the currently processed match
- * @param pN the value of pattern parameter n in the currently processed match
- *
- */
- public abstract void process(final EClass pC, final String pN);
-
- @Override
- public void process(final EClassNamesMatch match) {
- process(match.getC(), match.getN());
-
- }
-}
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/util/EClassNamesQuerySpecification.java b/examples/headless-maven/incquery-demo/src/main/java/headless/util/EClassNamesQuerySpecification.java
deleted file mode 100644
index 6915095f0..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/util/EClassNamesQuerySpecification.java
+++ /dev/null
@@ -1,115 +0,0 @@
-package headless.util;
-
-import com.google.common.collect.Sets;
-import headless.EClassNamesMatcher;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.incquery.runtime.api.IncQueryEngine;
-import org.eclipse.incquery.runtime.api.impl.BaseGeneratedQuerySpecification;
-import org.eclipse.incquery.runtime.context.EMFPatternMatcherContext;
-import org.eclipse.incquery.runtime.exception.IncQueryException;
-import org.eclipse.incquery.runtime.extensibility.IQuerySpecificationProvider;
-import org.eclipse.incquery.runtime.matchers.psystem.PBody;
-import org.eclipse.incquery.runtime.matchers.psystem.PParameter;
-import org.eclipse.incquery.runtime.matchers.psystem.PQuery.PQueryStatus;
-import org.eclipse.incquery.runtime.matchers.psystem.PVariable;
-import org.eclipse.incquery.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.incquery.runtime.matchers.psystem.basicenumerables.TypeBinary;
-import org.eclipse.incquery.runtime.matchers.psystem.basicenumerables.TypeUnary;
-
-/**
- * A pattern-specific query specification that can instantiate EClassNamesMatcher in a type-safe way.
- *
- * @see EClassNamesMatcher
- * @see EClassNamesMatch
- *
- */
-@SuppressWarnings("all")
-public final class EClassNamesQuerySpecification extends BaseGeneratedQuerySpecification<EClassNamesMatcher> {
- /**
- * @return the singleton instance of the query specification
- * @throws IncQueryException if the pattern definition could not be loaded
- *
- */
- public static EClassNamesQuerySpecification instance() throws IncQueryException {
- try {
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- processInitializerError(err);
- throw err;
- }
-
- }
-
- @Override
- protected EClassNamesMatcher instantiate(final IncQueryEngine engine) throws IncQueryException {
- return EClassNamesMatcher.on(engine);
- }
-
- @Override
- public String getFullyQualifiedName() {
- return "headless.eClassNames";
-
- }
-
- @Override
- public List<String> getParameterNames() {
- return Arrays.asList("c","n");
- }
-
- @Override
- public List<PParameter> getParameters() {
- return Arrays.asList(new PParameter("c", "org.eclipse.emf.ecore.EClass"),new PParameter("n", "java.lang.String"));
- }
-
- @Override
- public Set<PBody> doGetContainedBodies() throws IncQueryException {
- EMFPatternMatcherContext context = new EMFPatternMatcherContext();
- Set<PBody> bodies = Sets.newHashSet();
- {
- PBody body = new PBody(this);
- PVariable var_c = body.getOrCreateVariableByName("c");
- PVariable var_n = body.getOrCreateVariableByName("n");
- body.setExportedParameters(Arrays.asList(
- new ExportedParameter(body, var_c, "c"),
- new ExportedParameter(body, var_n, "n")
- ));
-
-
- new TypeUnary(body, var_c, getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EClass"), "http://www.eclipse.org/emf/2002/Ecore/EClass");
- new TypeBinary(body, context, var_c, var_n, getFeatureLiteral("http://www.eclipse.org/emf/2002/Ecore", "ENamedElement", "name"), "http://www.eclipse.org/emf/2002/Ecore/ENamedElement.name");
- bodies.add(body);
- }setStatus(PQueryStatus.OK);
- return bodies;
- }
-
- private EClassNamesQuerySpecification() throws IncQueryException {
- super();
- setStatus(PQueryStatus.UNINITIALIZED);
- }
-
- @SuppressWarnings("all")
- public static class Provider implements IQuerySpecificationProvider<EClassNamesQuerySpecification> {
- @Override
- public EClassNamesQuerySpecification get() throws IncQueryException {
- return instance();
- }
- }
-
-
- @SuppressWarnings("all")
- private static class LazyHolder {
- private final static EClassNamesQuerySpecification INSTANCE = make();
-
- public static EClassNamesQuerySpecification make() {
- try {
- return new EClassNamesQuerySpecification();
- } catch (IncQueryException ex) {
- throw new RuntimeException (ex);
- }
-
- }
- }
-
-}
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/util/EClassProcessor.java b/examples/headless-maven/incquery-demo/src/main/java/headless/util/EClassProcessor.java
deleted file mode 100644
index b51520e79..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/util/EClassProcessor.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package headless.util;
-
-import headless.EClassMatch;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.incquery.runtime.api.IMatchProcessor;
-
-/**
- * A match processor tailored for the headless.eClass pattern.
- *
- * Clients should derive an (anonymous) class that implements the abstract process().
- *
- */
-@SuppressWarnings("all")
-public abstract class EClassProcessor implements IMatchProcessor<EClassMatch> {
- /**
- * Defines the action that is to be executed on each match.
- * @param pEc the value of pattern parameter ec in the currently processed match
- *
- */
- public abstract void process(final EClass pEc);
-
- @Override
- public void process(final EClassMatch match) {
- process(match.getEc());
-
- }
-}
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/util/EClassQuerySpecification.java b/examples/headless-maven/incquery-demo/src/main/java/headless/util/EClassQuerySpecification.java
deleted file mode 100644
index add0288c7..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/util/EClassQuerySpecification.java
+++ /dev/null
@@ -1,123 +0,0 @@
-package headless.util;
-
-import com.google.common.collect.Sets;
-import headless.EClassMatcher;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.incquery.runtime.api.IncQueryEngine;
-import org.eclipse.incquery.runtime.api.impl.BaseGeneratedQuerySpecification;
-import org.eclipse.incquery.runtime.context.EMFPatternMatcherContext;
-import org.eclipse.incquery.runtime.exception.IncQueryException;
-import org.eclipse.incquery.runtime.extensibility.IQuerySpecificationProvider;
-import org.eclipse.incquery.runtime.matchers.psystem.PBody;
-import org.eclipse.incquery.runtime.matchers.psystem.PParameter;
-import org.eclipse.incquery.runtime.matchers.psystem.PQuery.PQueryStatus;
-import org.eclipse.incquery.runtime.matchers.psystem.PVariable;
-import org.eclipse.incquery.runtime.matchers.psystem.annotations.PAnnotation;
-import org.eclipse.incquery.runtime.matchers.psystem.annotations.ParameterReference;
-import org.eclipse.incquery.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.incquery.runtime.matchers.psystem.basicenumerables.TypeUnary;
-
-/**
- * A pattern-specific query specification that can instantiate EClassMatcher in a type-safe way.
- *
- * @see EClassMatcher
- * @see EClassMatch
- *
- */
-@SuppressWarnings("all")
-public final class EClassQuerySpecification extends BaseGeneratedQuerySpecification<EClassMatcher> {
- /**
- * @return the singleton instance of the query specification
- * @throws IncQueryException if the pattern definition could not be loaded
- *
- */
- public static EClassQuerySpecification instance() throws IncQueryException {
- try {
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- processInitializerError(err);
- throw err;
- }
-
- }
-
- @Override
- protected EClassMatcher instantiate(final IncQueryEngine engine) throws IncQueryException {
- return EClassMatcher.on(engine);
- }
-
- @Override
- public String getFullyQualifiedName() {
- return "headless.eClass";
-
- }
-
- @Override
- public List<String> getParameterNames() {
- return Arrays.asList("ec");
- }
-
- @Override
- public List<PParameter> getParameters() {
- return Arrays.asList(new PParameter("ec", "org.eclipse.emf.ecore.EClass"));
- }
-
- @Override
- public Set<PBody> doGetContainedBodies() throws IncQueryException {
- EMFPatternMatcherContext context = new EMFPatternMatcherContext();
- Set<PBody> bodies = Sets.newHashSet();
- {
- PBody body = new PBody(this);
- PVariable var_ec = body.getOrCreateVariableByName("ec");
- body.setExportedParameters(Arrays.asList(
- new ExportedParameter(body, var_ec, "ec")
- ));
-
- new TypeUnary(body, var_ec, getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EClass"), "http://www.eclipse.org/emf/2002/Ecore/EClass");
- bodies.add(body);
- }{
- PAnnotation annotation = new PAnnotation("Item");
- annotation.addAttribute("item",new ParameterReference("ec"));
- annotation.addAttribute("label","EC: $ec.name$");
- addAnnotation(annotation);
- }
- {
- PAnnotation annotation = new PAnnotation("Format");
- annotation.addAttribute("color","#e8da2c");
- addAnnotation(annotation);
- }
- setStatus(PQueryStatus.OK);
- return bodies;
- }
-
- private EClassQuerySpecification() throws IncQueryException {
- super();
- setStatus(PQueryStatus.UNINITIALIZED);
- }
-
- @SuppressWarnings("all")
- public static class Provider implements IQuerySpecificationProvider<EClassQuerySpecification> {
- @Override
- public EClassQuerySpecification get() throws IncQueryException {
- return instance();
- }
- }
-
-
- @SuppressWarnings("all")
- private static class LazyHolder {
- private final static EClassQuerySpecification INSTANCE = make();
-
- public static EClassQuerySpecification make() {
- try {
- return new EClassQuerySpecification();
- } catch (IncQueryException ex) {
- throw new RuntimeException (ex);
- }
-
- }
- }
-
-}
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/util/EObjectProcessor.java b/examples/headless-maven/incquery-demo/src/main/java/headless/util/EObjectProcessor.java
deleted file mode 100644
index a04765100..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/util/EObjectProcessor.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package headless.util;
-
-import headless.EObjectMatch;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.incquery.runtime.api.IMatchProcessor;
-
-/**
- * A match processor tailored for the headless.eObject pattern.
- *
- * Clients should derive an (anonymous) class that implements the abstract process().
- *
- */
-@SuppressWarnings("all")
-public abstract class EObjectProcessor implements IMatchProcessor<EObjectMatch> {
- /**
- * Defines the action that is to be executed on each match.
- * @param pO the value of pattern parameter o in the currently processed match
- *
- */
- public abstract void process(final EObject pO);
-
- @Override
- public void process(final EObjectMatch match) {
- process(match.getO());
-
- }
-}
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/util/EObjectQuerySpecification.java b/examples/headless-maven/incquery-demo/src/main/java/headless/util/EObjectQuerySpecification.java
deleted file mode 100644
index 68382ff72..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/util/EObjectQuerySpecification.java
+++ /dev/null
@@ -1,110 +0,0 @@
-package headless.util;
-
-import com.google.common.collect.Sets;
-import headless.EObjectMatcher;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.incquery.runtime.api.IncQueryEngine;
-import org.eclipse.incquery.runtime.api.impl.BaseGeneratedQuerySpecification;
-import org.eclipse.incquery.runtime.context.EMFPatternMatcherContext;
-import org.eclipse.incquery.runtime.exception.IncQueryException;
-import org.eclipse.incquery.runtime.extensibility.IQuerySpecificationProvider;
-import org.eclipse.incquery.runtime.matchers.psystem.PBody;
-import org.eclipse.incquery.runtime.matchers.psystem.PParameter;
-import org.eclipse.incquery.runtime.matchers.psystem.PQuery.PQueryStatus;
-import org.eclipse.incquery.runtime.matchers.psystem.PVariable;
-import org.eclipse.incquery.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.incquery.runtime.matchers.psystem.basicenumerables.TypeUnary;
-
-/**
- * A pattern-specific query specification that can instantiate EObjectMatcher in a type-safe way.
- *
- * @see EObjectMatcher
- * @see EObjectMatch
- *
- */
-@SuppressWarnings("all")
-public final class EObjectQuerySpecification extends BaseGeneratedQuerySpecification<EObjectMatcher> {
- /**
- * @return the singleton instance of the query specification
- * @throws IncQueryException if the pattern definition could not be loaded
- *
- */
- public static EObjectQuerySpecification instance() throws IncQueryException {
- try {
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- processInitializerError(err);
- throw err;
- }
-
- }
-
- @Override
- protected EObjectMatcher instantiate(final IncQueryEngine engine) throws IncQueryException {
- return EObjectMatcher.on(engine);
- }
-
- @Override
- public String getFullyQualifiedName() {
- return "headless.eObject";
-
- }
-
- @Override
- public List<String> getParameterNames() {
- return Arrays.asList("o");
- }
-
- @Override
- public List<PParameter> getParameters() {
- return Arrays.asList(new PParameter("o", "org.eclipse.emf.ecore.EObject"));
- }
-
- @Override
- public Set<PBody> doGetContainedBodies() throws IncQueryException {
- EMFPatternMatcherContext context = new EMFPatternMatcherContext();
- Set<PBody> bodies = Sets.newHashSet();
- {
- PBody body = new PBody(this);
- PVariable var_o = body.getOrCreateVariableByName("o");
- body.setExportedParameters(Arrays.asList(
- new ExportedParameter(body, var_o, "o")
- ));
-
- new TypeUnary(body, var_o, getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EObject"), "http://www.eclipse.org/emf/2002/Ecore/EObject");
- bodies.add(body);
- }setStatus(PQueryStatus.OK);
- return bodies;
- }
-
- private EObjectQuerySpecification() throws IncQueryException {
- super();
- setStatus(PQueryStatus.UNINITIALIZED);
- }
-
- @SuppressWarnings("all")
- public static class Provider implements IQuerySpecificationProvider<EObjectQuerySpecification> {
- @Override
- public EObjectQuerySpecification get() throws IncQueryException {
- return instance();
- }
- }
-
-
- @SuppressWarnings("all")
- private static class LazyHolder {
- private final static EObjectQuerySpecification INSTANCE = make();
-
- public static EObjectQuerySpecification make() {
- try {
- return new EObjectQuerySpecification();
- } catch (IncQueryException ex) {
- throw new RuntimeException (ex);
- }
-
- }
- }
-
-}
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/util/EPackageProcessor.java b/examples/headless-maven/incquery-demo/src/main/java/headless/util/EPackageProcessor.java
deleted file mode 100644
index 61e315e5a..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/util/EPackageProcessor.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package headless.util;
-
-import headless.EPackageMatch;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.incquery.runtime.api.IMatchProcessor;
-
-/**
- * A match processor tailored for the headless.ePackage pattern.
- *
- * Clients should derive an (anonymous) class that implements the abstract process().
- *
- */
-@SuppressWarnings("all")
-public abstract class EPackageProcessor implements IMatchProcessor<EPackageMatch> {
- /**
- * Defines the action that is to be executed on each match.
- * @param pP the value of pattern parameter p in the currently processed match
- *
- */
- public abstract void process(final EPackage pP);
-
- @Override
- public void process(final EPackageMatch match) {
- process(match.getP());
-
- }
-}
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/util/EPackageQuerySpecification.java b/examples/headless-maven/incquery-demo/src/main/java/headless/util/EPackageQuerySpecification.java
deleted file mode 100644
index e0ca9cc86..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/util/EPackageQuerySpecification.java
+++ /dev/null
@@ -1,124 +0,0 @@
-package headless.util;
-
-import com.google.common.collect.Sets;
-import headless.EPackageMatcher;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.incquery.runtime.api.IncQueryEngine;
-import org.eclipse.incquery.runtime.api.impl.BaseGeneratedQuerySpecification;
-import org.eclipse.incquery.runtime.context.EMFPatternMatcherContext;
-import org.eclipse.incquery.runtime.exception.IncQueryException;
-import org.eclipse.incquery.runtime.extensibility.IQuerySpecificationProvider;
-import org.eclipse.incquery.runtime.matchers.psystem.PBody;
-import org.eclipse.incquery.runtime.matchers.psystem.PParameter;
-import org.eclipse.incquery.runtime.matchers.psystem.PQuery.PQueryStatus;
-import org.eclipse.incquery.runtime.matchers.psystem.PVariable;
-import org.eclipse.incquery.runtime.matchers.psystem.annotations.PAnnotation;
-import org.eclipse.incquery.runtime.matchers.psystem.annotations.ParameterReference;
-import org.eclipse.incquery.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.incquery.runtime.matchers.psystem.basicenumerables.TypeUnary;
-
-/**
- * A pattern-specific query specification that can instantiate EPackageMatcher in a type-safe way.
- *
- * @see EPackageMatcher
- * @see EPackageMatch
- *
- */
-@SuppressWarnings("all")
-public final class EPackageQuerySpecification extends BaseGeneratedQuerySpecification<EPackageMatcher> {
- /**
- * @return the singleton instance of the query specification
- * @throws IncQueryException if the pattern definition could not be loaded
- *
- */
- public static EPackageQuerySpecification instance() throws IncQueryException {
- try {
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- processInitializerError(err);
- throw err;
- }
-
- }
-
- @Override
- protected EPackageMatcher instantiate(final IncQueryEngine engine) throws IncQueryException {
- return EPackageMatcher.on(engine);
- }
-
- @Override
- public String getFullyQualifiedName() {
- return "headless.ePackage";
-
- }
-
- @Override
- public List<String> getParameterNames() {
- return Arrays.asList("p");
- }
-
- @Override
- public List<PParameter> getParameters() {
- return Arrays.asList(new PParameter("p", "org.eclipse.emf.ecore.EPackage"));
- }
-
- @Override
- public Set<PBody> doGetContainedBodies() throws IncQueryException {
- EMFPatternMatcherContext context = new EMFPatternMatcherContext();
- Set<PBody> bodies = Sets.newHashSet();
- {
- PBody body = new PBody(this);
- PVariable var_p = body.getOrCreateVariableByName("p");
- body.setExportedParameters(Arrays.asList(
- new ExportedParameter(body, var_p, "p")
- ));
-
- new TypeUnary(body, var_p, getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EPackage"), "http://www.eclipse.org/emf/2002/Ecore/EPackage");
- bodies.add(body);
- }{
- PAnnotation annotation = new PAnnotation("Item");
- annotation.addAttribute("item",new ParameterReference("p"));
- annotation.addAttribute("label","P: $p.name$");
- addAnnotation(annotation);
- }
- {
- PAnnotation annotation = new PAnnotation("Format");
- annotation.addAttribute("textColor","#ffffff");
- annotation.addAttribute("color","#791662");
- addAnnotation(annotation);
- }
- setStatus(PQueryStatus.OK);
- return bodies;
- }
-
- private EPackageQuerySpecification() throws IncQueryException {
- super();
- setStatus(PQueryStatus.UNINITIALIZED);
- }
-
- @SuppressWarnings("all")
- public static class Provider implements IQuerySpecificationProvider<EPackageQuerySpecification> {
- @Override
- public EPackageQuerySpecification get() throws IncQueryException {
- return instance();
- }
- }
-
-
- @SuppressWarnings("all")
- private static class LazyHolder {
- private final static EPackageQuerySpecification INSTANCE = make();
-
- public static EPackageQuerySpecification make() {
- try {
- return new EPackageQuerySpecification();
- } catch (IncQueryException ex) {
- throw new RuntimeException (ex);
- }
-
- }
- }
-
-}
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/util/SubPackageProcessor.java b/examples/headless-maven/incquery-demo/src/main/java/headless/util/SubPackageProcessor.java
deleted file mode 100644
index 8a28463b5..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/util/SubPackageProcessor.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package headless.util;
-
-import headless.SubPackageMatch;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.incquery.runtime.api.IMatchProcessor;
-
-/**
- * A match processor tailored for the headless.subPackage pattern.
- *
- * Clients should derive an (anonymous) class that implements the abstract process().
- *
- */
-@SuppressWarnings("all")
-public abstract class SubPackageProcessor implements IMatchProcessor<SubPackageMatch> {
- /**
- * Defines the action that is to be executed on each match.
- * @param pP the value of pattern parameter p in the currently processed match
- * @param pSp the value of pattern parameter sp in the currently processed match
- *
- */
- public abstract void process(final EPackage pP, final EPackage pSp);
-
- @Override
- public void process(final SubPackageMatch match) {
- process(match.getP(), match.getSp());
-
- }
-}
diff --git a/examples/headless-maven/incquery-demo/src/main/java/headless/util/SubPackageQuerySpecification.java b/examples/headless-maven/incquery-demo/src/main/java/headless/util/SubPackageQuerySpecification.java
deleted file mode 100644
index 8456e7bd3..000000000
--- a/examples/headless-maven/incquery-demo/src/main/java/headless/util/SubPackageQuerySpecification.java
+++ /dev/null
@@ -1,122 +0,0 @@
-package headless.util;
-
-import com.google.common.collect.Sets;
-import headless.SubPackageMatcher;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.incquery.runtime.api.IncQueryEngine;
-import org.eclipse.incquery.runtime.api.impl.BaseGeneratedQuerySpecification;
-import org.eclipse.incquery.runtime.context.EMFPatternMatcherContext;
-import org.eclipse.incquery.runtime.exception.IncQueryException;
-import org.eclipse.incquery.runtime.extensibility.IQuerySpecificationProvider;
-import org.eclipse.incquery.runtime.matchers.psystem.PBody;
-import org.eclipse.incquery.runtime.matchers.psystem.PParameter;
-import org.eclipse.incquery.runtime.matchers.psystem.PQuery.PQueryStatus;
-import org.eclipse.incquery.runtime.matchers.psystem.PVariable;
-import org.eclipse.incquery.runtime.matchers.psystem.annotations.PAnnotation;
-import org.eclipse.incquery.runtime.matchers.psystem.annotations.ParameterReference;
-import org.eclipse.incquery.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.incquery.runtime.matchers.psystem.basicenumerables.TypeBinary;
-
-/**
- * A pattern-specific query specification that can instantiate SubPackageMatcher in a type-safe way.
- *
- * @see SubPackageMatcher
- * @see SubPackageMatch
- *
- */
-@SuppressWarnings("all")
-public final class SubPackageQuerySpecification extends BaseGeneratedQuerySpecification<SubPackageMatcher> {
- /**
- * @return the singleton instance of the query specification
- * @throws IncQueryException if the pattern definition could not be loaded
- *
- */
- public static SubPackageQuerySpecification instance() throws IncQueryException {
- try {
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- processInitializerError(err);
- throw err;
- }
-
- }
-
- @Override
- protected SubPackageMatcher instantiate(final IncQueryEngine engine) throws IncQueryException {
- return SubPackageMatcher.on(engine);
- }
-
- @Override
- public String getFullyQualifiedName() {
- return "headless.subPackage";
-
- }
-
- @Override
- public List<String> getParameterNames() {
- return Arrays.asList("p","sp");
- }
-
- @Override
- public List<PParameter> getParameters() {
- return Arrays.asList(new PParameter("p", "org.eclipse.emf.ecore.EPackage"),new PParameter("sp", "org.eclipse.emf.ecore.EPackage"));
- }
-
- @Override
- public Set<PBody> doGetContainedBodies() throws IncQueryException {
- EMFPatternMatcherContext context = new EMFPatternMatcherContext();
- Set<PBody> bodies = Sets.newHashSet();
- {
- PBody body = new PBody(this);
- PVariable var_p = body.getOrCreateVariableByName("p");
- PVariable var_sp = body.getOrCreateVariableByName("sp");
- body.setExportedParameters(Arrays.asList(
- new ExportedParameter(body, var_p, "p"),
- new ExportedParameter(body, var_sp, "sp")
- ));
-
-
- new TypeBinary(body, context, var_p, var_sp, getFeatureLiteral("http://www.eclipse.org/emf/2002/Ecore", "EPackage", "eSubpackages"), "http://www.eclipse.org/emf/2002/Ecore/EPackage.eSubpackages");
- bodies.add(body);
- }{
- PAnnotation annotation = new PAnnotation("Edge");
- annotation.addAttribute("source",new ParameterReference("p"));
- annotation.addAttribute("target",new ParameterReference("sp"));
- annotation.addAttribute("label","sub");
- addAnnotation(annotation);
- }
- setStatus(PQueryStatus.OK);
- return bodies;
- }
-
- private SubPackageQuerySpecification() throws IncQueryException {
- super();
- setStatus(PQueryStatus.UNINITIALIZED);
- }
-
- @SuppressWarnings("all")
- public static class Provider implements IQuerySpecificationProvider<SubPackageQuerySpecification> {
- @Override
- public SubPackageQuerySpecification get() throws IncQueryException {
- return instance();
- }
- }
-
-
- @SuppressWarnings("all")
- private static class LazyHolder {
- private final static SubPackageQuerySpecification INSTANCE = make();
-
- public static SubPackageQuerySpecification make() {
- try {
- return new SubPackageQuerySpecification();
- } catch (IncQueryException ex) {
- throw new RuntimeException (ex);
- }
-
- }
- }
-
-}

Back to the top