public class NamedElementClientDependencyMatcher extends org.eclipse.viatra.query.runtime.api.impl.BaseMatcher<NamedElementClientDependencyMatch>
Use the pattern matcher on a given model via on(ViatraQueryEngine)
,
e.g. in conjunction with ViatraQueryEngine#on(Notifier)
.
Matches of the pattern will be represented as NamedElementClientDependencyMatch
.
Original source:
(ownedAttribute->select(oclIsKindOf(Port))->collect(oclAsType(Port))->asOrderedSet())
// Can't compile OCL to VIATRA Query because of java.lang.UnsupportedOperationException: asOrderedSet
//@Surrogate(feature = "ownedPort")
//@QueryExplorer(checked = false)
//pattern encapsulatedClassifierOwnedPort(source: EncapsulatedClassifier, target: Port) {}
(ownedEnd.lowerBound() = 1)
// Can't compile OCL to VIATRA Query because of org.eclipse.ocl.SemanticException: Cannot find operation (=(Integer)) for the type (Sequence(Integer))
//@Surrogate(feature = "isRequired")
//@QueryExplorer(checked = false)
//pattern extensionIsRequired(source: Extension, target: Boolean) {}
(metaclassEnd().type.oclAsType(Class))
// Can't compile OCL to VIATRA Query because of java.lang.UnsupportedOperationException: metaclassEnd
//@Surrogate(feature = "metaclass")
//@QueryExplorer(checked = false)
//pattern extensionMetaclass(source: Extension, target: Class) {}
(lowerBound())
// Can't compile OCL to VIATRA Query because of java.lang.UnsupportedOperationException: lowerBound
//@Surrogate(feature = "lower")
//@QueryExplorer(checked = false)
//pattern multiplicityElementLower(source: MultiplicityElement, target: Integer) {}
(upperBound())
// Can't compile OCL to VIATRA Query because of java.lang.UnsupportedOperationException: upperBound
//@Surrogate(feature = "upper")
//@QueryExplorer(checked = false)
//pattern multiplicityElementUpper(source: MultiplicityElement, target: UnlimitedNatural) {}
(Dependency.allInstances()->select(d | d.client->includes(self)))
@Surrogate(feature = "clientDependency")
@QueryExplorer(checked = false)
pattern namedElementClientDependency(
self : NamedElement,
d : Dependency
) {
Dependency.client(d, namedElement);
namedElement == self;
Dependency(dependency);
d == dependency;
}
NamedElementClientDependencyMatch
,
NamedElementClientDependencyProcessor
,
NamedElementClientDependencyQuerySpecification
Modifier and Type | Method and Description |
---|---|
int |
countMatches(org.eclipse.uml2.uml.NamedElement pSelf,
org.eclipse.uml2.uml.Dependency pD)
Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
|
void |
forEachMatch(org.eclipse.uml2.uml.NamedElement pSelf,
org.eclipse.uml2.uml.Dependency pD,
org.eclipse.viatra.query.runtime.api.IMatchProcessor<? super NamedElementClientDependencyMatch> processor)
Executes the given processor on each match of the pattern that conforms to the given fixed values of some parameters.
|
boolean |
forOneArbitraryMatch(org.eclipse.uml2.uml.NamedElement pSelf,
org.eclipse.uml2.uml.Dependency pD,
org.eclipse.viatra.query.runtime.api.IMatchProcessor<? super NamedElementClientDependencyMatch> processor)
Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
|
java.util.Collection<NamedElementClientDependencyMatch> |
getAllMatches(org.eclipse.uml2.uml.NamedElement pSelf,
org.eclipse.uml2.uml.Dependency pD)
Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
|
java.util.Set<org.eclipse.uml2.uml.Dependency> |
getAllValuesOfd()
Retrieve the set of values that occur in matches for d.
|
java.util.Set<org.eclipse.uml2.uml.Dependency> |
getAllValuesOfd(org.eclipse.uml2.uml.NamedElement pSelf)
Retrieve the set of values that occur in matches for d.
|
java.util.Set<org.eclipse.uml2.uml.Dependency> |
getAllValuesOfd(NamedElementClientDependencyMatch partialMatch)
Retrieve the set of values that occur in matches for d.
|
java.util.Set<org.eclipse.uml2.uml.NamedElement> |
getAllValuesOfself()
Retrieve the set of values that occur in matches for self.
|
java.util.Set<org.eclipse.uml2.uml.NamedElement> |
getAllValuesOfself(org.eclipse.uml2.uml.Dependency pD)
Retrieve the set of values that occur in matches for self.
|
java.util.Set<org.eclipse.uml2.uml.NamedElement> |
getAllValuesOfself(NamedElementClientDependencyMatch partialMatch)
Retrieve the set of values that occur in matches for self.
|
NamedElementClientDependencyMatch |
getOneArbitraryMatch(org.eclipse.uml2.uml.NamedElement pSelf,
org.eclipse.uml2.uml.Dependency pD)
Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
|
boolean |
hasMatch(org.eclipse.uml2.uml.NamedElement pSelf,
org.eclipse.uml2.uml.Dependency pD)
Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
under any possible substitution of the unspecified parameters (if any).
|
NamedElementClientDependencyMatch |
newMatch(org.eclipse.uml2.uml.NamedElement pSelf,
org.eclipse.uml2.uml.Dependency pD)
Returns a new (partial) match.
|
static NamedElementClientDependencyMatcher |
on(org.eclipse.viatra.query.runtime.api.ViatraQueryEngine engine)
Initializes the pattern matcher within an existing VIATRA Query engine.
|
static org.eclipse.viatra.query.runtime.api.IQuerySpecification<NamedElementClientDependencyMatcher> |
querySpecification() |
countMatches, countMatches, forEachMatch, forEachMatch, forOneArbitraryMatch, forOneArbitraryMatch, getAllMatches, getAllMatches, getAllValues, getAllValues, getEngine, getOneArbitraryMatch, getOneArbitraryMatch, getParameterNames, getPatternName, getPositionOfParameter, getSpecification, hasMatch, newEmptyMatch, newMatch
public static NamedElementClientDependencyMatcher on(org.eclipse.viatra.query.runtime.api.ViatraQueryEngine engine) throws org.eclipse.viatra.query.runtime.exception.ViatraQueryException
engine
- the existing VIATRA Query engine in which this matcher will be created.org.eclipse.viatra.query.runtime.exception.ViatraQueryException
- if an error occurs during pattern matcher creationpublic java.util.Collection<NamedElementClientDependencyMatch> getAllMatches(org.eclipse.uml2.uml.NamedElement pSelf, org.eclipse.uml2.uml.Dependency pD)
pSelf
- the fixed value of pattern parameter self, or null if not bound.pD
- the fixed value of pattern parameter d, or null if not bound.public NamedElementClientDependencyMatch getOneArbitraryMatch(org.eclipse.uml2.uml.NamedElement pSelf, org.eclipse.uml2.uml.Dependency pD)
pSelf
- the fixed value of pattern parameter self, or null if not bound.pD
- the fixed value of pattern parameter d, or null if not bound.public boolean hasMatch(org.eclipse.uml2.uml.NamedElement pSelf, org.eclipse.uml2.uml.Dependency pD)
pSelf
- the fixed value of pattern parameter self, or null if not bound.pD
- the fixed value of pattern parameter d, or null if not bound.public int countMatches(org.eclipse.uml2.uml.NamedElement pSelf, org.eclipse.uml2.uml.Dependency pD)
pSelf
- the fixed value of pattern parameter self, or null if not bound.pD
- the fixed value of pattern parameter d, or null if not bound.public void forEachMatch(org.eclipse.uml2.uml.NamedElement pSelf, org.eclipse.uml2.uml.Dependency pD, org.eclipse.viatra.query.runtime.api.IMatchProcessor<? super NamedElementClientDependencyMatch> processor)
pSelf
- the fixed value of pattern parameter self, or null if not bound.pD
- the fixed value of pattern parameter d, or null if not bound.processor
- the action that will process each pattern match.public boolean forOneArbitraryMatch(org.eclipse.uml2.uml.NamedElement pSelf, org.eclipse.uml2.uml.Dependency pD, org.eclipse.viatra.query.runtime.api.IMatchProcessor<? super NamedElementClientDependencyMatch> processor)
pSelf
- the fixed value of pattern parameter self, or null if not bound.pD
- the fixed value of pattern parameter d, or null if not bound.processor
- the action that will process the selected match.public NamedElementClientDependencyMatch newMatch(org.eclipse.uml2.uml.NamedElement pSelf, org.eclipse.uml2.uml.Dependency pD)
The returned match will be immutable. Use BaseMatcher.newEmptyMatch()
to obtain a mutable match object.
pSelf
- the fixed value of pattern parameter self, or null if not bound.pD
- the fixed value of pattern parameter d, or null if not bound.public java.util.Set<org.eclipse.uml2.uml.NamedElement> getAllValuesOfself()
public java.util.Set<org.eclipse.uml2.uml.NamedElement> getAllValuesOfself(NamedElementClientDependencyMatch partialMatch)
public java.util.Set<org.eclipse.uml2.uml.NamedElement> getAllValuesOfself(org.eclipse.uml2.uml.Dependency pD)
public java.util.Set<org.eclipse.uml2.uml.Dependency> getAllValuesOfd()
public java.util.Set<org.eclipse.uml2.uml.Dependency> getAllValuesOfd(NamedElementClientDependencyMatch partialMatch)
public java.util.Set<org.eclipse.uml2.uml.Dependency> getAllValuesOfd(org.eclipse.uml2.uml.NamedElement pSelf)
public static org.eclipse.viatra.query.runtime.api.IQuerySpecification<NamedElementClientDependencyMatcher> querySpecification() throws org.eclipse.viatra.query.runtime.exception.ViatraQueryException
org.eclipse.viatra.query.runtime.exception.ViatraQueryException
- if the pattern definition could not be loaded