diff options
Diffstat (limited to 'Solvers/VIATRA-Solver/org.eclipse.viatra.dse/src/org/eclipse/viatra/dse/api/DSETransformationRule.java')
-rw-r--r-- | Solvers/VIATRA-Solver/org.eclipse.viatra.dse/src/org/eclipse/viatra/dse/api/DSETransformationRule.java | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/Solvers/VIATRA-Solver/org.eclipse.viatra.dse/src/org/eclipse/viatra/dse/api/DSETransformationRule.java b/Solvers/VIATRA-Solver/org.eclipse.viatra.dse/src/org/eclipse/viatra/dse/api/DSETransformationRule.java new file mode 100644 index 00000000..8c3511ae --- /dev/null +++ b/Solvers/VIATRA-Solver/org.eclipse.viatra.dse/src/org/eclipse/viatra/dse/api/DSETransformationRule.java | |||
@@ -0,0 +1,51 @@ | |||
1 | /******************************************************************************* | ||
2 | * Copyright (c) 2010-2014, Miklos Foldenyi, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro | ||
3 | * This program and the accompanying materials are made available under the | ||
4 | * terms of the Eclipse Public License v. 2.0 which is available at | ||
5 | * http://www.eclipse.org/legal/epl-v20.html. | ||
6 | * | ||
7 | * SPDX-License-Identifier: EPL-2.0 | ||
8 | *******************************************************************************/ | ||
9 | package org.eclipse.viatra.dse.api; | ||
10 | |||
11 | import java.util.Objects; | ||
12 | import java.util.function.Consumer; | ||
13 | |||
14 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
15 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
16 | import org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher; | ||
17 | import org.eclipse.viatra.transformation.runtime.emf.rules.batch.BatchTransformationRule; | ||
18 | |||
19 | /** | ||
20 | * An instance of this class is a specification of a graph transformation rule on a given metamodel. Such a rule | ||
21 | * consists of a left hand side (LHS), which is specified by an {@link IQuerySpecification} and a right hand side (RHS), | ||
22 | * which is specified by an {@link Consumer}. | ||
23 | * | ||
24 | * @author Andras Szabolcs Nagy | ||
25 | * | ||
26 | * @param <Match> | ||
27 | * A VIATRA Query pattern match - left hand side of the rule | ||
28 | * @param <Matcher> | ||
29 | * A VIATRA Query pattern matcher - left hand side of the rule | ||
30 | * @deprecated | ||
31 | */ | ||
32 | @Deprecated | ||
33 | public class DSETransformationRule<Match extends IPatternMatch, Matcher extends ViatraQueryMatcher<Match>> extends | ||
34 | BatchTransformationRule<Match, Matcher> { | ||
35 | |||
36 | public DSETransformationRule(String name, IQuerySpecification<Matcher> querySpec, | ||
37 | Consumer<Match> action) { | ||
38 | super(name, querySpec, BatchTransformationRule.STATELESS_RULE_LIFECYCLE, action); | ||
39 | |||
40 | Objects.requireNonNull(name); | ||
41 | Objects.requireNonNull(querySpec); | ||
42 | Objects.requireNonNull(action); | ||
43 | |||
44 | } | ||
45 | |||
46 | public DSETransformationRule(IQuerySpecification<Matcher> querySpec, | ||
47 | Consumer<Match> action) { | ||
48 | this(querySpec.getFullyQualifiedName(), querySpec, action); | ||
49 | } | ||
50 | |||
51 | } | ||