diff options
Diffstat (limited to 'plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/Stereotype.java')
-rw-r--r-- | plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/Stereotype.java | 71 |
1 files changed, 63 insertions, 8 deletions
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/Stereotype.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/Stereotype.java index e286b948..458c7280 100644 --- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/Stereotype.java +++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/Stereotype.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2009 IBM Corporation and others. + * 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 @@ -7,6 +7,7 @@ * * Contributors: * IBM - initial API and implementation + * Kenn Hussey (CEA) - 327039 * * $Id: Stereotype.java,v 1.13 2009/08/12 21:05:19 jbruck Exp $ */ @@ -33,6 +34,7 @@ import org.eclipse.emf.ecore.EClass; * The following features are supported: * <ul> * <li>{@link org.eclipse.uml2.uml.Stereotype#getIcons <em>Icon</em>}</li> + * <li>{@link org.eclipse.uml2.uml.Stereotype#getProfile <em>Profile</em>}</li> * </ul> * </p> * @@ -46,6 +48,12 @@ public interface Stereotype /** * Returns the value of the '<em><b>Icon</b></em>' containment reference list. * The list contents are of type {@link org.eclipse.uml2.uml.Image}. + * <p> + * This feature subsets the following features: + * <ul> + * <li>'{@link org.eclipse.uml2.uml.Element#getOwnedElements() <em>Owned Element</em>}'</li> + * </ul> + * </p> * <!-- begin-user-doc --> * <!-- end-user-doc --> * <!-- begin-model-doc --> @@ -87,6 +95,23 @@ public interface Stereotype * <!-- begin-user-doc --> * <!-- end-user-doc --> * <!-- begin-model-doc --> + * Where a stereotype’s property is an association end for an association other than a kind of extension, and the other end is not a stereotype, the other end must be owned by the association itself. + * ownedAttribute + * ->select(association->notEmpty() and not association.oclIsKindOf(Extension) and not type.oclIsKindOf(Stereotype)) + * ->forAll(opposite.owner = association) + * @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 validateAssociationEndOwnership(DiagnosticChain diagnostics, + Map<Object, Object> context); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * <!-- begin-model-doc --> * A Stereotype may only generalize or specialize another Stereotype. * generalization.general->forAll(e |e.oclIsKindOf(Stereotype)) and generalization.specific->forAll(e | e.oclIsKindOf(Stereotype)) * @param diagnostics The chain of diagnostics to which problems are to be appended. @@ -106,19 +131,22 @@ public interface Stereotype * @param metaclass The metaclass for the new extension. * @param isRequired Whether the new extension should be required. * <!-- end-model-doc --> - * @model required="true" ordered="false" metaclassRequired="true" metaclassOrdered="false" isRequiredDataType="org.eclipse.uml2.uml.Boolean" isRequiredRequired="true" isRequiredOrdered="false" + * @model required="true" ordered="false" metaclassRequired="true" metaclassOrdered="false" isRequiredDataType="org.eclipse.uml2.types.Boolean" isRequiredRequired="true" isRequiredOrdered="false" * @generated */ Extension createExtension(org.eclipse.uml2.uml.Class metaclass, boolean isRequired); /** + * Returns the value of the '<em><b>Profile</b></em>' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * <!-- begin-model-doc --> - * Retrieves the profile that owns this stereotype. + * The profile that directly or indirectly contains this stereotype. * <!-- end-model-doc --> - * @model kind="operation" ordered="false" + * @return the value of the '<em>Profile</em>' reference. + * @see org.eclipse.uml2.uml.UMLPackage#getStereotype_Profile() + * @model required="true" transient="true" changeable="false" volatile="true" derived="true" ordered="false" * @generated */ Profile getProfile(); @@ -127,9 +155,24 @@ public interface Stereotype * <!-- begin-user-doc --> * <!-- end-user-doc --> * <!-- begin-model-doc --> + * Stereotypes may only participate in binary associations. + * ownedAttribute.association->forAll(memberEnd->size()=2) + * @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 validateBinaryAssociationsOnly(DiagnosticChain diagnostics, + Map<Object, Object> context); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * <!-- begin-model-doc --> * Retrieves the localized keyword for this stereotype. * <!-- end-model-doc --> - * @model kind="operation" dataType="org.eclipse.uml2.uml.String" required="true" ordered="false" + * @model kind="operation" dataType="org.eclipse.uml2.types.String" required="true" ordered="false" * @generated */ String getKeyword(); @@ -141,7 +184,7 @@ public interface Stereotype * Retrieves the keyword for this stereotype, localized if indicated. * @param localize Whether to localize the keyword. * <!-- end-model-doc --> - * @model dataType="org.eclipse.uml2.uml.String" required="true" ordered="false" localizeDataType="org.eclipse.uml2.uml.Boolean" localizeRequired="true" localizeOrdered="false" + * @model dataType="org.eclipse.uml2.types.String" required="true" ordered="false" localizeDataType="org.eclipse.uml2.types.Boolean" localizeRequired="true" localizeOrdered="false" * @generated */ String getKeyword(boolean localize); @@ -150,6 +193,18 @@ public interface Stereotype * <!-- begin-user-doc --> * <!-- end-user-doc --> * <!-- begin-model-doc --> + * The query containingProfile returns the closest profile directly or indirectly containing this stereotype. + * result = self.namespace.oclAsType(Package).containingProfile() + * <!-- end-model-doc --> + * @model required="true" ordered="false" + * @generated + */ + Profile containingProfile(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * <!-- begin-model-doc --> * Retrieves the metaclasses extended by this stereotype. * <!-- end-model-doc --> * @model kind="operation" ordered="false" @@ -186,7 +241,7 @@ public interface Stereotype * Creates an icon with the specified location for this stereotype. * @param location The location for the new icon. * <!-- end-model-doc --> - * @model required="true" ordered="false" locationDataType="org.eclipse.uml2.uml.String" locationRequired="true" locationOrdered="false" + * @model required="true" ordered="false" locationDataType="org.eclipse.uml2.types.String" locationRequired="true" locationOrdered="false" * @generated */ Image createIcon(String location); @@ -199,7 +254,7 @@ public interface Stereotype * @param format The format for the new icon. * @param content The content for the new icon. * <!-- end-model-doc --> - * @model required="true" ordered="false" formatDataType="org.eclipse.uml2.uml.String" formatRequired="true" formatOrdered="false" contentDataType="org.eclipse.uml2.uml.String" contentRequired="true" contentOrdered="false" + * @model required="true" ordered="false" formatDataType="org.eclipse.uml2.types.String" formatRequired="true" formatOrdered="false" contentDataType="org.eclipse.uml2.types.String" contentRequired="true" contentOrdered="false" * @generated */ Image createIcon(String format, String content); |