Class RuleImpl
- java.lang.Object
-
- org.eclipse.emf.common.notify.impl.BasicNotifierImpl
-
- org.eclipse.emf.ecore.impl.BasicEObjectImpl
-
- org.eclipse.emf.ecore.impl.EObjectImpl
-
- org.eclipse.m2m.atl.emftvm.impl.NamedElementImpl
-
- org.eclipse.m2m.atl.emftvm.impl.RuleImpl
-
- All Implemented Interfaces:
org.eclipse.emf.common.notify.Notifier,org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.InternalEObject,NamedElement,Rule
public class RuleImpl extends NamedElementImpl implements Rule
An implementation of the model object 'Rule'.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classRuleImpl.AbstractStateBase class for code that depends on the rule'sRule.isAbstract()state.protected classRuleImpl.ApplierCbStateBase class for code that depends on whether the rule has aRule.getApplier()code block and/or aRule.getPostApply()code block.protected classRuleImpl.AutomaticRecursiveStateRuleImpl.RuleModeStateclass for rules with modeRuleMode.AUTOMATIC_RECURSIVE.protected classRuleImpl.AutomaticSingleStateRuleImpl.RuleModeStateclass for rules with modeRuleMode.AUTOMATIC_SINGLE.protected classRuleImpl.DefaultOffStateprotected classRuleImpl.DefaultOnStateprotected classRuleImpl.DefaultStateBase class for code that depends on the state ofRule.isDefault().protected classRuleImpl.DistinctStateBase class for code that depends on the rule'sRule.isDistinctElements()state.protected classRuleImpl.IsAbstractStateprotected classRuleImpl.IsDistinctStateprotected classRuleImpl.IsLeafStateprotected classRuleImpl.IsNotAbstractStateprotected classRuleImpl.IsNotDistinctStateprotected classRuleImpl.IsOtherLeafStateRuleImpl.LeafStateclass for rules for whichRule.isLeaf()isfalseandRule.isWithLeaves()is alsofalse.protected classRuleImpl.IsWithLeavesStateRuleImpl.LeafStateclass for rules for whichRule.isLeaf()isfalseandRule.isWithLeaves()istrue.protected classRuleImpl.LeafStateBase class for code that depends on the rule'sRule.isAbstract()andRule.getESubRules().protected classRuleImpl.ManualStateRuleImpl.RuleModeStateclass for rules with modeRuleMode.MANUAL.protected classRuleImpl.MatcherCbStateBase class for code that depends on whether the rule has aRule.getMatcher()code block.protected classRuleImpl.RuleModeStateBase class for code that depends on the rule'sRule.getMode().protected classRuleImpl.SuperRulesStateBase class for code that depends on whether the rule has anyRule.getESuperRules().protected classRuleImpl.UniqueOffStateprotected classRuleImpl.UniqueOnStateprotected classRuleImpl.UniqueStateBase class for code that depends on the state ofRule.isUnique().protected classRuleImpl.WithApplierWithoutPostApplyCbStateRuleImpl.ApplierCbStateclass for rules that have aRule.getApplier()code block and noRule.getPostApply()code block.protected classRuleImpl.WithApplierWithPostApplyCbStateRuleImpl.ApplierCbStateclass for rules that have aRule.getApplier()code block as well as aRule.getPostApply()code block.protected classRuleImpl.WithMatcherCbStateRuleImpl.MatcherCbStateclass for rules that have aRule.getMatcher()code block.protected classRuleImpl.WithoutApplierWithoutPostApplyCbStateRuleImpl.ApplierCbStateclass for rules that do not have aRule.getApplier()code block or aRule.getPostApply()code block.protected classRuleImpl.WithoutApplierWithPostApplyCbStateRuleImpl.ApplierCbStateclass for rules that do not have aRule.getApplier()code block and do have aRule.getPostApply()code block.protected classRuleImpl.WithoutMatcherCbStateRuleImpl.MatcherCbStateclass for rules that do not have aRule.getMatcher()code block.protected classRuleImpl.WithoutSuperRulesStateRuleImpl.SuperRulesStateclass for rules without anyRule.getESuperRules().protected classRuleImpl.WithSuperRulesStateRuleImpl.SuperRulesStateclass for rules withRule.getESuperRules().-
Nested classes/interfaces inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl
org.eclipse.emf.ecore.impl.BasicEObjectImpl.EPropertiesHolder, org.eclipse.emf.ecore.impl.BasicEObjectImpl.EPropertiesHolderBaseImpl, org.eclipse.emf.ecore.impl.BasicEObjectImpl.EPropertiesHolderImpl
-
Nested classes/interfaces inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl
org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EAdapterList<E extends java.lang.Object & org.eclipse.emf.common.notify.Adapter>, org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EObservableAdapterList, org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EScannableAdapterList
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanabstract_The cached value of the 'Abstract' attribute.protected static booleanABSTRACT_EDEFAULTThe default value of the 'Abstract' attribute.protected RuleImpl.AbstractStateabstractStateThe rule'sisAbstract()state object.protected LazySet<Rule>allESuperRulesThe cached transitive closure of super-rules.protected CodeBlockapplierThe cached value of the 'Applier' containment reference.protected RuleImpl.ApplierCbStateapplierCbStateThe rule'sgetApplier()state object.protected java.util.Map<TraceLink,java.lang.Object[]>applyArgsThe cached arguments for the applier and post-applier code block for a given trace.protected booleandefault_The cached value of the 'Default' attribute.protected static booleanDEFAULT_EDEFAULTThe default value of the 'Default' attribute.protected RuleImpl.DefaultStatedefaultStateThe rule'sisDefault()state object.protected static booleanDISTINCT_ELEMENTS_EDEFAULTThe default value of the 'Distinct Elements' attribute.protected booleandistinctElementsThe cached value of the 'Distinct Elements' attribute.protected RuleImpl.DistinctStatedistinctStateThe rule'sisDistinctElements()state object.protected org.eclipse.emf.common.util.EList<Rule>eSubRulesThe cached value of the 'ESub Rules' reference list.protected org.eclipse.emf.common.util.EList<Rule>eSuperRulesThe cached value of the 'ESuper Rules' reference list.protected FieldContainerfieldContainerField storage and lookup.protected org.eclipse.emf.common.util.EList<Field>fieldsThe cached value of the 'Fields' containment reference list.protected org.eclipse.emf.common.util.EList<InputRuleElement>inputElementsThe cached value of the 'Input Elements' containment reference list.protected java.util.List<java.lang.Iterable<org.eclipse.emf.ecore.EObject>>iterableListPre-compiled list of iterables for each input rule element.protected java.util.Map<java.lang.String,java.lang.Iterable<org.eclipse.emf.ecore.EObject>>iterableMapPre-compiled map of iterables for each input rule element.protected booleanleafThe cached value of the 'Leaf' attribute.protected static booleanLEAF_EDEFAULTThe default value of the 'Leaf' attribute.protected RuleImpl.LeafStateleafStateThe rule'sisLeaf()/isWithLeaves()state object.protected CodeBlockmatcherThe cached value of the 'Matcher' containment reference.protected RuleImpl.MatcherCbStatematcherCbStateThe rule'sgetMatcher()state object.protected RuleModemodeThe cached value of the 'Mode' attribute.protected static RuleModeMODE_EDEFAULTThe default value of the 'Mode' attribute.protected org.eclipse.emf.common.util.EList<OutputRuleElement>outputElementsThe cached value of the 'Output Elements' containment reference list.protected CodeBlockpostApplyThe cached value of the 'Post Apply' containment reference.protected RuleImpl.RuleModeStateruleModeStateThe rule'sgetMode()state object.protected org.eclipse.emf.common.util.EList<java.lang.String>superRulesThe cached value of the 'Super Rules' attribute list.protected RuleImpl.SuperRulesStatesuperRulesStateThe rule'sgetESuperRules().isEmpty() state object.protected booleanuniqueThe cached value of the 'Unique' attribute.protected static booleanUNIQUE_EDEFAULTThe default value of the 'Unique' attribute.protected RuleImpl.UniqueStateuniqueStateThe rule'sisUnique()state object.protected static booleanWITH_LEAVES_EDEFAULTThe default value of the 'With Leaves' attribute.protected booleanwithLeavesThe cached value of the 'With Leaves' attribute.-
Fields inherited from class org.eclipse.m2m.atl.emftvm.impl.NamedElementImpl
name, NAME_EDEFAULT
-
Fields inherited from class org.eclipse.emf.ecore.impl.EObjectImpl
eAdapters, eContainer, eContainerFeatureID, EDELIVER, EDYNAMIC_CLASS, eFlags, ELAST_EOBJECT_FLAG, ELAST_NOTIFIER_FLAG, eProperties, EPROXY
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapply(StackFrame frame)Applies this rule for the created traces.booleanapplyFirst(StackFrame frame)Applies and post-applies this rule for the first recorded match.java.lang.ObjectapplyFor(StackFrame frame, TraceLink trace)Applies this rule for the giventrace.java.lang.ObjectapplyOne(StackFrame frame, java.util.Map<java.lang.String,java.lang.Object> valuesMap)Applies this rule totraceorg.eclipse.emf.common.notify.NotificationChainbasicSetApplier(CodeBlock newApplier, org.eclipse.emf.common.notify.NotificationChain msgs)org.eclipse.emf.common.notify.NotificationChainbasicSetMatcher(CodeBlock newMatcher, org.eclipse.emf.common.notify.NotificationChain msgs)org.eclipse.emf.common.notify.NotificationChainbasicSetModule(Module newModule, org.eclipse.emf.common.notify.NotificationChain msgs)org.eclipse.emf.common.notify.NotificationChainbasicSetPostApply(CodeBlock newPostApply, org.eclipse.emf.common.notify.NotificationChain msgs)voidclearFields()Clears the values of all registered fields within this rule.voidcompileIterables(ExecEnv env)Compiles the model element iterables for this rule.voidcompileState(ExecEnv env)Compiles the internal state of this rule for optimised matching.booleancompleteTraceFor(StackFrame frame, TraceLink trace)Completestracefor this rule by creating the output elements.voidcreateTraces(StackFrame frame)Creates trace elements for the recorded matches for this rule.voidcreateUniqueMapping(TraceLink trace)Creates a unique trace mapping entry for the source values intrace, if applicable.org.eclipse.emf.common.notify.NotificationChaineBasicRemoveFromContainerFeature(org.eclipse.emf.common.notify.NotificationChain msgs)java.lang.ObjecteGet(int featureID, boolean resolve, boolean coreType)org.eclipse.emf.common.notify.NotificationChaineInverseAdd(org.eclipse.emf.ecore.InternalEObject otherEnd, int featureID, org.eclipse.emf.common.notify.NotificationChain msgs)org.eclipse.emf.common.notify.NotificationChaineInverseRemove(org.eclipse.emf.ecore.InternalEObject otherEnd, int featureID, org.eclipse.emf.common.notify.NotificationChain msgs)booleaneIsSet(int featureID)voideSet(int featureID, java.lang.Object newValue)protected org.eclipse.emf.ecore.EClasseStaticClass()Returns theEClassthat correspond to this metaclass.voideUnset(int featureID)FieldfindField(java.lang.Object context, java.lang.String name)InputRuleElementfindInputElement(java.lang.String name)Finds theInputRuleElementwith the given name within the rule inheritance hierarchy depth-first.FieldfindStaticField(java.lang.Object context, java.lang.String name)LazySet<Rule>getAllESuperRules()Returns the transitive closure of super-rules, root rule first (LazySet's have a fixed iteration order).CodeBlockgetApplier()Returns the value of the 'Applier' containment reference.org.eclipse.emf.common.util.EList<Rule>getESubRules()Returns the value of the 'ESub Rules' reference list.org.eclipse.emf.common.util.EList<Rule>getESuperRules()Returns the value of the 'ESuper Rules' reference list.org.eclipse.emf.common.util.EList<Field>getFields()Returns the value of the 'Fields' containment reference list.org.eclipse.emf.common.util.EList<InputRuleElement>getInputElements()Returns the value of the 'Input Elements' containment reference list.CodeBlockgetMatcher()Returns the value of the 'Matcher' containment reference.RuleModegetMode()Returns the value of the 'Mode' attribute.ModulegetModule()Returns the value of the 'Module' container reference.org.eclipse.emf.common.util.EList<OutputRuleElement>getOutputElements()Returns the value of the 'Output Elements' containment reference list.CodeBlockgetPostApply()Returns the value of the 'Post Apply' containment reference.org.eclipse.emf.common.util.EList<java.lang.String>getSuperRules()Returns the value of the 'Super Rules' attribute list.TraceLinkgetUniqueTrace(StackFrame frame, java.lang.Object[] values)Returns the unique rule application trace forvalues, if applicable.booleanhasField(java.lang.String name)Returnstrueiff this rule has any registered fields with the givenname.booleanhasStaticField(java.lang.String name)Returnstrueiff this rule has any registered static fields with the givenname.booleanisAbstract()Returns the value of the 'Abstract' attribute.booleanisDefault()Returns the value of the 'Default' attribute.booleanisDistinctElements()Returns the value of the 'Distinct Elements' attribute.booleanisLeaf()Returns the value of the 'Leaf' attribute.booleanisUnique()Returns the value of the 'Unique' attribute.booleanisWithLeaves()Returns the value of the 'With Leaves' attribute.java.lang.ObjectmatchManual(StackFrame frame, java.lang.Object[] values)Matches this rule manually, if applicable.booleanmatchOne(StackFrame frame, java.util.Map<java.lang.String,java.lang.Object> valuesMap)Matches rule forvaluesMap.booleanmatchOneOnly(StackFrame frame, java.util.Map<java.lang.String,java.lang.Object> valuesMap)Matches this rule only (without super-rules) forvaluesMap.boolean[]matchRecursive(StackFrame frame)Matches this rule for the automatic recursive stage, if applicable.booleanmatchSingle(StackFrame frame)Matches this rule for the automatic single stage, if applicable.voidpostApply(StackFrame frame)Runs post-applier for this rule for the created traces.java.lang.ObjectpostApplyFor(StackFrame frame, TraceLink trace)Post-applies this rule for the giventrace.voidregisterField(Field field)voidresetState()Resets the internal state of this rule.voidsetAbstract(boolean newAbstract)Sets the value of the 'Abstract' attribute.voidsetApplier(CodeBlock newApplier)Sets the value of the 'Applier' containment reference.voidsetDefault(boolean newDefault)Sets the value of the 'Default' attribute.voidsetDistinctElements(boolean newDistinctElements)Sets the value of the 'Distinct Elements' attribute.voidsetMatcher(CodeBlock newMatcher)Sets the value of the 'Matcher' containment reference.voidsetMode(RuleMode newMode)Sets the value of the 'Mode' attribute.voidsetModule(Module newModule)Sets the value of the 'Module' container reference.voidsetPostApply(CodeBlock newPostApply)Sets the value of the 'Post Apply' containment reference.voidsetUnique(boolean newUnique)Sets the value of the 'Unique' attribute.java.lang.StringtoString()protected voidupdateAbstractState()UpdatesabstractState.protected voidupdateApplierCbState()UpdatesapplierCbState.protected voidupdateDefaultState()UpdatesdefaultState.protected voidupdateDistinctState()UpdatesdistinctState.protected voidupdateLeafState()UpdatesleafState.protected voidupdateMatcherCbState()UpdatesmatcherCbState.protected voidupdateRuleModeState()UpdatesruleModeState.protected voidupdateSuperRulesState()UpdatessuperRulesState.protected voidupdateUniqueState()UpdatesuniqueState.-
Methods inherited from class org.eclipse.m2m.atl.emftvm.impl.NamedElementImpl
getName, setName
-
Methods inherited from class org.eclipse.emf.ecore.impl.EObjectImpl
eAdapters, eBasicAdapters, eBasicProperties, eBasicSetContainer, eClass, eContainerFeatureID, eDeliver, eInternalContainer, eInvoke, eIsProxy, eProperties, eSetClass, eSetDeliver, eSetProxyURI
-
Methods inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl
eAddVirtualValue, eAllContents, eBaseStructuralFeatureID, eBasicRemoveFromContainer, eBasicSetContainer, eComputeVirtualValuesCapacity, eContainer, eContainerAdapterArray, eContainingFeature, eContainmentFeature, eContainmentFeature, eContains, eContents, eCrossReferences, eDerivedOperationID, eDerivedOperationID, eDerivedStructuralFeatureID, eDerivedStructuralFeatureID, eDirectResource, eDynamicBasicRemoveFromContainer, eDynamicClass, eDynamicFeature, eDynamicFeatureID, eDynamicGet, eDynamicGet, eDynamicGet, eDynamicInverseAdd, eDynamicInverseAdd, eDynamicInverseRemove, eDynamicInverseRemove, eDynamicInvoke, eDynamicInvoke, eDynamicIsSet, eDynamicIsSet, eDynamicIsSet, eDynamicSet, eDynamicSet, eDynamicSet, eDynamicUnset, eDynamicUnset, eDynamicUnset, eGet, eGet, eGet, eHasSettings, eInternalResource, eInverseAdd, eInverseRemove, eInvocationDelegate, eInvoke, eIsSet, eObjectForURIFragmentSegment, eOpenGet, eOpenIsSet, eOpenSet, eOpenUnset, eProxyURI, eRemoveVirtualValue, eResolveProxy, eResource, eSet, eSetDirectResource, eSetResource, eSetStore, eSetting, eSettingDelegate, eSettings, eSetVirtualIndexBits, eSetVirtualValue, eSetVirtualValues, eStaticFeatureCount, eStaticOperationCount, eStore, eUnset, eURIFragmentSegment, eVirtualBitCount, eVirtualGet, eVirtualGet, eVirtualIndex, eVirtualIndexBits, eVirtualIsSet, eVirtualSet, eVirtualUnset, eVirtualValue, eVirtualValues
-
Methods inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl
eBasicAdapterArray, eBasicHasAdapters, eNotificationRequired, eNotify
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.emf.ecore.EObject
eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eInvoke, eIsProxy, eIsSet, eResource, eSet, eUnset
-
Methods inherited from interface org.eclipse.m2m.atl.emftvm.NamedElement
getName, setName
-
-
-
-
Field Detail
-
MODE_EDEFAULT
protected static final RuleMode MODE_EDEFAULT
The default value of the 'Mode' attribute.- See Also:
getMode()
-
inputElements
protected org.eclipse.emf.common.util.EList<InputRuleElement> inputElements
The cached value of the 'Input Elements' containment reference list.- See Also:
getInputElements()
-
outputElements
protected org.eclipse.emf.common.util.EList<OutputRuleElement> outputElements
The cached value of the 'Output Elements' containment reference list.- See Also:
getOutputElements()
-
eSuperRules
protected org.eclipse.emf.common.util.EList<Rule> eSuperRules
The cached value of the 'ESuper Rules' reference list.- See Also:
getESuperRules()
-
eSubRules
protected org.eclipse.emf.common.util.EList<Rule> eSubRules
The cached value of the 'ESub Rules' reference list.- See Also:
getESubRules()
-
matcher
protected CodeBlock matcher
The cached value of the 'Matcher' containment reference.- See Also:
getMatcher()
-
applier
protected CodeBlock applier
The cached value of the 'Applier' containment reference.- See Also:
getApplier()
-
postApply
protected CodeBlock postApply
The cached value of the 'Post Apply' containment reference.- See Also:
getPostApply()
-
superRules
protected org.eclipse.emf.common.util.EList<java.lang.String> superRules
The cached value of the 'Super Rules' attribute list.- See Also:
getSuperRules()
-
ABSTRACT_EDEFAULT
protected static final boolean ABSTRACT_EDEFAULT
The default value of the 'Abstract' attribute.- See Also:
isAbstract(), Constant Field Values
-
abstract_
protected boolean abstract_
The cached value of the 'Abstract' attribute.- See Also:
isAbstract()
-
fields
protected org.eclipse.emf.common.util.EList<Field> fields
The cached value of the 'Fields' containment reference list.- See Also:
getFields()
-
DEFAULT_EDEFAULT
protected static final boolean DEFAULT_EDEFAULT
The default value of the 'Default' attribute.- See Also:
isDefault(), Constant Field Values
-
default_
protected boolean default_
The cached value of the 'Default' attribute.- See Also:
isDefault()
-
DISTINCT_ELEMENTS_EDEFAULT
protected static final boolean DISTINCT_ELEMENTS_EDEFAULT
The default value of the 'Distinct Elements' attribute.- See Also:
isDistinctElements(), Constant Field Values
-
distinctElements
protected boolean distinctElements
The cached value of the 'Distinct Elements' attribute.- See Also:
isDistinctElements()
-
UNIQUE_EDEFAULT
protected static final boolean UNIQUE_EDEFAULT
The default value of the 'Unique' attribute.- See Also:
isUnique(), Constant Field Values
-
unique
protected boolean unique
The cached value of the 'Unique' attribute.- See Also:
isUnique()
-
LEAF_EDEFAULT
protected static final boolean LEAF_EDEFAULT
The default value of the 'Leaf' attribute.- See Also:
isLeaf(), Constant Field Values
-
WITH_LEAVES_EDEFAULT
protected static final boolean WITH_LEAVES_EDEFAULT
The default value of the 'With Leaves' attribute.- See Also:
isWithLeaves(), Constant Field Values
-
withLeaves
protected boolean withLeaves
The cached value of the 'With Leaves' attribute.- See Also:
isWithLeaves()
-
fieldContainer
protected FieldContainer fieldContainer
Field storage and lookup.
-
uniqueState
protected RuleImpl.UniqueState uniqueState
The rule'sisUnique()state object.
-
defaultState
protected RuleImpl.DefaultState defaultState
The rule'sisDefault()state object.
-
superRulesState
protected RuleImpl.SuperRulesState superRulesState
The rule'sgetESuperRules().isEmpty() state object.
-
ruleModeState
protected RuleImpl.RuleModeState ruleModeState
The rule'sgetMode()state object.
-
leafState
protected RuleImpl.LeafState leafState
The rule'sisLeaf()/isWithLeaves()state object.
-
abstractState
protected RuleImpl.AbstractState abstractState
The rule'sisAbstract()state object.
-
matcherCbState
protected RuleImpl.MatcherCbState matcherCbState
The rule'sgetMatcher()state object.
-
applierCbState
protected RuleImpl.ApplierCbState applierCbState
The rule'sgetApplier()state object.
-
distinctState
protected RuleImpl.DistinctState distinctState
The rule'sisDistinctElements()state object.
-
applyArgs
protected final java.util.Map<TraceLink,java.lang.Object[]> applyArgs
The cached arguments for the applier and post-applier code block for a given trace.
-
iterableList
protected java.util.List<java.lang.Iterable<org.eclipse.emf.ecore.EObject>> iterableList
Pre-compiled list of iterables for each input rule element.
-
iterableMap
protected java.util.Map<java.lang.String,java.lang.Iterable<org.eclipse.emf.ecore.EObject>> iterableMap
Pre-compiled map of iterables for each input rule element.
-
-
Constructor Detail
-
RuleImpl
protected RuleImpl()
Creates a newRuleImpl.
-
-
Method Detail
-
eStaticClass
protected org.eclipse.emf.ecore.EClass eStaticClass()
Returns theEClassthat correspond to this metaclass.- Overrides:
eStaticClassin classNamedElementImpl- Returns:
- the
EClassthat correspond to this metaclass.
-
getModule
public Module getModule()
Returns the value of the 'Module' container reference. It is bidirectional and its opposite is 'Rules'.If the meaning of the 'Module' container reference isn't clear, there really should be more of a description here...
- Specified by:
getModulein interfaceRule- Returns:
- the value of the 'Module' container reference.
- See Also:
Rule.setModule(Module),EmftvmPackage.getRule_Module(),Module.getRules()
-
basicSetModule
public org.eclipse.emf.common.notify.NotificationChain basicSetModule(Module newModule, org.eclipse.emf.common.notify.NotificationChain msgs)
- See Also:
setModule(Module)
-
setModule
public void setModule(Module newModule)
Sets the value of the 'Module' container reference.- Specified by:
setModulein interfaceRule- Parameters:
newModule- the new value of the 'Module' container reference.- See Also:
Rule.getModule()
-
getMode
public RuleMode getMode()
Returns the value of the 'Mode' attribute. The literals are from the enumerationRuleMode.If the meaning of the 'Mode' attribute isn't clear, there really should be more of a description here...
- Specified by:
getModein interfaceRule- Returns:
- the value of the 'Mode' attribute.
- See Also:
RuleMode,Rule.setMode(RuleMode),EmftvmPackage.getRule_Mode()
-
setMode
public void setMode(RuleMode newMode)
Sets the value of the 'Mode' attribute.- Specified by:
setModein interfaceRule- Parameters:
newMode- the new value of the 'Mode' attribute.- See Also:
RuleMode,Rule.getMode()
-
getInputElements
public org.eclipse.emf.common.util.EList<InputRuleElement> getInputElements()
Returns the value of the 'Input Elements' containment reference list. The list contents are of typeInputRuleElement. It is bidirectional and its opposite is 'Input For'.If the meaning of the 'Input Elements' containment reference list isn't clear, there really should be more of a description here...
- Specified by:
getInputElementsin interfaceRule- Returns:
- the value of the 'Input Elements' containment reference list.
- See Also:
EmftvmPackage.getRule_InputElements(),InputRuleElement.getInputFor()
-
getOutputElements
public org.eclipse.emf.common.util.EList<OutputRuleElement> getOutputElements()
Returns the value of the 'Output Elements' containment reference list. The list contents are of typeOutputRuleElement. It is bidirectional and its opposite is 'Output For'.If the meaning of the 'Output Elements' containment reference list isn't clear, there really should be more of a description here...
- Specified by:
getOutputElementsin interfaceRule- Returns:
- the value of the 'Output Elements' containment reference list.
- See Also:
EmftvmPackage.getRule_OutputElements(),OutputRuleElement.getOutputFor()
-
getESuperRules
public org.eclipse.emf.common.util.EList<Rule> getESuperRules()
Returns the value of the 'ESuper Rules' reference list. The list contents are of typeRule. It is bidirectional and its opposite is 'ESub Rules'.If the meaning of the 'ESuper Rules' reference list isn't clear, there really should be more of a description here...
- Specified by:
getESuperRulesin interfaceRule- Returns:
- the value of the 'ESuper Rules' reference list.
- See Also:
EmftvmPackage.getRule_ESuperRules(),Rule.getESubRules()
-
getESubRules
public org.eclipse.emf.common.util.EList<Rule> getESubRules()
Returns the value of the 'ESub Rules' reference list. The list contents are of typeRule. It is bidirectional and its opposite is 'ESuper Rules'.If the meaning of the 'ESub Rules' reference list isn't clear, there really should be more of a description here...
- Specified by:
getESubRulesin interfaceRule- Returns:
- the value of the 'ESub Rules' reference list.
- See Also:
EmftvmPackage.getRule_ESubRules(),Rule.getESuperRules()
-
getMatcher
public CodeBlock getMatcher()
Returns the value of the 'Matcher' containment reference. It is bidirectional and its opposite is 'Matcher For'.If the meaning of the 'Matcher' containment reference isn't clear, there really should be more of a description here...
- Specified by:
getMatcherin interfaceRule- Returns:
- the value of the 'Matcher' containment reference.
- See Also:
Rule.setMatcher(CodeBlock),EmftvmPackage.getRule_Matcher(),CodeBlock.getMatcherFor()
-
basicSetMatcher
public org.eclipse.emf.common.notify.NotificationChain basicSetMatcher(CodeBlock newMatcher, org.eclipse.emf.common.notify.NotificationChain msgs)
- See Also:
setMatcher(CodeBlock)
-
setMatcher
public void setMatcher(CodeBlock newMatcher)
Sets the value of the 'Matcher' containment reference.- Specified by:
setMatcherin interfaceRule- Parameters:
newMatcher- the new value of the 'Matcher' containment reference.- See Also:
Rule.getMatcher()
-
getApplier
public CodeBlock getApplier()
Returns the value of the 'Applier' containment reference. It is bidirectional and its opposite is 'Applier For'.If the meaning of the 'Applier' containment reference isn't clear, there really should be more of a description here...
- Specified by:
getApplierin interfaceRule- Returns:
- the value of the 'Applier' containment reference.
- See Also:
Rule.setApplier(CodeBlock),EmftvmPackage.getRule_Applier(),CodeBlock.getApplierFor()
-
basicSetApplier
public org.eclipse.emf.common.notify.NotificationChain basicSetApplier(CodeBlock newApplier, org.eclipse.emf.common.notify.NotificationChain msgs)
- See Also:
setApplier(CodeBlock)
-
setApplier
public void setApplier(CodeBlock newApplier)
Sets the value of the 'Applier' containment reference.- Specified by:
setApplierin interfaceRule- Parameters:
newApplier- the new value of the 'Applier' containment reference.- See Also:
Rule.getApplier()
-
getPostApply
public CodeBlock getPostApply()
Returns the value of the 'Post Apply' containment reference. It is bidirectional and its opposite is 'Post Apply For'.If the meaning of the 'Post Apply' containment reference isn't clear, there really should be more of a description here...
- Specified by:
getPostApplyin interfaceRule- Returns:
- the value of the 'Post Apply' containment reference.
- See Also:
Rule.setPostApply(CodeBlock),EmftvmPackage.getRule_PostApply(),CodeBlock.getPostApplyFor()
-
basicSetPostApply
public org.eclipse.emf.common.notify.NotificationChain basicSetPostApply(CodeBlock newPostApply, org.eclipse.emf.common.notify.NotificationChain msgs)
- See Also:
setPostApply(CodeBlock)
-
setPostApply
public void setPostApply(CodeBlock newPostApply)
Sets the value of the 'Post Apply' containment reference.- Specified by:
setPostApplyin interfaceRule- Parameters:
newPostApply- the new value of the 'Post Apply' containment reference.- See Also:
Rule.getPostApply()
-
getSuperRules
public org.eclipse.emf.common.util.EList<java.lang.String> getSuperRules()
Returns the value of the 'Super Rules' attribute list. The list contents are of typeString.If the meaning of the 'Super Rules' reference list isn't clear, there really should be more of a description here...
- Specified by:
getSuperRulesin interfaceRule- Returns:
- the value of the 'Super Rules' attribute list.
- See Also:
EmftvmPackage.getRule_SuperRules()
-
isAbstract
public boolean isAbstract()
Returns the value of the 'Abstract' attribute.If the meaning of the 'Abstract' attribute isn't clear, there really should be more of a description here...
- Specified by:
isAbstractin interfaceRule- Returns:
- the value of the 'Abstract' attribute.
- See Also:
Rule.setAbstract(boolean),EmftvmPackage.getRule_Abstract()
-
setAbstract
public void setAbstract(boolean newAbstract)
Sets the value of the 'Abstract' attribute.- Specified by:
setAbstractin interfaceRule- Parameters:
newAbstract- the new value of the 'Abstract' attribute.- See Also:
Rule.isAbstract()
-
getFields
public org.eclipse.emf.common.util.EList<Field> getFields()
Returns the value of the 'Fields' containment reference list. The list contents are of typeField. It is bidirectional and its opposite is 'Rule'.If the meaning of the 'Fields' containment reference list isn't clear, there really should be more of a description here...
- Specified by:
getFieldsin interfaceRule- Returns:
- the value of the 'Fields' containment reference list.
- See Also:
EmftvmPackage.getRule_Fields(),Field.getRule()
-
isDefault
public boolean isDefault()
Returns the value of the 'Default' attribute.If the meaning of the 'Default' attribute isn't clear, there really should be more of a description here...
- Specified by:
isDefaultin interfaceRule- Returns:
- the value of the 'Default' attribute.
- See Also:
Rule.setDefault(boolean),EmftvmPackage.getRule_Default()
-
setDefault
public void setDefault(boolean newDefault)
Sets the value of the 'Default' attribute.- Specified by:
setDefaultin interfaceRule- Parameters:
newDefault- the new value of the 'Default' attribute.- See Also:
Rule.isDefault()
-
isDistinctElements
public boolean isDistinctElements()
Returns the value of the 'Distinct Elements' attribute.If the meaning of the 'Distinct Elements' attribute isn't clear, there really should be more of a description here...
- Specified by:
isDistinctElementsin interfaceRule- Returns:
- the value of the 'Distinct Elements' attribute.
- See Also:
Rule.setDistinctElements(boolean),EmftvmPackage.getRule_DistinctElements()
-
setDistinctElements
public void setDistinctElements(boolean newDistinctElements)
Sets the value of the 'Distinct Elements' attribute.- Specified by:
setDistinctElementsin interfaceRule- Parameters:
newDistinctElements- the new value of the 'Distinct Elements' attribute.- See Also:
Rule.isDistinctElements()
-
isUnique
public boolean isUnique()
Returns the value of the 'Unique' attribute.A unique rule matches at most once against a unique (list of) source value(s). Traces created by a unique rule can also be efficiently lookup up, because each (list of) source value(s) maps to at most one (list of) target value(s).
- Specified by:
isUniquein interfaceRule- Returns:
- the value of the 'Unique' attribute.
- See Also:
Rule.setUnique(boolean),EmftvmPackage.getRule_Unique()
-
setUnique
public void setUnique(boolean newUnique)
Sets the value of the 'Unique' attribute.- Specified by:
setUniquein interfaceRule- Parameters:
newUnique- the new value of the 'Unique' attribute.- See Also:
Rule.isUnique()
-
isLeaf
public boolean isLeaf()
Returns the value of the 'Leaf' attribute.A rule is a leaf rule when it is not abstract, and it has no leaf sub-rules. Call
#compileState()before calling this method.- Specified by:
isLeafin interfaceRule- Returns:
- the value of the 'Leaf' attribute.
- See Also:
EmftvmPackage.getRule_Leaf()
-
isWithLeaves
public boolean isWithLeaves()
Returns the value of the 'With Leaves' attribute.A rule is with leaves if it has leaf sub-rules. Call
#compileState()before calling this method.- Specified by:
isWithLeavesin interfaceRule- Returns:
- the value of the 'With Leaves' attribute.
- See Also:
EmftvmPackage.getRule_WithLeaves()
-
findField
public Field findField(java.lang.Object context, java.lang.String name)
-
hasField
public boolean hasField(java.lang.String name)
Returnstrueiff this rule has any registered fields with the givenname.
-
findStaticField
public Field findStaticField(java.lang.Object context, java.lang.String name)
- Specified by:
findStaticFieldin interfaceRule- Parameters:
context- the context type of the fieldname- the operation name- Returns:
- the static
Fieldwith the given properties, ornullif none registered
-
hasStaticField
public boolean hasStaticField(java.lang.String name)
Returnstrueiff this rule has any registered static fields with the givenname.- Specified by:
hasStaticFieldin interfaceRule- Parameters:
name- the field name- Returns:
trueiff this rule has any registered static fields with the givenname
-
registerField
public void registerField(Field field)
- Specified by:
registerFieldin interfaceRule- Parameters:
field- theFieldto register
-
matchSingle
public boolean matchSingle(StackFrame frame)
Matches this rule for the automatic single stage, if applicable. Call#compileState()before calling this method.- Specified by:
matchSinglein interfaceRule- Parameters:
frame- the stack frame in which to execute the matcher- Returns:
trueiff the rule has any matches
-
matchRecursive
public boolean[] matchRecursive(StackFrame frame)
Matches this rule for the automatic recursive stage, if applicable. Call#compileState()before calling this method.- Specified by:
matchRecursivein interfaceRule- Parameters:
frame- the stack frame in which to execute the matcher- Returns:
- [
trueiff the rule has any matches,trueiff there was a guaranteed final match]
-
matchManual
public java.lang.Object matchManual(StackFrame frame, java.lang.Object[] values)
Matches this rule manually, if applicable. Call#compileState()before calling this method.- Specified by:
matchManualin interfaceRule- Parameters:
frame- the stack frame in which to execute the matchervalues- the values to match against- Returns:
- the rule application result, or
nullif the rule did not match
-
matchOne
public boolean matchOne(StackFrame frame, java.util.Map<java.lang.String,java.lang.Object> valuesMap)
Matches rule forvaluesMap. Call#compileState()before calling this method.
-
matchOneOnly
public boolean matchOneOnly(StackFrame frame, java.util.Map<java.lang.String,java.lang.Object> valuesMap)
Matches this rule only (without super-rules) forvaluesMap. Call#compileState()before calling this method.- Specified by:
matchOneOnlyin interfaceRule- Parameters:
frame- the stack frame in which to execute the matchervaluesMap- the values to match against- Returns:
trueiff the rule matches
-
createTraces
public void createTraces(StackFrame frame)
Creates trace elements for the recorded matches for this rule. Call#compileState()before calling this method.- Specified by:
createTracesin interfaceRule- Parameters:
frame- the stack frame context
-
completeTraceFor
public boolean completeTraceFor(StackFrame frame, TraceLink trace)
Completestracefor this rule by creating the output elements. Will create default/unique trace iff mapsTo information exists. Call#compileState()before calling this method.- Specified by:
completeTraceForin interfaceRule- Parameters:
frame- the stack frame contexttrace- the trace to complete- Returns:
trueiff default/unique mappings were defined for the complete list of source elements
-
apply
public void apply(StackFrame frame)
Applies this rule for the created traces. Call#compileState()before calling this method.
-
postApply
public void postApply(StackFrame frame)
Runs post-applier for this rule for the created traces. Call#compileState()before calling this method.
-
applyFirst
public boolean applyFirst(StackFrame frame)
Applies and post-applies this rule for the first recorded match. Call#compileState()before calling this method.- Specified by:
applyFirstin interfaceRule- Parameters:
frame- the stack frame in which to execute the applier and post-applier- Returns:
trueiff this rule was applied
-
applyOne
public java.lang.Object applyOne(StackFrame frame, java.util.Map<java.lang.String,java.lang.Object> valuesMap)
Applies this rule totrace
-
applyFor
public java.lang.Object applyFor(StackFrame frame, TraceLink trace)
Applies this rule for the giventrace. Call#compileState()before calling this method.
-
postApplyFor
public java.lang.Object postApplyFor(StackFrame frame, TraceLink trace)
Post-applies this rule for the giventrace. Call#compileState()before calling this method.- Specified by:
postApplyForin interfaceRule- Parameters:
frame- the stack frame contexttrace- the trace link to post-apply the rule for- Returns:
- the post-application result
-
getAllESuperRules
public LazySet<Rule> getAllESuperRules()
Returns the transitive closure of super-rules, root rule first (LazySet's have a fixed iteration order). Call#compileState()before calling this method.- Specified by:
getAllESuperRulesin interfaceRule- Returns:
- the transitive closure of super-rules.
-
createUniqueMapping
public void createUniqueMapping(TraceLink trace)
Creates a unique trace mapping entry for the source values intrace, if applicable.- Specified by:
createUniqueMappingin interfaceRule- Parameters:
trace- the trace element with source values
-
compileState
public void compileState(ExecEnv env)
Compiles the internal state of this rule for optimised matching. Call this method whenever any properties of this rule or any sub-rules have changed.- Specified by:
compileStatein interfaceRule- Parameters:
env- the execution environment context
-
resetState
public void resetState()
Resets the internal state of this rule. Call this method before callingRule.compileState(ExecEnv)on all rules.- Specified by:
resetStatein interfaceRule
-
compileIterables
public void compileIterables(ExecEnv env)
Compiles the model element iterables for this rule. Call this method whenever any input or in/out model has changed.- Specified by:
compileIterablesin interfaceRule- Parameters:
env- the execution environment context
-
clearFields
public void clearFields()
Clears the values of all registered fields within this rule.- Specified by:
clearFieldsin interfaceRule
-
findInputElement
public InputRuleElement findInputElement(java.lang.String name)
Finds theInputRuleElementwith the given name within the rule inheritance hierarchy depth-first.- Specified by:
findInputElementin interfaceRule- Parameters:
name- the input element name- Returns:
- the
InputRuleElementwith the given name ornull
-
getUniqueTrace
public TraceLink getUniqueTrace(StackFrame frame, java.lang.Object[] values)
Returns the unique rule application trace forvalues, if applicable.- Specified by:
getUniqueTracein interfaceRule- Parameters:
frame- the stack frame contextvalues- the source values for the trace- Returns:
- the unique rule application trace, or
null
-
eInverseAdd
public org.eclipse.emf.common.notify.NotificationChain eInverseAdd(org.eclipse.emf.ecore.InternalEObject otherEnd, int featureID, org.eclipse.emf.common.notify.NotificationChain msgs)- Overrides:
eInverseAddin classorg.eclipse.emf.ecore.impl.BasicEObjectImpl
-
eInverseRemove
public org.eclipse.emf.common.notify.NotificationChain eInverseRemove(org.eclipse.emf.ecore.InternalEObject otherEnd, int featureID, org.eclipse.emf.common.notify.NotificationChain msgs)- Overrides:
eInverseRemovein classorg.eclipse.emf.ecore.impl.BasicEObjectImpl
-
eBasicRemoveFromContainerFeature
public org.eclipse.emf.common.notify.NotificationChain eBasicRemoveFromContainerFeature(org.eclipse.emf.common.notify.NotificationChain msgs)
- Overrides:
eBasicRemoveFromContainerFeaturein classorg.eclipse.emf.ecore.impl.BasicEObjectImpl
-
eGet
public java.lang.Object eGet(int featureID, boolean resolve, boolean coreType)- Specified by:
eGetin interfaceorg.eclipse.emf.ecore.InternalEObject- Overrides:
eGetin classNamedElementImpl
-
eSet
public void eSet(int featureID, java.lang.Object newValue)- Specified by:
eSetin interfaceorg.eclipse.emf.ecore.InternalEObject- Overrides:
eSetin classNamedElementImpl
-
eUnset
public void eUnset(int featureID)
- Specified by:
eUnsetin interfaceorg.eclipse.emf.ecore.InternalEObject- Overrides:
eUnsetin classNamedElementImpl
-
eIsSet
public boolean eIsSet(int featureID)
- Specified by:
eIsSetin interfaceorg.eclipse.emf.ecore.InternalEObject- Overrides:
eIsSetin classNamedElementImpl
-
toString
public java.lang.String toString()
- Overrides:
toStringin classNamedElementImpl
-
updateDefaultState
protected void updateDefaultState()
UpdatesdefaultState.
-
updateUniqueState
protected void updateUniqueState()
UpdatesuniqueState.
-
updateSuperRulesState
protected void updateSuperRulesState()
UpdatessuperRulesState.
-
updateRuleModeState
protected void updateRuleModeState()
UpdatesruleModeState.
-
updateLeafState
protected void updateLeafState()
UpdatesleafState.
-
updateAbstractState
protected void updateAbstractState()
UpdatesabstractState.
-
updateMatcherCbState
protected void updateMatcherCbState()
UpdatesmatcherCbState.
-
updateApplierCbState
protected void updateApplierCbState()
UpdatesapplierCbState.
-
updateDistinctState
protected void updateDistinctState()
UpdatesdistinctState.
-
-