public class NamedElementClientDependencyMatcher extends 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
engine, querySpecification
Modifier and Type | Method and Description |
---|---|
protected NamedElementClientDependencyMatch |
arrayToMatch(java.lang.Object[] match)
Converts the array representation of a pattern match to an immutable Match object.
|
protected NamedElementClientDependencyMatch |
arrayToMatchMutable(java.lang.Object[] match)
Converts the array representation of a pattern match to a mutable Match object.
|
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.
|
static NamedElementClientDependencyMatcher |
create() |
void |
forEachMatch(org.eclipse.uml2.uml.NamedElement pSelf,
org.eclipse.uml2.uml.Dependency pD,
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,
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(ViatraQueryEngine engine)
Initializes the pattern matcher within an existing VIATRA Query engine.
|
static IQuerySpecification<NamedElementClientDependencyMatcher> |
querySpecification() |
protected java.util.Set<org.eclipse.uml2.uml.Dependency> |
rawAccumulateAllValuesOfd(java.lang.Object[] parameters)
Retrieve the set of values that occur in matches for d.
|
protected java.util.Set<org.eclipse.uml2.uml.NamedElement> |
rawAccumulateAllValuesOfself(java.lang.Object[] parameters)
Retrieve the set of values that occur in matches for self.
|
protected NamedElementClientDependencyMatch |
tupleToMatch(Tuple t) |
countMatches, countMatches, emptyArray, forEachMatch, forEachMatch, forOneArbitraryMatch, forOneArbitraryMatch, getAllMatches, getAllMatches, getAllValues, getAllValues, getCapabilities, getEngine, getOneArbitraryMatch, getOneArbitraryMatch, getParameterNames, getPatternName, getPositionOfParameter, getSpecification, hasMatch, matchToArray, newEmptyMatch, newMatch, rawAccumulateAllValues, rawCountMatches, rawForEachMatch, rawForOneArbitraryMatch, rawGetAllMatches, rawGetAllValues, rawGetOneArbitraryMatch, rawHasMatch, setBackend
public static NamedElementClientDependencyMatcher on(ViatraQueryEngine engine) throws ViatraQueryException
engine
- the existing VIATRA Query engine in which this matcher will be created.ViatraQueryException
- if an error occurs during pattern matcher creationpublic static NamedElementClientDependencyMatcher create() throws ViatraQueryException
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, 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, 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.protected java.util.Set<org.eclipse.uml2.uml.NamedElement> rawAccumulateAllValuesOfself(java.lang.Object[] parameters)
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)
protected java.util.Set<org.eclipse.uml2.uml.Dependency> rawAccumulateAllValuesOfd(java.lang.Object[] parameters)
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)
protected NamedElementClientDependencyMatch tupleToMatch(Tuple t)
tupleToMatch
in class BaseMatcher<NamedElementClientDependencyMatch>
protected NamedElementClientDependencyMatch arrayToMatch(java.lang.Object[] match)
BaseMatcher
arrayToMatch
in class BaseMatcher<NamedElementClientDependencyMatch>
protected NamedElementClientDependencyMatch arrayToMatchMutable(java.lang.Object[] match)
BaseMatcher
arrayToMatchMutable
in class BaseMatcher<NamedElementClientDependencyMatch>
public static IQuerySpecification<NamedElementClientDependencyMatcher> querySpecification() throws ViatraQueryException
ViatraQueryException
- if the pattern definition could not be loaded