public class PropertyAttributesMatcher extends org.eclipse.viatra.query.runtime.api.impl.BaseMatcher<PropertyAttributesMatch>
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 PropertyAttributesMatch
.
Original source:
Queries Properties with a given name and type
pattern propertyAttributes(property : Property, name : java String, type : Type) {
Property.name(property, name);
Property.type(property, type);
}
PropertyAttributesMatch
,
PropertyAttributesProcessor
,
PropertyAttributesQuerySpecification
Modifier and Type | Method and Description |
---|---|
protected PropertyAttributesMatch |
arrayToMatch(java.lang.Object[] match) |
protected PropertyAttributesMatch |
arrayToMatchMutable(java.lang.Object[] match) |
int |
countMatches(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Property pProperty,
java.lang.String pName,
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Type pType)
Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
|
static PropertyAttributesMatcher |
create() |
void |
forEachMatch(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Property pProperty,
java.lang.String pName,
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Type pType,
org.eclipse.viatra.query.runtime.api.IMatchProcessor<? super PropertyAttributesMatch> 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.Property pProperty,
java.lang.String pName,
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Type pType,
org.eclipse.viatra.query.runtime.api.IMatchProcessor<? super PropertyAttributesMatch> 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<PropertyAttributesMatch> |
getAllMatches(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Property pProperty,
java.lang.String pName,
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Type pType)
Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
|
java.util.Set<java.lang.String> |
getAllValuesOfname()
Retrieve the set of values that occur in matches for name.
|
java.util.Set<java.lang.String> |
getAllValuesOfname(PropertyAttributesMatch partialMatch)
Retrieve the set of values that occur in matches for name.
|
java.util.Set<java.lang.String> |
getAllValuesOfname(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Property pProperty,
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Type pType)
Retrieve the set of values that occur in matches for name.
|
java.util.Set<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Property> |
getAllValuesOfproperty()
Retrieve the set of values that occur in matches for property.
|
java.util.Set<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Property> |
getAllValuesOfproperty(PropertyAttributesMatch partialMatch)
Retrieve the set of values that occur in matches for property.
|
java.util.Set<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Property> |
getAllValuesOfproperty(java.lang.String pName,
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Type pType)
Retrieve the set of values that occur in matches for property.
|
java.util.Set<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Type> |
getAllValuesOftype()
Retrieve the set of values that occur in matches for type.
|
java.util.Set<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Type> |
getAllValuesOftype(PropertyAttributesMatch partialMatch)
Retrieve the set of values that occur in matches for type.
|
java.util.Set<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Type> |
getAllValuesOftype(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Property pProperty,
java.lang.String pName)
Retrieve the set of values that occur in matches for type.
|
PropertyAttributesMatch |
getOneArbitraryMatch(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Property pProperty,
java.lang.String pName,
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Type pType)
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.Property pProperty,
java.lang.String pName,
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Type pType)
Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
under any possible substitution of the unspecified parameters (if any).
|
PropertyAttributesMatch |
newMatch(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Property pProperty,
java.lang.String pName,
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Type pType)
Returns a new (partial) match.
|
static PropertyAttributesMatcher |
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<PropertyAttributesMatcher> |
querySpecification() |
protected java.util.Set<java.lang.String> |
rawAccumulateAllValuesOfname(java.lang.Object[] parameters)
Retrieve the set of values that occur in matches for name.
|
protected java.util.Set<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Property> |
rawAccumulateAllValuesOfproperty(java.lang.Object[] parameters)
Retrieve the set of values that occur in matches for property.
|
protected java.util.Set<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Type> |
rawAccumulateAllValuesOftype(java.lang.Object[] parameters)
Retrieve the set of values that occur in matches for type.
|
protected PropertyAttributesMatch |
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 PropertyAttributesMatcher 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 PropertyAttributesMatcher create()
ViatraQueryRuntimeException
- if an error occurs during pattern matcher creationpublic java.util.Collection<PropertyAttributesMatch> getAllMatches(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Property pProperty, java.lang.String pName, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Type pType)
pProperty
- the fixed value of pattern parameter property, or null if not bound.pName
- the fixed value of pattern parameter name, or null if not bound.pType
- the fixed value of pattern parameter type, or null if not bound.public PropertyAttributesMatch getOneArbitraryMatch(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Property pProperty, java.lang.String pName, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Type pType)
pProperty
- the fixed value of pattern parameter property, or null if not bound.pName
- the fixed value of pattern parameter name, or null if not bound.pType
- the fixed value of pattern parameter type, or null if not bound.public boolean hasMatch(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Property pProperty, java.lang.String pName, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Type pType)
pProperty
- the fixed value of pattern parameter property, or null if not bound.pName
- the fixed value of pattern parameter name, or null if not bound.pType
- the fixed value of pattern parameter type, or null if not bound.public int countMatches(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Property pProperty, java.lang.String pName, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Type pType)
pProperty
- the fixed value of pattern parameter property, or null if not bound.pName
- the fixed value of pattern parameter name, or null if not bound.pType
- the fixed value of pattern parameter type, or null if not bound.public void forEachMatch(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Property pProperty, java.lang.String pName, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Type pType, org.eclipse.viatra.query.runtime.api.IMatchProcessor<? super PropertyAttributesMatch> processor)
pProperty
- the fixed value of pattern parameter property, or null if not bound.pName
- the fixed value of pattern parameter name, or null if not bound.pType
- the fixed value of pattern parameter type, or null if not bound.processor
- the action that will process each pattern match.public boolean forOneArbitraryMatch(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Property pProperty, java.lang.String pName, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Type pType, org.eclipse.viatra.query.runtime.api.IMatchProcessor<? super PropertyAttributesMatch> processor)
pProperty
- the fixed value of pattern parameter property, or null if not bound.pName
- the fixed value of pattern parameter name, or null if not bound.pType
- the fixed value of pattern parameter type, or null if not bound.processor
- the action that will process the selected match.public PropertyAttributesMatch newMatch(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Property pProperty, java.lang.String pName, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Type pType)
The returned match will be immutable. Use BaseMatcher.newEmptyMatch()
to obtain a mutable match object.
pProperty
- the fixed value of pattern parameter property, or null if not bound.pName
- the fixed value of pattern parameter name, or null if not bound.pType
- the fixed value of pattern parameter type, or null if not bound.protected java.util.Set<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Property> rawAccumulateAllValuesOfproperty(java.lang.Object[] parameters)
public java.util.Set<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Property> getAllValuesOfproperty()
public java.util.Set<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Property> getAllValuesOfproperty(PropertyAttributesMatch partialMatch)
public java.util.Set<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Property> getAllValuesOfproperty(java.lang.String pName, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Type pType)
protected java.util.Set<java.lang.String> rawAccumulateAllValuesOfname(java.lang.Object[] parameters)
public java.util.Set<java.lang.String> getAllValuesOfname()
public java.util.Set<java.lang.String> getAllValuesOfname(PropertyAttributesMatch partialMatch)
public java.util.Set<java.lang.String> getAllValuesOfname(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Property pProperty, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Type pType)
protected java.util.Set<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Type> rawAccumulateAllValuesOftype(java.lang.Object[] parameters)
public java.util.Set<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Type> getAllValuesOftype()
public java.util.Set<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Type> getAllValuesOftype(PropertyAttributesMatch partialMatch)
public java.util.Set<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Type> getAllValuesOftype(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Property pProperty, java.lang.String pName)
protected PropertyAttributesMatch tupleToMatch(org.eclipse.viatra.query.runtime.matchers.tuple.Tuple t)
tupleToMatch
in class org.eclipse.viatra.query.runtime.api.impl.BaseMatcher<PropertyAttributesMatch>
protected PropertyAttributesMatch arrayToMatch(java.lang.Object[] match)
arrayToMatch
in class org.eclipse.viatra.query.runtime.api.impl.BaseMatcher<PropertyAttributesMatch>
protected PropertyAttributesMatch arrayToMatchMutable(java.lang.Object[] match)
arrayToMatchMutable
in class org.eclipse.viatra.query.runtime.api.impl.BaseMatcher<PropertyAttributesMatch>
public static org.eclipse.viatra.query.runtime.api.IQuerySpecification<PropertyAttributesMatcher> querySpecification()
ViatraQueryRuntimeException
- if the pattern definition could not be loaded