public class ClassifierParentsMatcher extends BaseMatcher<ClassifierParentsMatch>
Use the pattern matcher on a given model via on(IncQueryEngine)
,
e.g. in conjunction with IncQueryEngine.on(Notifier)
.
Matches of the pattern will be represented as ClassifierParentsMatch
.
Original source:
(directlyRealizedInterfaces()- >union(self.allParents()- >collect(directlyRealizedInterfaces()))- >asSet())
// Can't compile OCL to IncQuery because of java.lang.UnsupportedOperationException: directlyRealizedInterfaces
//pattern classifierAllRealizedInterfaces(source: Classifier, target: Interface) {}
(directlyUsedInterfaces()- >union(self.allParents()- >collect(directlyUsedInterfaces()))- >asSet())
// Can't compile OCL to IncQuery because of java.lang.UnsupportedOperationException: directlyUsedInterfaces
//pattern classifierAllUsedInterfaces(source: Classifier, target: Interface) {}
(inhs- >reject(inh |
inh.oclIsKindOf(RedefinableElement) and
ownedMember- >select(oclIsKindOf(RedefinableElement))- >
select(redefinedElement- >includes(inh.oclAsType(RedefinableElement)))
- >notEmpty()))
// Can't compile OCL to IncQuery because of org.eclipse.ocl.SemanticException: Unrecognized variable: (inhs)
//pattern classifierInherit(source: Classifier, target: NamedElement) {}
(member- >select(m | c.hasVisibilityOf(m)))
// Can't compile OCL to IncQuery because of org.eclipse.ocl.SemanticException: Unrecognized variable: (c)
//pattern classifierInheritableMembers(source: Classifier, target: NamedElement) {}
(generalization.general- >asSet())
@QueryExplorer(checked = false)
pattern classifierParents(
self : Classifier,
classifier : Classifier
) {
Classifier.generalization(self, generalization);
temp1 == generalization;
Generalization.general(temp1, classifier);
}
ClassifierParentsMatch
,
ClassifierParentsProcessor
,
ClassifierParentsQuerySpecification
Constructor and Description |
---|
ClassifierParentsMatcher(IncQueryEngine engine)
Deprecated.
use
on(IncQueryEngine) instead |
ClassifierParentsMatcher(org.eclipse.emf.common.notify.Notifier emfRoot)
Deprecated.
use
on(IncQueryEngine) instead, e.g. in conjunction with IncQueryEngine.on(Notifier) |
Modifier and Type | Method and Description |
---|---|
int |
countMatches(org.eclipse.uml2.uml.Classifier pSelf,
org.eclipse.uml2.uml.Classifier pClassifier)
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.Classifier pSelf,
org.eclipse.uml2.uml.Classifier pClassifier,
IMatchProcessor<? super ClassifierParentsMatch> 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.Classifier pSelf,
org.eclipse.uml2.uml.Classifier pClassifier,
IMatchProcessor<? super ClassifierParentsMatch> 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<ClassifierParentsMatch> |
getAllMatches(org.eclipse.uml2.uml.Classifier pSelf,
org.eclipse.uml2.uml.Classifier pClassifier)
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.Classifier> |
getAllValuesOfclassifier()
Retrieve the set of values that occur in matches for classifier.
|
java.util.Set<org.eclipse.uml2.uml.Classifier> |
getAllValuesOfclassifier(org.eclipse.uml2.uml.Classifier pSelf)
Retrieve the set of values that occur in matches for classifier.
|
java.util.Set<org.eclipse.uml2.uml.Classifier> |
getAllValuesOfclassifier(ClassifierParentsMatch partialMatch)
Retrieve the set of values that occur in matches for classifier.
|
java.util.Set<org.eclipse.uml2.uml.Classifier> |
getAllValuesOfself()
Retrieve the set of values that occur in matches for self.
|
java.util.Set<org.eclipse.uml2.uml.Classifier> |
getAllValuesOfself(org.eclipse.uml2.uml.Classifier pClassifier)
Retrieve the set of values that occur in matches for self.
|
java.util.Set<org.eclipse.uml2.uml.Classifier> |
getAllValuesOfself(ClassifierParentsMatch partialMatch)
Retrieve the set of values that occur in matches for self.
|
ClassifierParentsMatch |
getOneArbitraryMatch(org.eclipse.uml2.uml.Classifier pSelf,
org.eclipse.uml2.uml.Classifier pClassifier)
Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
|
boolean |
hasMatch(org.eclipse.uml2.uml.Classifier pSelf,
org.eclipse.uml2.uml.Classifier pClassifier)
Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
under any possible substitution of the unspecified parameters (if any).
|
ClassifierParentsMatch |
newMatch(org.eclipse.uml2.uml.Classifier pSelf,
org.eclipse.uml2.uml.Classifier pClassifier)
Returns a new (partial) match.
|
static ClassifierParentsMatcher |
on(IncQueryEngine engine)
Initializes the pattern matcher within an existing EMF-IncQuery engine.
|
static IQuerySpecification<ClassifierParentsMatcher> |
querySpecification() |
countMatches, countMatches, forEachMatch, forEachMatch, forOneArbitraryMatch, forOneArbitraryMatch, getAllMatches, getAllMatches, getAllValues, getAllValues, getEngine, getOneArbitraryMatch, getOneArbitraryMatch, getParameterNames, getPatternName, getPositionOfParameter, getSpecification, hasMatch, newEmptyMatch, newMatch
@Deprecated public ClassifierParentsMatcher(org.eclipse.emf.common.notify.Notifier emfRoot) throws IncQueryException
on(IncQueryEngine)
instead, e.g. in conjunction with IncQueryEngine.on(Notifier)
The matcher will be created within the managed IncQueryEngine
belonging to the EMF model root, so
multiple matchers will reuse the same engine and benefit from increased performance and reduced memory footprint.
emfRoot
- the root of the EMF containment hierarchy where the pattern matcher will operate. Recommended: Resource or ResourceSet.IncQueryException
- if an error occurs during pattern matcher creation@Deprecated public ClassifierParentsMatcher(IncQueryEngine engine) throws IncQueryException
on(IncQueryEngine)
insteadengine
- the existing EMF-IncQuery engine in which this matcher will be created.IncQueryException
- if an error occurs during pattern matcher creationpublic static ClassifierParentsMatcher on(IncQueryEngine engine) throws IncQueryException
engine
- the existing EMF-IncQuery engine in which this matcher will be created.IncQueryException
- if an error occurs during pattern matcher creationpublic java.util.Collection<ClassifierParentsMatch> getAllMatches(org.eclipse.uml2.uml.Classifier pSelf, org.eclipse.uml2.uml.Classifier pClassifier)
pSelf
- the fixed value of pattern parameter self, or null if not bound.pClassifier
- the fixed value of pattern parameter classifier, or null if not bound.public ClassifierParentsMatch getOneArbitraryMatch(org.eclipse.uml2.uml.Classifier pSelf, org.eclipse.uml2.uml.Classifier pClassifier)
pSelf
- the fixed value of pattern parameter self, or null if not bound.pClassifier
- the fixed value of pattern parameter classifier, or null if not bound.public boolean hasMatch(org.eclipse.uml2.uml.Classifier pSelf, org.eclipse.uml2.uml.Classifier pClassifier)
pSelf
- the fixed value of pattern parameter self, or null if not bound.pClassifier
- the fixed value of pattern parameter classifier, or null if not bound.public int countMatches(org.eclipse.uml2.uml.Classifier pSelf, org.eclipse.uml2.uml.Classifier pClassifier)
pSelf
- the fixed value of pattern parameter self, or null if not bound.pClassifier
- the fixed value of pattern parameter classifier, or null if not bound.public void forEachMatch(org.eclipse.uml2.uml.Classifier pSelf, org.eclipse.uml2.uml.Classifier pClassifier, IMatchProcessor<? super ClassifierParentsMatch> processor)
pSelf
- the fixed value of pattern parameter self, or null if not bound.pClassifier
- the fixed value of pattern parameter classifier, or null if not bound.processor
- the action that will process each pattern match.public boolean forOneArbitraryMatch(org.eclipse.uml2.uml.Classifier pSelf, org.eclipse.uml2.uml.Classifier pClassifier, IMatchProcessor<? super ClassifierParentsMatch> processor)
pSelf
- the fixed value of pattern parameter self, or null if not bound.pClassifier
- the fixed value of pattern parameter classifier, or null if not bound.processor
- the action that will process the selected match.public ClassifierParentsMatch newMatch(org.eclipse.uml2.uml.Classifier pSelf, org.eclipse.uml2.uml.Classifier pClassifier)
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.pClassifier
- the fixed value of pattern parameter classifier, or null if not bound.public java.util.Set<org.eclipse.uml2.uml.Classifier> getAllValuesOfself()
public java.util.Set<org.eclipse.uml2.uml.Classifier> getAllValuesOfself(ClassifierParentsMatch partialMatch)
public java.util.Set<org.eclipse.uml2.uml.Classifier> getAllValuesOfself(org.eclipse.uml2.uml.Classifier pClassifier)
public java.util.Set<org.eclipse.uml2.uml.Classifier> getAllValuesOfclassifier()
public java.util.Set<org.eclipse.uml2.uml.Classifier> getAllValuesOfclassifier(ClassifierParentsMatch partialMatch)
public java.util.Set<org.eclipse.uml2.uml.Classifier> getAllValuesOfclassifier(org.eclipse.uml2.uml.Classifier pSelf)
public static IQuerySpecification<ClassifierParentsMatcher> querySpecification() throws IncQueryException
IncQueryException
- if the pattern definition could not be loaded