blob: 64af74921693798f817bfd236eb8fcc96a9e5a6a [file] [log] [blame]
/*
* Copyright (c) 2005, 2011 IBM Corporation, CEA, and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM - initial API and implementation
* Kenn Hussey (CEA) - 327039
*
* $Id: ExceptionHandler.java,v 1.10 2007/10/23 15:54:21 jbruck Exp $
*/
package org.eclipse.uml2.uml;
import java.util.Map;
import org.eclipse.emf.common.util.DiagnosticChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Exception Handler</b></em>'.
* <!-- end-user-doc -->
*
* <!-- begin-model-doc -->
* An exception handler is an element that specifies a body to execute in case the specified exception occurs during the execution of the protected node.
* <!-- end-model-doc -->
*
* <p>
* The following features are supported:
* <ul>
* <li>{@link org.eclipse.uml2.uml.ExceptionHandler#getExceptionInput <em>Exception Input</em>}</li>
* <li>{@link org.eclipse.uml2.uml.ExceptionHandler#getExceptionTypes <em>Exception Type</em>}</li>
* <li>{@link org.eclipse.uml2.uml.ExceptionHandler#getHandlerBody <em>Handler Body</em>}</li>
* <li>{@link org.eclipse.uml2.uml.ExceptionHandler#getProtectedNode <em>Protected Node</em>}</li>
* </ul>
* </p>
*
* @see org.eclipse.uml2.uml.UMLPackage#getExceptionHandler()
* @model
* @generated
*/
public interface ExceptionHandler
extends Element {
/**
* Returns the value of the '<em><b>Handler Body</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* A node that is executed if the handler satisfies an uncaught exception.
* <!-- end-model-doc -->
* @return the value of the '<em>Handler Body</em>' reference.
* @see #setHandlerBody(ExecutableNode)
* @see org.eclipse.uml2.uml.UMLPackage#getExceptionHandler_HandlerBody()
* @model required="true" ordered="false"
* @generated
*/
ExecutableNode getHandlerBody();
/**
* Sets the value of the '{@link org.eclipse.uml2.uml.ExceptionHandler#getHandlerBody <em>Handler Body</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Handler Body</em>' reference.
* @see #getHandlerBody()
* @generated
*/
void setHandlerBody(ExecutableNode value);
/**
* Returns the value of the '<em><b>Exception Input</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* An object node within the handler body. When the handler catches an exception, the exception token is placed in this node, causing the body to execute.
* <!-- end-model-doc -->
* @return the value of the '<em>Exception Input</em>' reference.
* @see #setExceptionInput(ObjectNode)
* @see org.eclipse.uml2.uml.UMLPackage#getExceptionHandler_ExceptionInput()
* @model required="true" ordered="false"
* @generated
*/
ObjectNode getExceptionInput();
/**
* Sets the value of the '{@link org.eclipse.uml2.uml.ExceptionHandler#getExceptionInput <em>Exception Input</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Exception Input</em>' reference.
* @see #getExceptionInput()
* @generated
*/
void setExceptionInput(ObjectNode value);
/**
* Returns the value of the '<em><b>Exception Type</b></em>' reference list.
* The list contents are of type {@link org.eclipse.uml2.uml.Classifier}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The kind of instances that the handler catches. If an exception occurs whose type is any of the classifiers in the set, the handler catches the exception and executes its body.
* <!-- end-model-doc -->
* @return the value of the '<em>Exception Type</em>' reference list.
* @see org.eclipse.uml2.uml.UMLPackage#getExceptionHandler_ExceptionType()
* @model required="true" ordered="false"
* @generated
*/
EList<Classifier> getExceptionTypes();
/**
* Retrieves the first {@link org.eclipse.uml2.uml.Classifier} with the specified '<em><b>Name</b></em>' from the '<em><b>Exception Type</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' of the {@link org.eclipse.uml2.uml.Classifier} to retrieve, or <code>null</code>.
* @return The first {@link org.eclipse.uml2.uml.Classifier} with the specified '<em><b>Name</b></em>', or <code>null</code>.
* @see #getExceptionTypes()
* @generated
*/
Classifier getExceptionType(String name);
/**
* Retrieves the first {@link org.eclipse.uml2.uml.Classifier} with the specified '<em><b>Name</b></em>' from the '<em><b>Exception Type</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' of the {@link org.eclipse.uml2.uml.Classifier} to retrieve, or <code>null</code>.
* @param ignoreCase Whether to ignore case in {@link java.lang.String} comparisons.
* @param eClass The Ecore class of the {@link org.eclipse.uml2.uml.Classifier} to retrieve, or <code>null</code>.
* @return The first {@link org.eclipse.uml2.uml.Classifier} with the specified '<em><b>Name</b></em>', or <code>null</code>.
* @see #getExceptionTypes()
* @generated
*/
Classifier getExceptionType(String name, boolean ignoreCase, EClass eClass);
/**
* Returns the value of the '<em><b>Protected Node</b></em>' container reference.
* It is bidirectional and its opposite is '{@link org.eclipse.uml2.uml.ExecutableNode#getHandlers <em>Handler</em>}'.
* <p>
* This feature subsets the following features:
* <ul>
* <li>'{@link org.eclipse.uml2.uml.Element#getOwner() <em>Owner</em>}'</li>
* </ul>
* </p>
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The node protected by the handler. The handler is examined if an exception propagates to the outside of the node.
* <!-- end-model-doc -->
* @return the value of the '<em>Protected Node</em>' container reference.
* @see #setProtectedNode(ExecutableNode)
* @see org.eclipse.uml2.uml.UMLPackage#getExceptionHandler_ProtectedNode()
* @see org.eclipse.uml2.uml.ExecutableNode#getHandlers
* @model opposite="handler" required="true" transient="false" ordered="false"
* @generated
*/
ExecutableNode getProtectedNode();
/**
* Sets the value of the '{@link org.eclipse.uml2.uml.ExceptionHandler#getProtectedNode <em>Protected Node</em>}' container reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Protected Node</em>' container reference.
* @see #getProtectedNode()
* @generated
*/
void setProtectedNode(ExecutableNode value);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The exception handler and its input object node are not the source or target of any edge.
* true
* @param diagnostics The chain of diagnostics to which problems are to be appended.
* @param context The cache of context-specific information.
* <!-- end-model-doc -->
* @model
* @generated
*/
boolean validateExceptionBody(DiagnosticChain diagnostics,
Map<Object, Object> context);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* If the protected node is a StructuredActivityNode with output pins, then the exception handler body must also be a StructuredActivityNode with output pins that correspond in number and types to those of the protected node.
* true
* @param diagnostics The chain of diagnostics to which problems are to be appended.
* @param context The cache of context-specific information.
* <!-- end-model-doc -->
* @model
* @generated
*/
boolean validateResultPins(DiagnosticChain diagnostics,
Map<Object, Object> context);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The handler body has one input, and that input is the same as the exception input.
* true
* @param diagnostics The chain of diagnostics to which problems are to be appended.
* @param context The cache of context-specific information.
* <!-- end-model-doc -->
* @model
* @generated
*/
boolean validateOneInput(DiagnosticChain diagnostics,
Map<Object, Object> context);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* An edge that has a source in an exception handler structured node must have its target in the handler also, and vice versa.
* true
* @param diagnostics The chain of diagnostics to which problems are to be appended.
* @param context The cache of context-specific information.
* <!-- end-model-doc -->
* @model
* @generated
*/
boolean validateEdgeSourceTarget(DiagnosticChain diagnostics,
Map<Object, Object> context);
} // ExceptionHandler