public class EM2Util
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ErrorModelAnnexName |
Constructor and Description |
---|
EM2Util() |
Modifier and Type | Method and Description |
---|---|
static ErrorFlow |
findErrorFlow(ErrorPropagations eps,
InstanceObject incie)
find the error flow whose incoming error propagation point is incie
|
static ErrorPropagation |
findErrorPropagation(ErrorPropagations eps,
java.lang.String eppName,
DirectionType pd,
boolean isNot)
find the error propagation point of the specified name
|
static ErrorPropagation |
findIncomingErrorContainment(ErrorPropagations eps,
java.lang.String eppName)
find the outgoing error containment point of the specified name
|
static ErrorPropagation |
findIncomingErrorPropagation(ErrorPropagations eps,
java.lang.String eppName)
find the outgoing error propagation point of the specified name
|
static ErrorPropagation |
findOutgoingErrorContainment(ErrorPropagations eps,
java.lang.String eppName)
find the outgoing error containment point of the specified name
|
static ErrorPropagation |
findOutgoingErrorPropagation(ErrorPropagations eps,
java.lang.String eppName)
find the outgoing error propagation point of the specified name
|
static ErrorFlow |
findReverseErrorFlow(ErrorPropagations eps,
InstanceObject incie)
find the error flow whose outgoing error propagation point is incie
|
static ComponentErrorBehavior |
getComponentErrorBehavior(ComponentClassifier cl) |
static ComponentErrorBehavior |
getComponentErrorBehavior(ComponentInstance ci) |
static org.eclipse.emf.common.util.EList<ComponentInstance> |
getComponentInstancesWithComponentErrorBehavior(ComponentInstance ci)
retrieve list of component instances that have component error behavior specified
For process component instances do not recurse below and include the component instance
even if no error propagation is attached.
|
static org.eclipse.emf.common.util.EList<ComponentInstance> |
getComponentInstancesWithComponentErrorBehaviorOnly(ComponentInstance ci)
retrieve list of component instances that have component error behavior specified
For process component instances or component instance without children, do not recurse below and do not include the component instance
|
static org.eclipse.emf.common.util.EList<ComponentInstance> |
getComponentInstancesWithErrorPropagations(ComponentInstance ci)
retrieve list of component instances that have error propagations specified
For process component instances do not recurse below and include the component instance
even if no error propagation is attached.
|
static org.eclipse.emf.common.util.EList<ComponentInstance> |
getComponentInstancesWithErrorPropagationsOnly(ComponentInstance ci)
retrieve list of component instances that have error propagations specified
For process component instances or component instance without children, do not recurse below and do not include the component instance
|
static org.eclipse.emf.common.util.EList<ComponentInstance> |
getComponentInstancesWithhasCompositeErrorBehaviorOnly(ComponentInstance ci)
retrieve list of component instances that have composite error behavior specified
For process component instances or component instance without children, do not recurse below and do not include the component instance
|
static CompositeErrorBehavior |
getCompositeErrorBehavior(ComponentClassifier cl) |
static CompositeErrorBehavior |
getCompositeErrorBehavior(ComponentInstance ci) |
static org.eclipse.emf.common.util.EList<ComponentInstance> |
getCompositeInstancesWithComponentErrorBehavior(ComponentInstance ci)
retrieve list of component instances that have composite error behavior specified
For process component instances do not recurse below and include the component instance
even if no error propagation is attached.
|
static org.eclipse.emf.ecore.EObject |
getConditionExpressionContext(ConditionExpression ce)
find the model object that contains the condition expression
|
static org.eclipse.emf.ecore.EObject |
getConditionOwner(org.eclipse.emf.ecore.EObject element)
get the EM object that contains the condition expression.
|
static ErrorModelSubclause |
getContainingClassifierEMV2Subclause(org.eclipse.emf.ecore.EObject element)
get ErrorModelSubclause object in the classifier containing the element object.
|
static ErrorPropagations |
getContainingClassifierErrorPropagations(org.eclipse.emf.ecore.EObject element)
get error propagations object in the classifier containing the element object.
|
static ComponentErrorBehavior |
getContainingComponentErrorBehavior(org.eclipse.emf.ecore.EObject element)
get containing component error behavior specification
|
static ErrorModelSubclause |
getContainingErrorAnnexSubclause(org.eclipse.emf.ecore.EObject element)
get containing error model subclause
|
static ErrorBehaviorStateMachine |
getContainingErrorBehaviorStateMachine(org.eclipse.emf.ecore.EObject element)
get the state machine that contains the EM element
|
static ErrorModelLibrary |
getContainingErrorModelLibrary(org.eclipse.emf.ecore.EObject element)
get the enclosing error model library.
|
static ErrorPropagations |
getContainingErrorPropagations(org.eclipse.emf.ecore.EObject element)
get error propagations object that contains the element object.
|
static org.eclipse.emf.common.util.EList<PropertyAssociation> |
getContainingPropertiesHolder(org.eclipse.emf.ecore.EObject element)
get enclosing object within the error annex that is a property list holder..
|
static TypeUseContext |
getContainingTypeUseContext(org.eclipse.emf.ecore.EObject element)
get the enclosing type use context
A type use context is is the object that contains use references to error model/type libraries
|
static ErrorType |
getContainmentErrorType(ContainedNamedElement containedNamedElement)
get list of error types, one for each containment path
We assume that each path is of length one
|
static ErrorModelSubclause |
getErrorModelSubclause(Classifier cl)
get the error model subclause for the specified classifier.
|
static ErrorPropagations |
getErrorPropagations(ComponentClassifier cl) |
static ErrorPropagations |
getErrorPropagations(ComponentInstance ci) |
static org.eclipse.emf.common.util.EList<ErrorSource> |
getErrorSources(ErrorPropagations eps)
return list of error sources
|
static ErrorPropagation |
getIncomingAccessErrorPropagation(ComponentInstance ci)
Get incoming error propagation associated with component instance access
|
static ErrorPropagation |
getIncomingErrorPropagation(FeatureInstance fi)
Get incoming error propagation associated with feature instance
|
static java.lang.String |
getItemName(java.lang.String qualname)
extract the item name from a qualified name, the identifier after the last ::
|
static java.lang.String |
getName(TypeToken tu) |
static ErrorPropagation |
getOutgoingAccessErrorPropagation(ComponentInstance ci)
Get outgoing error propagation associated with component instance access
|
static ErrorPropagation |
getOutgoingErrorPropagation(FeatureInstance fi)
Get outgoing error propagation associated with feature instance
|
static java.lang.String |
getPackageName(java.lang.String qualname)
extract the package name of a qualified name, everything up to the last :: or null
|
static java.lang.String |
getPrintableName(TypeSet ts,
java.lang.String separator) |
static java.lang.String |
getPrintName(org.eclipse.emf.common.util.EList<TypeToken> tul) |
static java.lang.String |
getPrintName(ErrorModelLibrary eml) |
static java.lang.String |
getPrintName(NamedElement ne) |
static java.lang.String |
getPrintName(TypeSet ts) |
static java.lang.String |
getPrintName(TypeToken tu) |
static java.util.List<PropertyAssociation> |
getProperty(org.eclipse.emf.common.util.EList<PropertyAssociation> props,
java.lang.String propertyName)
return list of property associations that meet the property name
|
static ContainedNamedElement |
getProperty(org.eclipse.emf.common.util.EList<PropertyAssociation> props,
java.lang.String propertyName,
NamedElement target,
NamedElement localContext,
java.util.Stack<ComponentInstance> ciStack,
TypeSet ts)
retrieve an error model property (such as Hazard) attached to an error model element.
|
static ContainedNamedElement |
getProperty(java.lang.String propertyName,
ComponentInstance ci,
NamedElement localContext,
NamedElement target,
TypeSet ts)
find property by first looking for it down the component instance hierarchy to ci
Then try to find it in the local context if not null.
|
static ContainedNamedElement |
getPropertyInInstanceHierarchy(java.lang.String propertyName,
ComponentInstance ci,
NamedElement target,
NamedElement localContext,
java.util.Stack<ComponentInstance> ciStack,
TypeSet ts)
retrieve an error model property (such as Hazard) attached to an error model element based on contained property associations
in the annex subclause properties section.
|
static BasicPropertyAssociation |
getRecordField(org.eclipse.emf.common.util.EList<BasicPropertyAssociation> props,
java.lang.String fieldName) |
static java.lang.String |
getTableName(TypeSet ts) |
static ErrorBehaviorStateMachine |
getUseBehavior(EBSMUseContext context)
get UseBehavior, i.e., the referenced error behavior state machine
|
static ErrorBehaviorStateMachine |
getUsedErrorBehaviorStateMachine(org.eclipse.emf.ecore.EObject element)
get the EBSM referenced in the enclosing context, i.e., by the
component error behavior or composite error behavior declaration
|
static org.eclipse.emf.common.util.EList<ErrorModelLibrary> |
getUseTypes(TypeUseContext context)
get list of ErrorModelLibraries listed in UseTypes
|
static boolean |
hasComponentErrorBehavior(ComponentClassifier cl) |
static boolean |
hasComponentErrorBehavior(ComponentInstance ci) |
static boolean |
hasCompositeErrorBehavior(ComponentClassifier cl) |
static boolean |
hasCompositeErrorBehavior(ComponentInstance ci) |
static boolean |
hasErrorPropagations(ComponentClassifier cl) |
static boolean |
hasErrorPropagations(ComponentInstance ci) |
static ContainedNamedElement |
isErrorModelElementProperty(PropertyAssociation propertyAssociation,
NamedElement target,
NamedElement localContext,
java.util.Stack<ComponentInstance> ciStack,
TypeSet ts)
determine whether the property applies to specified error model element or elements contained in it
(typically error types inside an error model element)
In other words eme must be the last or second to last element in a path.
|
static ErrorType |
resolveAlias(ErrorType et)
resolve the errortype if it is an alias, otherwise return the error type
|
static ErrorTypes |
resolveAlias(ErrorTypes et)
find the actual ErrorTypes following the alias link
|
static TypeSet |
resolveAlias(TypeSet typeset)
resolve the typeset if it is an alias, otherwise return the typeset
|
public static ErrorPropagations getContainingErrorPropagations(org.eclipse.emf.ecore.EObject element)
element
- declarative model element or error annex elementpublic static org.eclipse.emf.common.util.EList<PropertyAssociation> getContainingPropertiesHolder(org.eclipse.emf.ecore.EObject element)
element
- declarative model element or error annex elementpublic static ErrorPropagations getContainingClassifierErrorPropagations(org.eclipse.emf.ecore.EObject element)
element
- declarative model element or error annex elementpublic static ErrorModelSubclause getContainingClassifierEMV2Subclause(org.eclipse.emf.ecore.EObject element)
element
- declarative model element or error annex elementpublic static ErrorPropagation findErrorPropagation(ErrorPropagations eps, java.lang.String eppName, DirectionType pd, boolean isNot)
eps
- List of error propagationseppName
- Name of error propagation point we are looking forpd
- DirectiontypeisNot
- boolean Error Containmentpublic static ErrorPropagation findIncomingErrorPropagation(ErrorPropagations eps, java.lang.String eppName)
eps
- List of error propagationseppName
- Name of error propagation point we are looking forpublic static ErrorPropagation findOutgoingErrorPropagation(ErrorPropagations eps, java.lang.String eppName)
eps
- List of error propagationseppName
- Name of error propagation point we are looking forpublic static ErrorPropagation findIncomingErrorContainment(ErrorPropagations eps, java.lang.String eppName)
eps
- List of error propagationseppName
- Name of error containment point we are looking forpublic static ErrorPropagation findOutgoingErrorContainment(ErrorPropagations eps, java.lang.String eppName)
eps
- List of error propagationseppName
- Name of error containment point we are looking forpublic static ErrorPropagation getOutgoingErrorPropagation(FeatureInstance fi)
fi
- feature instancepublic static ErrorPropagation getIncomingErrorPropagation(FeatureInstance fi)
fi
- feature instancepublic static ErrorPropagation getIncomingAccessErrorPropagation(ComponentInstance ci)
ci
- component instancepublic static ErrorPropagation getOutgoingAccessErrorPropagation(ComponentInstance ci)
ci
- component instancepublic static ErrorFlow findErrorFlow(ErrorPropagations eps, InstanceObject incie)
eps
- List of error propagationsincie
- connection instance end, which can be a component instance or feature instancepublic static ErrorFlow findReverseErrorFlow(ErrorPropagations eps, InstanceObject incie)
eps
- List of error propagationsincie
- connection instance end, which can be a component instance or feature instancepublic static org.eclipse.emf.common.util.EList<ErrorSource> getErrorSources(ErrorPropagations eps)
eps
- error propagationspublic static org.eclipse.emf.ecore.EObject getConditionOwner(org.eclipse.emf.ecore.EObject element)
element
- public static ErrorBehaviorStateMachine getContainingErrorBehaviorStateMachine(org.eclipse.emf.ecore.EObject element)
element
- public static ErrorModelLibrary getContainingErrorModelLibrary(org.eclipse.emf.ecore.EObject element)
element
- public static TypeUseContext getContainingTypeUseContext(org.eclipse.emf.ecore.EObject element)
element
- public static ErrorModelSubclause getContainingErrorAnnexSubclause(org.eclipse.emf.ecore.EObject element)
element
- public static ComponentErrorBehavior getContainingComponentErrorBehavior(org.eclipse.emf.ecore.EObject element)
element
- public static ErrorModelSubclause getErrorModelSubclause(Classifier cl)
cl
- CLassifierpublic static java.lang.String getItemName(java.lang.String qualname)
qualname
- String Qualified namepublic static java.lang.String getPackageName(java.lang.String qualname)
qualname
- public static java.lang.String getPrintName(NamedElement ne)
public static java.lang.String getPrintName(TypeSet ts)
public static java.lang.String getPrintName(ErrorModelLibrary eml)
public static java.lang.String getTableName(TypeSet ts)
public static java.lang.String getPrintableName(TypeSet ts, java.lang.String separator)
public static java.lang.String getPrintName(TypeToken tu)
public static java.lang.String getName(TypeToken tu)
public static java.lang.String getPrintName(org.eclipse.emf.common.util.EList<TypeToken> tul)
public static ErrorBehaviorStateMachine getUsedErrorBehaviorStateMachine(org.eclipse.emf.ecore.EObject element)
element
- model object contained in a component or composite error behavior declarationpublic static ErrorType resolveAlias(ErrorType et)
et
- ErrorType that may be an aliaspublic static TypeSet resolveAlias(TypeSet typeset)
typeset
- TypeSetpublic static ErrorTypes resolveAlias(ErrorTypes et)
et
- public static ErrorBehaviorStateMachine getUseBehavior(EBSMUseContext context)
context
- public static org.eclipse.emf.common.util.EList<ErrorModelLibrary> getUseTypes(TypeUseContext context)
context
- Type use contextpublic static org.eclipse.emf.ecore.EObject getConditionExpressionContext(ConditionExpression ce)
ce
- Condition Expressionpublic static java.util.List<PropertyAssociation> getProperty(org.eclipse.emf.common.util.EList<PropertyAssociation> props, java.lang.String propertyName)
props
- property association list from the properties sectionpropertyName
- name of propertypublic static ContainedNamedElement getProperty(java.lang.String propertyName, ComponentInstance ci, NamedElement localContext, NamedElement target, TypeSet ts)
propertyName
- Stringci
- ComponentInstance the component with the error model element, whose property we are retrievinglocalContext
- Element the object that contains the reference to a target object, or null.target
- Element the target object in the error model whose property we retrievepublic static ContainedNamedElement getPropertyInInstanceHierarchy(java.lang.String propertyName, ComponentInstance ci, NamedElement target, NamedElement localContext, java.util.Stack<ComponentInstance> ciStack, TypeSet ts)
props
- list of property associations from the properties section in the error modelpropertyName
- name of property we are looking fortarget
- the error model element (first item in teh containment path)public static ContainedNamedElement getProperty(org.eclipse.emf.common.util.EList<PropertyAssociation> props, java.lang.String propertyName, NamedElement target, NamedElement localContext, java.util.Stack<ComponentInstance> ciStack, TypeSet ts)
props
- list of property associations from the properties section in the error modelpropertyName
- name of property we are looking fortarget
- the error model elementciStack
- stack of nested CIpublic static ContainedNamedElement isErrorModelElementProperty(PropertyAssociation propertyAssociation, NamedElement target, NamedElement localContext, java.util.Stack<ComponentInstance> ciStack, TypeSet ts)
propertyAssociation
- eme
- Error Model elementpublic static ErrorType getContainmentErrorType(ContainedNamedElement containedNamedElement)
containedNamedElement
- Containment pathpublic static BasicPropertyAssociation getRecordField(org.eclipse.emf.common.util.EList<BasicPropertyAssociation> props, java.lang.String fieldName)
public static boolean hasErrorPropagations(ComponentInstance ci)
public static boolean hasErrorPropagations(ComponentClassifier cl)
public static boolean hasComponentErrorBehavior(ComponentInstance ci)
public static boolean hasComponentErrorBehavior(ComponentClassifier cl)
public static boolean hasCompositeErrorBehavior(ComponentInstance ci)
public static boolean hasCompositeErrorBehavior(ComponentClassifier cl)
public static ErrorPropagations getErrorPropagations(ComponentInstance ci)
public static ErrorPropagations getErrorPropagations(ComponentClassifier cl)
public static ComponentErrorBehavior getComponentErrorBehavior(ComponentInstance ci)
public static ComponentErrorBehavior getComponentErrorBehavior(ComponentClassifier cl)
public static CompositeErrorBehavior getCompositeErrorBehavior(ComponentInstance ci)
public static CompositeErrorBehavior getCompositeErrorBehavior(ComponentClassifier cl)
public static org.eclipse.emf.common.util.EList<ComponentInstance> getComponentInstancesWithErrorPropagations(ComponentInstance ci)
ci
- ComponentInstancepublic static org.eclipse.emf.common.util.EList<ComponentInstance> getComponentInstancesWithErrorPropagationsOnly(ComponentInstance ci)
ci
- ComponentInstancepublic static org.eclipse.emf.common.util.EList<ComponentInstance> getComponentInstancesWithComponentErrorBehavior(ComponentInstance ci)
ci
- ComponentInstancepublic static org.eclipse.emf.common.util.EList<ComponentInstance> getComponentInstancesWithComponentErrorBehaviorOnly(ComponentInstance ci)
ci
- ComponentInstancepublic static org.eclipse.emf.common.util.EList<ComponentInstance> getCompositeInstancesWithComponentErrorBehavior(ComponentInstance ci)
ci
- ComponentInstancepublic static org.eclipse.emf.common.util.EList<ComponentInstance> getComponentInstancesWithhasCompositeErrorBehaviorOnly(ComponentInstance ci)
ci
- ComponentInstance