public class TransformedStereotypedBlocksMatcher extends org.eclipse.viatra.query.runtime.api.impl.BaseMatcher<TransformedStereotypedBlocksMatch>
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 TransformedStereotypedBlocksMatch
.
Original source:
Event-Driven rule precondition number 3
Queries blocks that have been transformed by rule 1, in order to remove now obsolete stereotype instances.
These blocks have a stereotype of the selected profile, and a property that has the same name and is of the same type
pattern TransformedStereotypedBlocks(block : Class, stereotype : Stereotype, slot : Slot) {
//variable 'block' is a block
find block(block);
//properties of applied stereotype
Class.appliedStereotypeInstance.slot(block, slot);
Slot.definingFeature(slot, property); // Property of Stereotype
Stereotype.ownedAttribute(stereotype, property);
//Query the block's attributes
Class.ownedAttribute(block, createdProperty);
//Check if properties are considered equal
Property.name(createdProperty, name);
Property.name(property, name);
Property.type(createdProperty, type);
Property.type(property, type);
}
TransformedStereotypedBlocksMatch
,
TransformedStereotypedBlocksProcessor
,
TransformedStereotypedBlocksQuerySpecification
Modifier and Type | Method and Description |
---|---|
protected TransformedStereotypedBlocksMatch |
arrayToMatch(java.lang.Object[] match) |
protected TransformedStereotypedBlocksMatch |
arrayToMatchMutable(java.lang.Object[] match) |
int |
countMatches(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Class pBlock,
com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype pStereotype,
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Slot pSlot)
Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
|
static TransformedStereotypedBlocksMatcher |
create() |
void |
forEachMatch(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Class pBlock,
com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype pStereotype,
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Slot pSlot,
org.eclipse.viatra.query.runtime.api.IMatchProcessor<? super TransformedStereotypedBlocksMatch> processor)
Executes the given processor on each match of the pattern that conforms to the given fixed values of some parameters.
|
boolean |
forOneArbitraryMatch(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Class pBlock,
com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype pStereotype,
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Slot pSlot,
org.eclipse.viatra.query.runtime.api.IMatchProcessor<? super TransformedStereotypedBlocksMatch> 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<TransformedStereotypedBlocksMatch> |
getAllMatches(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Class pBlock,
com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype pStereotype,
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Slot pSlot)
Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
|
java.util.Set<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Class> |
getAllValuesOfblock()
Retrieve the set of values that occur in matches for block.
|
java.util.Set<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Class> |
getAllValuesOfblock(com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype pStereotype,
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Slot pSlot)
Retrieve the set of values that occur in matches for block.
|
java.util.Set<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Class> |
getAllValuesOfblock(TransformedStereotypedBlocksMatch partialMatch)
Retrieve the set of values that occur in matches for block.
|
java.util.Set<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Slot> |
getAllValuesOfslot()
Retrieve the set of values that occur in matches for slot.
|
java.util.Set<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Slot> |
getAllValuesOfslot(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Class pBlock,
com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype pStereotype)
Retrieve the set of values that occur in matches for slot.
|
java.util.Set<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Slot> |
getAllValuesOfslot(TransformedStereotypedBlocksMatch partialMatch)
Retrieve the set of values that occur in matches for slot.
|
java.util.Set<com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype> |
getAllValuesOfstereotype()
Retrieve the set of values that occur in matches for stereotype.
|
java.util.Set<com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype> |
getAllValuesOfstereotype(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Class pBlock,
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Slot pSlot)
Retrieve the set of values that occur in matches for stereotype.
|
java.util.Set<com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype> |
getAllValuesOfstereotype(TransformedStereotypedBlocksMatch partialMatch)
Retrieve the set of values that occur in matches for stereotype.
|
TransformedStereotypedBlocksMatch |
getOneArbitraryMatch(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Class pBlock,
com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype pStereotype,
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Slot pSlot)
Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
|
boolean |
hasMatch(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Class pBlock,
com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype pStereotype,
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Slot pSlot)
Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
under any possible substitution of the unspecified parameters (if any).
|
TransformedStereotypedBlocksMatch |
newMatch(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Class pBlock,
com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype pStereotype,
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Slot pSlot)
Returns a new (partial) match.
|
static TransformedStereotypedBlocksMatcher |
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<TransformedStereotypedBlocksMatcher> |
querySpecification() |
protected java.util.Set<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Class> |
rawAccumulateAllValuesOfblock(java.lang.Object[] parameters)
Retrieve the set of values that occur in matches for block.
|
protected java.util.Set<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Slot> |
rawAccumulateAllValuesOfslot(java.lang.Object[] parameters)
Retrieve the set of values that occur in matches for slot.
|
protected java.util.Set<com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype> |
rawAccumulateAllValuesOfstereotype(java.lang.Object[] parameters)
Retrieve the set of values that occur in matches for stereotype.
|
protected TransformedStereotypedBlocksMatch |
tupleToMatch(org.eclipse.viatra.query.runtime.matchers.tuple.Tuple t) |
countMatches, countMatches, emptyArray, forEachMatch, forEachMatch, forOneArbitraryMatch, forOneArbitraryMatch, getAllMatches, getAllMatches, getAllValues, getAllValues, getCapabilities, getEngine, getOneArbitraryMatch, getOneArbitraryMatch, getParameterNames, getPatternName, getPositionOfParameter, getSpecification, hasMatch, hasMatch, matchToArray, newEmptyMatch, newMatch, rawAccumulateAllValues, rawCountMatches, rawForEachMatch, rawForOneArbitraryMatch, rawGetAllMatches, rawGetAllValues, rawGetOneArbitraryMatch, rawHasMatch, setBackend
public static TransformedStereotypedBlocksMatcher on(org.eclipse.viatra.query.runtime.api.ViatraQueryEngine engine)
engine
- the existing VIATRA Query engine in which this matcher will be created.ViatraQueryRuntimeException
- if an error occurs during pattern matcher creationpublic static TransformedStereotypedBlocksMatcher create()
ViatraQueryRuntimeException
- if an error occurs during pattern matcher creationpublic java.util.Collection<TransformedStereotypedBlocksMatch> getAllMatches(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Class pBlock, com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype pStereotype, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Slot pSlot)
pBlock
- the fixed value of pattern parameter block, or null if not bound.pStereotype
- the fixed value of pattern parameter stereotype, or null if not bound.pSlot
- the fixed value of pattern parameter slot, or null if not bound.public TransformedStereotypedBlocksMatch getOneArbitraryMatch(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Class pBlock, com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype pStereotype, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Slot pSlot)
pBlock
- the fixed value of pattern parameter block, or null if not bound.pStereotype
- the fixed value of pattern parameter stereotype, or null if not bound.pSlot
- the fixed value of pattern parameter slot, or null if not bound.public boolean hasMatch(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Class pBlock, com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype pStereotype, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Slot pSlot)
pBlock
- the fixed value of pattern parameter block, or null if not bound.pStereotype
- the fixed value of pattern parameter stereotype, or null if not bound.pSlot
- the fixed value of pattern parameter slot, or null if not bound.public int countMatches(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Class pBlock, com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype pStereotype, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Slot pSlot)
pBlock
- the fixed value of pattern parameter block, or null if not bound.pStereotype
- the fixed value of pattern parameter stereotype, or null if not bound.pSlot
- the fixed value of pattern parameter slot, or null if not bound.public void forEachMatch(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Class pBlock, com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype pStereotype, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Slot pSlot, org.eclipse.viatra.query.runtime.api.IMatchProcessor<? super TransformedStereotypedBlocksMatch> processor)
pBlock
- the fixed value of pattern parameter block, or null if not bound.pStereotype
- the fixed value of pattern parameter stereotype, or null if not bound.pSlot
- the fixed value of pattern parameter slot, or null if not bound.processor
- the action that will process each pattern match.public boolean forOneArbitraryMatch(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Class pBlock, com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype pStereotype, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Slot pSlot, org.eclipse.viatra.query.runtime.api.IMatchProcessor<? super TransformedStereotypedBlocksMatch> processor)
pBlock
- the fixed value of pattern parameter block, or null if not bound.pStereotype
- the fixed value of pattern parameter stereotype, or null if not bound.pSlot
- the fixed value of pattern parameter slot, or null if not bound.processor
- the action that will process the selected match.public TransformedStereotypedBlocksMatch newMatch(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Class pBlock, com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype pStereotype, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Slot pSlot)
The returned match will be immutable. Use BaseMatcher.newEmptyMatch()
to obtain a mutable match object.
pBlock
- the fixed value of pattern parameter block, or null if not bound.pStereotype
- the fixed value of pattern parameter stereotype, or null if not bound.pSlot
- the fixed value of pattern parameter slot, or null if not bound.protected java.util.Set<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Class> rawAccumulateAllValuesOfblock(java.lang.Object[] parameters)
public java.util.Set<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Class> getAllValuesOfblock()
public java.util.Set<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Class> getAllValuesOfblock(TransformedStereotypedBlocksMatch partialMatch)
public java.util.Set<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Class> getAllValuesOfblock(com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype pStereotype, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Slot pSlot)
protected java.util.Set<com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype> rawAccumulateAllValuesOfstereotype(java.lang.Object[] parameters)
public java.util.Set<com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype> getAllValuesOfstereotype()
public java.util.Set<com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype> getAllValuesOfstereotype(TransformedStereotypedBlocksMatch partialMatch)
public java.util.Set<com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype> getAllValuesOfstereotype(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Class pBlock, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Slot pSlot)
protected java.util.Set<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Slot> rawAccumulateAllValuesOfslot(java.lang.Object[] parameters)
public java.util.Set<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Slot> getAllValuesOfslot()
public java.util.Set<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Slot> getAllValuesOfslot(TransformedStereotypedBlocksMatch partialMatch)
public java.util.Set<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Slot> getAllValuesOfslot(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Class pBlock, com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype pStereotype)
protected TransformedStereotypedBlocksMatch tupleToMatch(org.eclipse.viatra.query.runtime.matchers.tuple.Tuple t)
tupleToMatch
in class org.eclipse.viatra.query.runtime.api.impl.BaseMatcher<TransformedStereotypedBlocksMatch>
protected TransformedStereotypedBlocksMatch arrayToMatch(java.lang.Object[] match)
arrayToMatch
in class org.eclipse.viatra.query.runtime.api.impl.BaseMatcher<TransformedStereotypedBlocksMatch>
protected TransformedStereotypedBlocksMatch arrayToMatchMutable(java.lang.Object[] match)
arrayToMatchMutable
in class org.eclipse.viatra.query.runtime.api.impl.BaseMatcher<TransformedStereotypedBlocksMatch>
public static org.eclipse.viatra.query.runtime.api.IQuerySpecification<TransformedStereotypedBlocksMatcher> querySpecification()
ViatraQueryRuntimeException
- if the pattern definition could not be loaded