org.eclipse.uml2.uml
Interface ExceptionHandler

All Superinterfaces:
Element, org.eclipse.emf.ecore.EModelElement, org.eclipse.emf.ecore.EObject, org.eclipse.emf.common.notify.Notifier

public interface ExceptionHandler
extends Element

A representation of the model object 'Exception Handler'. 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.

From package UML::Activities.

The following features are supported:

See Also:
UMLPackage.getExceptionHandler()

Method Summary
 ObjectNode getExceptionInput()
          Returns the value of the 'Exception Input' reference
 Classifier getExceptionType(java.lang.String name)
          Retrieves the first Classifier with the specified 'Name' from the 'Exception Type' reference list
 Classifier getExceptionType(java.lang.String name, boolean ignoreCase, org.eclipse.emf.ecore.EClass eClass)
          Retrieves the first Classifier with the specified 'Name' from the 'Exception Type' reference list
 org.eclipse.emf.common.util.EList<Classifier> getExceptionTypes()
          Returns the value of the 'Exception Type' reference list.
 ExecutableNode getHandlerBody()
          Returns the value of the 'Handler Body' reference
 ExecutableNode getProtectedNode()
          Returns the value of the 'Protected Node' container reference.
 void setExceptionInput(ObjectNode value)
          Sets the value of the 'Exception Input' reference
 void setHandlerBody(ExecutableNode value)
          Sets the value of the 'Handler Body' reference
 void setProtectedNode(ExecutableNode value)
          Sets the value of the 'Protected Node' container reference
 boolean validateEdgeSourceTarget(org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
          An ActivityEdge that has a source within the handlerBody of an ExceptionHandler must have its target in the handlerBody also, and vice versa.
 boolean validateExceptionInputType(org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
          The exceptionInput must either have no type or every exceptionType must conform to the exceptionInput type.
 boolean validateHandlerBodyEdges(org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
          The handlerBody has no incoming or outgoing ActivityEdges and the exceptionInput has no incoming ActivityEdges.
 boolean validateHandlerBodyOwner(org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
          The handlerBody must have the same owner as the protectedNode.
 boolean validateOneInput(org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
          The handlerBody is an Action with one InputPin, and that InputPin is the same as the exceptionInput.
 boolean validateOutputPins(org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
          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.
 
Methods inherited from interface org.eclipse.uml2.uml.Element
addKeyword, allOwnedElements, applyStereotype, createEAnnotation, createOwnedComment, destroy, getApplicableStereotype, getApplicableStereotypes, getAppliedStereotype, getAppliedStereotypes, getAppliedSubstereotype, getAppliedSubstereotypes, getKeywords, getModel, getNearestPackage, getOwnedComments, getOwnedElements, getOwner, getRelationships, getRelationships, getRequiredStereotype, getRequiredStereotypes, getSourceDirectedRelationships, getSourceDirectedRelationships, getStereotypeApplication, getStereotypeApplications, getTargetDirectedRelationships, getTargetDirectedRelationships, getValue, hasKeyword, hasValue, isStereotypeApplicable, isStereotypeApplied, isStereotypeRequired, mustBeOwned, removeKeyword, setValue, unapplyStereotype, validateHasOwner, validateNotOwnSelf
 
Methods inherited from interface org.eclipse.emf.ecore.EModelElement
getEAnnotation, getEAnnotations
 
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.emf.common.notify.Notifier
eAdapters, eDeliver, eNotify, eSetDeliver
 

Method Detail

getHandlerBody

ExecutableNode getHandlerBody()
Returns the value of the 'Handler Body' reference. An ExecutableNode that is executed if the ExceptionHandler catches an exception.

From package UML::Activities.

Returns:
the value of the 'Handler Body' reference.
See Also:
setHandlerBody(ExecutableNode), UMLPackage.getExceptionHandler_HandlerBody()

setHandlerBody

void setHandlerBody(ExecutableNode value)
Sets the value of the 'Handler Body' reference.

Parameters:
value - the new value of the 'Handler Body' reference.
See Also:
getHandlerBody()

getExceptionInput

ObjectNode getExceptionInput()
Returns the value of the 'Exception Input' reference. An ObjectNode within the handlerBody. When the ExceptionHandler catches an exception, the exception token is placed on this ObjectNode, causing the handlerBody to execute.

From package UML::Activities.

Returns:
the value of the 'Exception Input' reference.
See Also:
setExceptionInput(ObjectNode), UMLPackage.getExceptionHandler_ExceptionInput()

setExceptionInput

void setExceptionInput(ObjectNode value)
Sets the value of the 'Exception Input' reference.

Parameters:
value - the new value of the 'Exception Input' reference.
See Also:
getExceptionInput()

getExceptionTypes

org.eclipse.emf.common.util.EList<Classifier> getExceptionTypes()
Returns the value of the 'Exception Type' reference list. The list contents are of type Classifier. 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.

From package UML::Activities.

Returns:
the value of the 'Exception Type' reference list.
See Also:
UMLPackage.getExceptionHandler_ExceptionType()

getExceptionType

Classifier getExceptionType(java.lang.String name)
Retrieves the first Classifier with the specified 'Name' from the 'Exception Type' reference list.

Parameters:
name - The 'Name' of the Classifier to retrieve, or null.
Returns:
The first Classifier with the specified 'Name', or null.
See Also:
getExceptionTypes()

getExceptionType

Classifier getExceptionType(java.lang.String name,
                            boolean ignoreCase,
                            org.eclipse.emf.ecore.EClass eClass)
Retrieves the first Classifier with the specified 'Name' from the 'Exception Type' reference list.

Parameters:
name - The 'Name' of the Classifier to retrieve, or null.
ignoreCase - Whether to ignore case in String comparisons.
eClass - The Ecore class of the Classifier to retrieve, or null.
Returns:
The first Classifier with the specified 'Name', or null.
See Also:
getExceptionTypes()

getProtectedNode

ExecutableNode getProtectedNode()
Returns the value of the 'Protected Node' container reference. It is bidirectional and its opposite is 'Handler'.

This feature subsets the following features:

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.

From package UML::Activities.

Returns:
the value of the 'Protected Node' container reference.
See Also:
setProtectedNode(ExecutableNode), UMLPackage.getExceptionHandler_ProtectedNode(), ExecutableNode.getHandlers()

setProtectedNode

void setProtectedNode(ExecutableNode value)
Sets the value of the 'Protected Node' container reference.

Parameters:
value - the new value of the 'Protected Node' container reference.
See Also:
getProtectedNode()

validateHandlerBodyEdges

boolean validateHandlerBodyEdges(org.eclipse.emf.common.util.DiagnosticChain diagnostics,
                                 java.util.Map<java.lang.Object,java.lang.Object> context)
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()

Parameters:
diagnostics - The chain of diagnostics to which problems are to be appended.
context - The cache of context-specific information.

validateOutputPins

boolean validateOutputPins(org.eclipse.emf.common.util.DiagnosticChain diagnostics,
                           java.util.Map<java.lang.Object,java.lang.Object> context)
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))) )

Parameters:
diagnostics - The chain of diagnostics to which problems are to be appended.
context - The cache of context-specific information.

validateOneInput

boolean validateOneInput(org.eclipse.emf.common.util.DiagnosticChain diagnostics,
                         java.util.Map<java.lang.Object,java.lang.Object> context)
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

Parameters:
diagnostics - The chain of diagnostics to which problems are to be appended.
context - The cache of context-specific information.

validateEdgeSourceTarget

boolean validateEdgeSourceTarget(org.eclipse.emf.common.util.DiagnosticChain diagnostics,
                                 java.util.Map<java.lang.Object,java.lang.Object> context)
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))

Parameters:
diagnostics - The chain of diagnostics to which problems are to be appended.
context - The cache of context-specific information.

validateHandlerBodyOwner

boolean validateHandlerBodyOwner(org.eclipse.emf.common.util.DiagnosticChain diagnostics,
                                 java.util.Map<java.lang.Object,java.lang.Object> context)
The handlerBody must have the same owner as the protectedNode. handlerBody.owner=protectedNode.owner

Parameters:
diagnostics - The chain of diagnostics to which problems are to be appended.
context - The cache of context-specific information.

validateExceptionInputType

boolean validateExceptionInputType(org.eclipse.emf.common.util.DiagnosticChain diagnostics,
                                   java.util.Map<java.lang.Object,java.lang.Object> context)
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)))

Parameters:
diagnostics - The chain of diagnostics to which problems are to be appended.
context - The cache of context-specific information.

Copyright 2003, 2014 IBM Corporation, CEA, and others.
All Rights Reserved.