blob: 649b89c804075f0197e01d973532c6f52e60273a [file] [log] [blame]
/*
* Copyright (c) 2005 IBM Corporation 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
*
* $Id: Element.java,v 1.1 2005/11/14 22:26:01 khussey Exp $
*/
package org.eclipse.uml2.uml;
import java.util.List;
import java.util.Map;
import org.eclipse.emf.common.util.DiagnosticChain;
import org.eclipse.emf.ecore.EModelElement;
import org.eclipse.emf.ecore.EObject;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Element</b></em>'.
* <!-- end-user-doc -->
*
* <!-- begin-model-doc -->
* An element can own comments.
* Element is an abstract metaclass with no superclass. It is used as the common superclass for all metaclasses in the infrastructure library. Element has a derived composition association to itself to support the general capability for elements to own other elements.
* An element is a constituent of a model. An element can own comments.
* <!-- end-model-doc -->
*
* <p>
* The following features are supported:
* <ul>
* <li>{@link org.eclipse.uml2.uml.Element#getOwnedElements <em>Owned Element</em>}</li>
* <li>{@link org.eclipse.uml2.uml.Element#getOwner <em>Owner</em>}</li>
* <li>{@link org.eclipse.uml2.uml.Element#getOwnedComments <em>Owned Comment</em>}</li>
* </ul>
* </p>
*
* @see org.eclipse.uml2.uml.UMLPackage#getElement()
* @model abstract="true"
* @generated
*/
public interface Element
extends EObject, EModelElement {
/**
* Returns the value of the '<em><b>Owned Element</b></em>' reference list.
* The list contents are of type {@link org.eclipse.uml2.uml.Element}.
* It is bidirectional and its opposite is '{@link org.eclipse.uml2.uml.Element#getOwner <em>Owner</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The Elements owned by this element.
* <!-- end-model-doc -->
* @return the value of the '<em>Owned Element</em>' reference list.
* @see org.eclipse.uml2.uml.UMLPackage#getElement_OwnedElement()
* @see org.eclipse.uml2.uml.Element#getOwner
* @model type="org.eclipse.uml2.uml.Element" opposite="owner" resolveProxies="false" transient="true" changeable="false" derived="true" ordered="false"
* @generated
*/
List getOwnedElements();
/**
* Returns the value of the '<em><b>Owner</b></em>' reference.
* It is bidirectional and its opposite is '{@link org.eclipse.uml2.uml.Element#getOwnedElements <em>Owned Element</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The Element that owns this element.
* <!-- end-model-doc -->
* @return the value of the '<em>Owner</em>' reference.
* @see org.eclipse.uml2.uml.UMLPackage#getElement_Owner()
* @see org.eclipse.uml2.uml.Element#getOwnedElements
* @model opposite="ownedElement" transient="true" changeable="false" derived="true" ordered="false"
* @generated
*/
Element getOwner();
/**
* Returns the value of the '<em><b>Owned Comment</b></em>' containment reference list.
* The list contents are of type {@link org.eclipse.uml2.uml.Comment}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The Comments owned by this element.
* <!-- end-model-doc -->
* @return the value of the '<em>Owned Comment</em>' containment reference list.
* @see org.eclipse.uml2.uml.UMLPackage#getElement_OwnedComment()
* @model type="org.eclipse.uml2.uml.Comment" containment="true" resolveProxies="false" ordered="false"
* @generated
*/
List getOwnedComments();
/**
* Creates a {@link org.eclipse.uml2.uml.Comment} and appends it to the '<em><b>Owned Comment</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return The new {@link org.eclipse.uml2.uml.Comment}.
* @see #getOwnedComments()
* @generated
*/
Comment createOwnedComment();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* An element may not directly or indirectly own itself.
* not self.allOwnedElements()->includes(self)
* <!-- end-model-doc -->
* @model
* @generated
*/
boolean validateNotOwnSelf(DiagnosticChain diagnostics, Map context);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* Elements that must be owned must have an owner.
* self.mustBeOwned() implies owner->notEmpty()
* <!-- end-model-doc -->
* @model
* @generated
*/
boolean validateHasOwner(DiagnosticChain diagnostics, Map context);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The query allOwnedElements() gives all of the direct and indirect owned elements of an element.
* result = ownedElement->union(ownedElement->collect(e | e.allOwnedElements()))
* <!-- end-model-doc -->
* @model type="org.eclipse.uml2.uml.Element" ordered="false"
* annotation="http://www.eclipse.org/emf/2002/Ecore constraints='spec'"
* @generated
*/
List allOwnedElements();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The query mustBeOwned() indicates whether elements of this type must have an owner. Subclasses of Element that do not require an owner must override this operation.
* result = true
* <!-- end-model-doc -->
* @model required="true" ordered="false"
* annotation="http://www.eclipse.org/emf/2002/Ecore constraints='spec'"
* @generated
*/
boolean mustBeOwned();
} // Element