Merge branch 'master' into bugs/296598
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/Artifact.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/Artifact.java
index 621e2b6..68dd50e 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/Artifact.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/Artifact.java
@@ -8,7 +8,7 @@
  * Contributors:
  *   IBM - initial API and implementation
  *   Kenn Hussey (CEA) - 327039, 351774
- *   Christian W. Damus (CEA) - 251963
+ *   Christian W. Damus (CEA) - 251963, 269598
  *
  */
 package org.eclipse.uml2.uml;
@@ -20,6 +20,7 @@
 /**
  * <!-- begin-user-doc -->
  * A representation of the model object '<em><b>Artifact</b></em>'.
+ * @extends AttributeOwner, OperationOwner
  * <!-- end-user-doc -->
  *
  * <!-- begin-model-doc -->
@@ -44,7 +45,7 @@
  * @generated
  */
 public interface Artifact
-		extends Classifier, DeployedArtifact {
+		extends Classifier, DeployedArtifact, AttributeOwner, OperationOwner {
 
 	/**
 	 * Returns the value of the '<em><b>File Name</b></em>' attribute.
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/AttributeOwner.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/AttributeOwner.java
new file mode 100644
index 0000000..d2aa770
--- /dev/null
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/AttributeOwner.java
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 2013 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:
+ *   Christian W. Damus (CEA) - Initial API and implementation
+ *
+ */
+package org.eclipse.uml2.uml;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+
+
+/**
+ * Common protocol for {@linkplain Classifier classifiers} that own
+ * {@linkplain Classifier#getAttributes() attributes}.
+ * 
+ * @since 4.2
+ */
+public interface AttributeOwner {
+
+	/**
+	 * Obtains the attributes owned by this classifier.
+	 * 
+	 * @return my owned attributes
+	 */
+	EList<Property> getOwnedAttributes();
+
+	/**
+	 * Creates a new {@link Property} as an owned attribute of this classifier.
+	 * 
+	 * @param name
+	 *            the name of the new attribute (may be {@code null})
+	 * @param type
+	 *            the type of the new attribute (may be {@code null})
+	 * 
+	 * @return the new owned attribute
+	 * 
+	 * @see #createOwnedAttribute(String, Type, EClass)
+	 * @see #getOwnedAttribute(String, Type)
+	 */
+	Property createOwnedAttribute(String name, Type type);
+
+	/**
+	 * Creates a new property as an owned attribute of this classifier.
+	 * 
+	 * @param name
+	 *            the name of the new attribute (may be {@code null})
+	 * @param type
+	 *            the type of the new attribute (may be {@code null})
+	 * @param eClass
+	 *            the Ecore metaclass of the attribute to create
+	 * 
+	 * @return the new owned attribute
+	 * 
+	 * @see #createOwnedAttribute(String, Type)
+	 * @see #getOwnedAttribute(String, Type, boolean, EClass, boolean)
+	 */
+	Property createOwnedAttribute(String name, Type type, EClass eClass);
+
+	/**
+	 * Finds the first owned attribute that matches the given {@code name}
+	 * and/or {@code type}.
+	 * 
+	 * @param name
+	 *            the attribute name to match, or {@null} to match any
+	 *            attribute name
+	 * @param type
+	 *            the attribute type to match, or {@null} to match any
+	 *            attribute type
+	 * 
+	 * @return any matching attribute, or {@code null} if not found
+	 * 
+	 * @see #getOwnedAttribute(String, Type, boolean, EClass, boolean)
+	 */
+	Property getOwnedAttribute(String name, Type type);
+
+	/**
+	 * Finds the first owned attribute that matches the given {@code name}
+	 * (optionally irrespective of case) and/or {@code type}.
+	 * 
+	 * @param name
+	 *            the attribute name to match, or {@null} to match any
+	 *            attribute name
+	 * @param type
+	 *            the attribute type to match, or {@null} to match any
+	 *            attribute type
+	 * @param ignoreCase
+	 *            whether to match names case-insensitively
+	 * @param eClass
+	 *            the Ecore metaclass of attribute to match, or {@code null} to
+	 *            match any kind of attribute
+	 * @param createOnDemand
+	 *            whether to create the owned attribute and return it if an
+	 *            existing match is not found
+	 * 
+	 * @return any matching attribute, or {@code null} if not found and
+	 *         {@code createOnDemand} is {@code false}
+	 * 
+	 * @see #getOwnedAttribute(String, Type)
+	 */
+	Property getOwnedAttribute(String name, Type type, boolean ignoreCase,
+			EClass eClass, boolean createOnDemand);
+
+}
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/Class.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/Class.java
index e934b45..a2506d0 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/Class.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/Class.java
@@ -9,7 +9,7 @@
  *   IBM - initial API and implementation
  *   Kenn Hussey (Embarcadero Technologies) - 205188
  *   Kenn Hussey (CEA) - 327039, 351774
- *   Christian W. Damus (CEA) - 251963
+ *   Christian W. Damus (CEA) - 251963, 269598
  *
  */
 package org.eclipse.uml2.uml;
@@ -25,6 +25,7 @@
 /**
  * <!-- begin-user-doc -->
  * A representation of the model object '<em><b>Class</b></em>'.
+ * @extends OperationOwner
  * <!-- end-user-doc -->
  *
  * <!-- begin-model-doc -->
@@ -52,7 +53,7 @@
  * @generated
  */
 public interface Class
-		extends EncapsulatedClassifier, BehavioredClassifier {
+		extends EncapsulatedClassifier, BehavioredClassifier, OperationOwner {
 
 	/**
 	 * Returns the value of the '<em><b>Owned Operation</b></em>' containment reference list.
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/DataType.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/DataType.java
index d781893..b428af5 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/DataType.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/DataType.java
@@ -8,7 +8,7 @@
  * Contributors:
  *   IBM - initial API and implementation
  *   Kenn Hussey (CEA) - 327039, 351774
- *   Christian W. Damus (CEA) - 251963
+ *   Christian W. Damus (CEA) - 251963, 269598
  *
  */
 package org.eclipse.uml2.uml;
@@ -20,6 +20,7 @@
 /**
  * <!-- begin-user-doc -->
  * A representation of the model object '<em><b>Data Type</b></em>'.
+ * @extends AttributeOwner, OperationOwner
  * <!-- end-user-doc -->
  *
  * <!-- begin-model-doc -->
@@ -40,7 +41,7 @@
  * @generated
  */
 public interface DataType
-		extends Classifier {
+		extends Classifier, AttributeOwner, OperationOwner {
 
 	/**
 	 * Returns the value of the '<em><b>Owned Attribute</b></em>' containment reference list.
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/Interface.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/Interface.java
index 8bcb99f..e930888 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/Interface.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/Interface.java
@@ -8,7 +8,7 @@
  * Contributors:
  *   IBM - initial API and implementation
  *   Kenn Hussey (CEA) - 327039, 351774
- *   Christian W. Damus (CEA) - 251963
+ *   Christian W. Damus (CEA) - 251963, 269598
  *
  */
 package org.eclipse.uml2.uml;
@@ -24,6 +24,7 @@
 /**
  * <!-- begin-user-doc -->
  * A representation of the model object '<em><b>Interface</b></em>'.
+ * @extends AttributeOwner, OperationOwner
  * <!-- end-user-doc -->
  *
  * <!-- begin-model-doc -->
@@ -50,7 +51,7 @@
  * @generated
  */
 public interface Interface
-		extends Classifier {
+		extends Classifier, AttributeOwner, OperationOwner {
 
 	/**
 	 * Returns the value of the '<em><b>Owned Attribute</b></em>' containment reference list.
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/OperationOwner.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/OperationOwner.java
new file mode 100644
index 0000000..3c3353b
--- /dev/null
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/OperationOwner.java
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2013 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:
+ *   Christian W. Damus (CEA) - Initial API and implementation
+ *
+ */
+package org.eclipse.uml2.uml;
+
+import org.eclipse.emf.common.util.EList;
+
+
+/**
+ * Common protocol for {@linkplain Classifier classifiers} that own
+ * {@linkplain Classifier#getOperations() operations}.
+ * 
+ * @since 4.2
+ */
+public interface OperationOwner {
+
+	/**
+	 * Obtains the operations owned by this classifier.
+	 * 
+	 * @return my owned operations
+	 */
+	EList<Operation> getOwnedOperations();
+
+	/**
+	 * Creates a new void {@link Operation} (having no return result) as an
+	 * owned operation of this classifier.
+	 * 
+	 * @param name
+	 *            the name of the new operation (may be {@code null})
+	 * @param parameterNames
+	 *            the names of the operation's {@link ParameterDirectionKind#IN
+	 *            IN} parameters (may be {@code null} if no parameters are
+	 *            needed)
+	 * @param parameterTypes
+	 *            the types of the operation's {@link ParameterDirectionKind#IN
+	 *            IN} parameters (may be {@code null} if no parameters are
+	 *            needed)
+	 * 
+	 * @return the new owned operation
+	 * 
+	 * @see #createOwnedOperation(String, EList, EList, Type)
+	 * @see #getOwnedOperation(String, EList, EList)
+	 */
+	Operation createOwnedOperation(String name,
+ EList<String> parameterNames,
+			EList<Type> parameterTypes);
+
+	/**
+	 * Creates a new {@link Operation} as an owned operation of this classifier.
+	 * 
+	 * @param name
+	 *            the name of the new operation (may be {@code null})
+	 * @param parameterNames
+	 *            the names of the operation's {@link ParameterDirectionKind#IN
+	 *            IN} parameters (may be {@code null} if no parameters are
+	 *            needed)
+	 * @param parameterTypes
+	 *            the types of the operation's {@link ParameterDirectionKind#IN
+	 *            IN} parameters (may be {@code null} if no parameters are
+	 *            needed)
+	 * @param returnType
+	 *            the type of the operation (which is the type of its sole
+	 *            {@linkplain ParameterDirectionKind#RETURN return result})
+	 * 
+	 * @return the new owned operation
+	 * 
+	 * @see #createOwnedOperation(String, EList, EList)
+	 * @see #getOwnedOperation(String, EList, EList)
+	 */
+	Operation createOwnedOperation(String name, EList<String> parameterNames,
+			EList<Type> parameterTypes, Type returnType);
+
+	/**
+	 * Finds the first owned operation that matches all or any of the given
+	 * {@code name}, {@code parameterNames}, and {@code parameterTypes}.
+	 * 
+	 * @param name
+	 *            the operation name to match, or {@null} to match any
+	 *            operation name
+	 * @param parameterNames
+	 *            the parameter names to match, or {@null} to match any
+	 *            parameter names
+	 * @param parameterTypes
+	 *            the parameter types to match, or {@null} to match any
+	 *            signature
+	 * 
+	 * @return any matching operation, or {@code null} if not found
+	 * 
+	 * @see #getOwnedOperation(String, EList, EList, boolean, boolean)
+	 */
+	Operation getOwnedOperation(String name, EList<String> parameterNames,
+			EList<Type> parameterTypes);
+
+	/**
+	 * Finds the first owned operation that matches all or any of the given
+	 * {@code name} (optionally case-insensitive), {@code parameterNames}
+	 * (optionally case-insensitive), and {@code parameterTypes}.
+	 * 
+	 * @param name
+	 *            the operation name to match, or {@null} to match any
+	 *            operation name
+	 * @param parameterNames
+	 *            the parameter names to match, or {@null} to match any
+	 *            parameter names
+	 * @param parameterTypes
+	 *            the parameter types to match, or {@null} to match any
+	 *            signature
+	 * @param ignoreCase
+	 *            whether matching of operation and parameter names is
+	 *            case-insensitive
+	 * @param createOnDemand
+	 *            whether to create the owned operation and return it if an
+	 *            existing match is not found
+	 * 
+	 * @return any matching operation, or {@code null} if not found and
+	 *         {@code createOnDemand} is {@code false}
+	 * 
+	 * @see #getOwnedOperation(String, EList, EList)
+	 */
+	Operation getOwnedOperation(String name, EList<String> parameterNames,
+			EList<Type> parameterTypes, boolean ignoreCase,
+			boolean createOnDemand);
+
+}
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/Signal.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/Signal.java
index 035f1dd..89049ff 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/Signal.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/Signal.java
@@ -8,7 +8,7 @@
  * Contributors:
  *   IBM - initial API and implementation
  *   Kenn Hussey (CEA) - 327039, 351774
- *   Christian W. Damus (CEA) - 251963
+ *   Christian W. Damus (CEA) - 251963, 269598
  *
  */
 package org.eclipse.uml2.uml;
@@ -20,6 +20,7 @@
 /**
  * <!-- begin-user-doc -->
  * A representation of the model object '<em><b>Signal</b></em>'.
+ * @extends AttributeOwner
  * <!-- end-user-doc -->
  *
  * <!-- begin-model-doc -->
@@ -39,7 +40,7 @@
  * @generated
  */
 public interface Signal
-		extends Classifier {
+		extends Classifier, AttributeOwner {
 
 	/**
 	 * Returns the value of the '<em><b>Owned Attribute</b></em>' containment reference list.
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/StructuredClassifier.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/StructuredClassifier.java
index 7bb9d50..ee18397 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/StructuredClassifier.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/StructuredClassifier.java
@@ -9,7 +9,7 @@
  *   IBM - initial API and implementation
  *   Kenn Hussey (Embarcadero Technologies) - 205188
  *   Kenn Hussey (CEA) - 327039, 351774
- *   Christian W. Damus (CEA) - 251963
+ *   Christian W. Damus (CEA) - 251963, 269598
  *
  */
 package org.eclipse.uml2.uml;
@@ -25,6 +25,7 @@
 /**
  * <!-- begin-user-doc -->
  * A representation of the model object '<em><b>Structured Classifier</b></em>'.
+ * @extends AttributeOwner
  * <!-- end-user-doc -->
  *
  * <!-- begin-model-doc -->
@@ -47,7 +48,7 @@
  * @generated
  */
 public interface StructuredClassifier
-		extends Classifier {
+		extends Classifier, AttributeOwner {
 
 	/**
 	 * Returns the value of the '<em><b>Owned Attribute</b></em>' containment reference list.