## org.eclipse.uml2.uml
Interface Extension

All Superinterfaces:
  Association, Classifier, Element, org.eclipse.emf.ecore.EModelElement, org.eclipse.emf.ecore.EObject, NamedElement, Namespace, org.eclipse.emf.common.notify.Notifier, PackageableElement, ParameterableElement, RedefinableElement, Relationship, TemplateableElement, Type

    public interface Extension

extends Association

A representation of the model object 'Extension'. An extension is used to indicate that the properties of a metaclass are extended through a stereotype, and gives the ability to flexibly add (and later remove) stereotypes to classes.

The following features are supported:

- `Is Required`
- `Metaclass`

See Also:
  `UMLPackage.getExtension()`

Field Summary
`static java.lang.String` `METACLASS_ROLE_PREFIX` The prefix for metaclass role names.
`static java.lang.String` `STEREOTYPE_ROLE_PREFIX` The prefix for stereotype role names.

Method Summary
`Class` `getMetaclass()` Returns the value of the 'Metaclass' reference.
`Stereotype` `getStereotype()` Retrieves the stereotype that extends a metaclass through this extension
`Property` `getStereotypeEnd()` Retrieves the extension end that is typed by a stereotype (as opposed to a metaclass)
`boolean` `isRequired()` Returns the value of the 'Is Required' attribute.
`Property` `metaclassEnd()` The query metaclassEnd() returns the Property that is typed by a metaclass (as opposed to a stereotype).
`boolean` `validateIsBinary(org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)` An Extension is binary, i.e., it has only two memberEnds.
`boolean` `validateNonOwnedEnd(org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)` The non-owned end of an Extension is typed by a Class.

Methods inherited from interface org.eclipse.uml2.uml.Association

`createNavigableOwnedEnd, createNavigableOwnedEnd, createOwnedEnd, createOwnedEnd, getEndType, getEndType, getEndTypes, getMemberEnd, getMemberEnd, getMemberEnds, getNavigableOwnedEnd, getNavigableOwnedEnd, getNavigableOwnedEnds, getOwnedEnd, getOwnedEnd, getOwnedEnds, isBinary, isDerived, setIsDerived, validateAssociationEnds, validateBinaryAssociations, validateSpecializedEndNumber, validateSpecializedEndTypes`

Methods inherited from interface org.eclipse.uml2.uml.Classifier

`allFeatures, allParents, conformsTo, createCollaborationUse, createGeneralization, createOwnedUseCase, createRepresentation, createSubstitution, getAllAttributes, getAllOperations, getAllUsedInterfaces, getAttribute, getAttribute, getAttributes, getCollaborationUse, getCollaborationUse, getCollaborationUses, getFeature, getFeature, getFeatures, getGeneral, getGeneral, getGeneralization, getGeneralization, getGeneralizations, getGenerals, getInheritedMember, getInheritedMember, getInheritedMembers, getOperation, getOperation, getOperations, getOwnedUseCase, getOwnedUseCase, getOwnedUseCases, getPowertypeExtent, getPowertypeExtent, getPowertypeExtents, getRedefinedClassifier, getRedefinedClassifier, getRedefinedClassifiers, getRepresentation, getSubstitution, getSubstitution, getSubstitutions, getUseCase, getUseCase, getUseCases, getUsedInterfaces, hasVisibilityOf, inherit, inheritableMembers, isAbstract, maySpecializeType, parents, setIsAbstract, setRepresentation, validateGeneralizationHierarchies, validateMapsToGeneralizationSet, validateNoCyclesInGeneralization, validateSpecializeType`

Methods inherited from interface org.eclipse.uml2.uml.Namespace

`createElementImport, createElementImport, createOwnedRule, createOwnedRule, createPackageImport, createPackageImport, excludeCollisions, getElementImport, getElementImport, getElementImports, getImportedElements, getImportedMember, getImportedMember, getImportedMembers, getImportedPackages, getMember, getMember, getMembers, getNamesOfMember, getOwnedMember, getOwnedMember, getOwnedMembers, getOwnedRule, getOwnedRule, getOwnedRules, getPackageImport, getPackageImport, getPackageImports, importMembers, membersAreDistinguishable, validateMembersDistinguishable`

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`

Methods inherited from interface org.eclipse.uml2.uml.RedefinableElement
`getRedefinedElement, getRedefinedElement, getRedefinedElements, getRedefinitionContext, getRedefinitionContext, getRedefinitionContexts, isConsistentWith, isLeaf, isRedefinitionContextValid, setIsLeaf, validateRedefinitionConsistent, validateRedefinitionContextValid`

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`

Methods inherited from interface org.eclipse.uml2.uml.Type
`conformsTo, createAssociation, getAssociations, getPackage, setPackage`

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`

Methods inherited from interface org.eclipse.uml2.uml.ParameterableElement
`getOwningTemplateParameter, getTemplateParameter, isCompatibleWith, isTemplateParameter, setOwningTemplateParameter, setTemplateParameter`

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`

Methods inherited from interface org.eclipse.uml2.uml.TemplateableElement
`createOwnedTemplateSignature, createOwnedTemplateSignature, createTemplateBinding, getOwnedTemplateSignature, getTemplateBinding, getTemplateBinding, getTemplateBindings, isTemplate, parameterableElements, setOwnedTemplateSignature`

Methods inherited from interface org.eclipse.uml2.uml.Relationship
`getRelatedElements`

Field Detail

### METACLASS_ROLE_PREFIX

    static final java.lang.String METACLASS_ROLE_PREFIX

  The prefix for metaclass role names.

  See Also:
    Constant Field Values

### STEREOTYPE_ROLE_PREFIX

    static final java.lang.String STEREOTYPE_ROLE_PREFIX

  The prefix for stereotype role names.

  See Also:
    Constant Field Values

Method Detail

### isRequired

    boolean isRequired()

  Returns the value of the 'Is Required' attribute. The default value is `"false"`. Indicates whether an instance of the extending stereotype must be created when an instance of the extended class is created. The attribute value is derived from the multiplicity of the Property referenced by Extension::ownedEnd; a multiplicity of 1 means that isRequired is true, but otherwise it is false. Since the default multiplicity of an ExtensionEnd is 0..1, the default value of isRequired is false.

  Returns:
    the value of the 'Is Required' attribute.
  See Also:
    `UMLPackage.getExtension_IsRequired()`

### getMetaclass

    Class getMetaclass()

  Returns the value of the 'Metaclass' reference. It is bidirectional and its opposite is '`Extension`'. References the Class that is extended through an Extension. The property is derived from the type of the memberEnd that is not the ownedEnd.

  Returns:
    the value of the 'Metaclass' reference.
  See Also:
    `UMLPackage.getExtension_Metaclass()`, `Class.getExtensions()`

### validateNonOwnedEnd

    boolean validateNonOwnedEnd(org.eclipse.emf.common.util.DiagnosticChain diagnostics,
                                java.util.Map<java.lang.Object,java.lang.Object> context)

  The non-owned end of an Extension is typed by a Class. metaclassEnd()->notEmpty() and metaclass()->oclIsKindOf(Class)

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

### validateIsBinary

    boolean validateIsBinary(org.eclipse.emf.common.util.DiagnosticChain diagnostics,
                             java.util.Map<java.lang.Object,java.lang.Object> context)

  An Extension is binary, i.e., it has only two memberEnds. memberEnd->size() = 2

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

### getStereotypeEnd

    Property getStereotypeEnd()

  Retrieves the extension end that is typed by a stereotype (as opposed to a metaclass).

### getStereotype

    Stereotype getStereotype()

  Retrieves the stereotype that extends a metaclass through this extension.

### metaclassEnd

    Property metaclassEnd()

  The query metaclassEnd() returns the Property that is typed by a metaclass (as opposed to a stereotype). result = memberEnd->reject(ownedEnd)

Copyright 2003, 2007 IBM Corporation and others. All Rights Reserved.