Class ExceptionHandler
An ExceptionHandler is an Element that specifies a handlerBody ExecutableNode to execute in case the specified exception occurs during the execution of the protected ExecutableNode. <p>From package UML::Activities.</p>
[XmlNamespace("http://www.eclipse.org/uml2/5.0.0/UML")]
[XmlNamespacePrefix("uml")]
[ModelRepresentationClass("http://www.eclipse.org/uml2/5.0.0/UML#//ExceptionHandler")]
public class ExceptionHandler : Element, IExceptionHandler, IElement, IEModelElement, IModelElement, INotifyPropertyChanged, INotifyPropertyChanging
- Inheritance
-
ExceptionHandler
- Implements
- Inherited Members
Constructors
ExceptionHandler()
Creates a new instance
public ExceptionHandler()
Properties
ClassInstance
Gets the Class model for this type
public static IClass ClassInstance { get; }
Property Value
ExceptionInput
An ObjectNode within the handlerBody. When the ExceptionHandler catches an exception, the exception token is placed on this ObjectNode, causing the handlerBody to execute. <p>From package UML::Activities.</p>
[XmlElementName("exceptionInput")]
[XmlAttribute(true)]
public IObjectNode ExceptionInput { get; set; }
Property Value
ExceptionType
The Classifiers whose instances the ExceptionHandler catches as exceptions. If an exception occurs whose type is any exceptionType, the ExceptionHandler catches the exception and executes the handlerBody. <p>From package UML::Activities.</p>
[LowerBound(1)]
[XmlElementName("exceptionType")]
[XmlAttribute(true)]
public ISetExpression<IClassifier> ExceptionType { get; }
Property Value
HandlerBody
An ExecutableNode that is executed if the ExceptionHandler catches an exception. <p>From package UML::Activities.</p>
[XmlElementName("handlerBody")]
[XmlAttribute(true)]
public IExecutableNode HandlerBody { get; set; }
Property Value
ProtectedNode
The ExecutableNode protected by the ExceptionHandler. If an exception propagates out of the protectedNode and has a type matching one of the exceptionTypes, then it is caught by this ExceptionHandler. <p>From package UML::Activities.</p>
[Browsable(false)]
[XmlElementName("protectedNode")]
[XmlAttribute(true)]
[XmlOpposite("handler")]
public IExecutableNode ProtectedNode { get; set; }
Property Value
ReferencedElements
Gets the referenced model elements of this model element
public override IEnumerableExpression<IModelElement> ReferencedElements { get; }
Property Value
Methods
Edge_source_target(object, object)
An ActivityEdge that has a source within the handlerBody of an ExceptionHandler must have its target in the handlerBody also, and vice versa. let nodes:Set(ActivityNode) = handlerBody.oclAsType(Action).allOwnedNodes() in nodes.outgoing->forAll(nodes->includes(target)) and nodes.incoming->forAll(nodes->includes(source))
public bool Edge_source_target(object diagnostics, object context)
Parameters
diagnostics
objectThe chain of diagnostics to which problems are to be appended.
context
objectThe cache of context-specific information.
Returns
Exception_input_type(object, object)
The exceptionInput must either have no type or every exceptionType must conform to the exceptionInput type. exceptionInput.type=null or exceptionType->forAll(conformsTo(exceptionInput.type.oclAsType(Classifier)))
public bool Exception_input_type(object diagnostics, object context)
Parameters
diagnostics
objectThe chain of diagnostics to which problems are to be appended.
context
objectThe cache of context-specific information.
Returns
GetClass()
Gets the Class for this model element
public override IClass GetClass()
Returns
GetCollectionForFeature(string)
Gets the Model element collection for the given feature
protected override IList GetCollectionForFeature(string feature)
Parameters
feature
stringThe requested feature
Returns
- IList
A non-generic list of elements
GetExpressionForReference(string)
Gets the property expression for the given reference
protected override INotifyExpression<IModelElement> GetExpressionForReference(string reference)
Parameters
reference
stringThe requested reference in upper case
Returns
- INotifyExpression<IModelElement>
An incremental property expression
GetModelElementForReference(string, int)
Resolves the given URI to a child model element
protected override IModelElement GetModelElementForReference(string reference, int index)
Parameters
Returns
- IModelElement
The model element or null if it could not be found
Handler_body_edges(object, object)
The handlerBody has no incoming or outgoing ActivityEdges and the exceptionInput has no incoming ActivityEdges. handlerBody.incoming->isEmpty() and handlerBody.outgoing->isEmpty() and exceptionInput.incoming->isEmpty()
public bool Handler_body_edges(object diagnostics, object context)
Parameters
diagnostics
objectThe chain of diagnostics to which problems are to be appended.
context
objectThe cache of context-specific information.
Returns
Handler_body_owner(object, object)
The handlerBody must have the same owner as the protectedNode. handlerBody.owner=protectedNode.owner
public bool Handler_body_owner(object diagnostics, object context)
Parameters
diagnostics
objectThe chain of diagnostics to which problems are to be appended.
context
objectThe cache of context-specific information.
Returns
OnParentChanged(IModelElement, IModelElement)
Gets called when the parent model element of the current model element changes
protected override void OnParentChanged(IModelElement newParent, IModelElement oldParent)
Parameters
newParent
IModelElementThe new parent model element
oldParent
IModelElementThe old parent model element
OnParentChanging(IModelElement, IModelElement)
Gets called when the parent model element of the current model element is about to change
protected override void OnParentChanging(IModelElement newParent, IModelElement oldParent)
Parameters
newParent
IModelElementThe new parent model element
oldParent
IModelElementThe old parent model element
One_input(object, object)
The handlerBody is an Action with one InputPin, and that InputPin is the same as the exceptionInput. handlerBody.oclIsKindOf(Action) and let inputs: OrderedSet(InputPin) = handlerBody.oclAsType(Action).input in inputs->size()=1 and inputs->first()=exceptionInput
public bool One_input(object diagnostics, object context)
Parameters
diagnostics
objectThe chain of diagnostics to which problems are to be appended.
context
objectThe cache of context-specific information.
Returns
Output_pins(object, object)
If the protectedNode is an Action with OutputPins, then the handlerBody must also be an Action with the same number of OutputPins, which are compatible in type, ordering, and multiplicity to those of the protectedNode. (protectedNode.oclIsKindOf(Action) and protectedNode.oclAsType(Action).output->notEmpty()) implies ( handlerBody.oclIsKindOf(Action) and let protectedNodeOutput : OrderedSet(OutputPin) = protectedNode.oclAsType(Action).output, handlerBodyOutput : OrderedSet(OutputPin) = handlerBody.oclAsType(Action).output in protectedNodeOutput->size() = handlerBodyOutput->size() and Sequence{1..protectedNodeOutput->size()}->forAll(i | handlerBodyOutput->at(i).type.conformsTo(protectedNodeOutput->at(i).type) and handlerBodyOutput->at(i).isOrdered=protectedNodeOutput->at(i).isOrdered and handlerBodyOutput->at(i).compatibleWith(protectedNodeOutput->at(i))) )
public bool Output_pins(object diagnostics, object context)
Parameters
diagnostics
objectThe chain of diagnostics to which problems are to be appended.
context
objectThe cache of context-specific information.
Returns
SetFeature(string, object)
Sets a value to the given feature
protected override void SetFeature(string feature, object value)