blob: 28326bfd4a20204c3cb9faf8defbf7807230c2a1 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2015 David Carlson 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:
* David Carlson (Clinical Cloud Solutions, LLC) - initial API and implementation
*******************************************************************************/
/**
*/
package org.eclipse.mdht.uml.aml.constraint.impl;
import java.lang.reflect.InvocationTargetException;
import java.util.Map;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.BasicDiagnostic;
import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.common.util.DiagnosticChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.emf.ecore.plugin.EcorePlugin;
import org.eclipse.emf.ecore.util.EObjectValidator;
import org.eclipse.mdht.uml.aml.constraint.ArchetypeDefinition;
import org.eclipse.mdht.uml.aml.constraint.ConstraintPackage;
import org.eclipse.mdht.uml.aml.constraint.util.ConstraintValidator;
import org.eclipse.uml2.uml.Usage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Archetype Definition</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.mdht.uml.aml.constraint.impl.ArchetypeDefinitionImpl#getBase_Usage <em>Base Usage</em>}</li>
* </ul>
*
* @generated
*/
public class ArchetypeDefinitionImpl extends MinimalEObjectImpl.Container implements ArchetypeDefinition {
/**
* The cached value of the '{@link #getBase_Usage() <em>Base Usage</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getBase_Usage()
* @generated
* @ordered
*/
protected Usage base_Usage;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ArchetypeDefinitionImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ConstraintPackage.Literals.ARCHETYPE_DEFINITION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Usage getBase_Usage() {
if (base_Usage != null && base_Usage.eIsProxy()) {
InternalEObject oldBase_Usage = (InternalEObject)base_Usage;
base_Usage = (Usage)eResolveProxy(oldBase_Usage);
if (base_Usage != oldBase_Usage) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, ConstraintPackage.ARCHETYPE_DEFINITION__BASE_USAGE, oldBase_Usage, base_Usage));
}
}
return base_Usage;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Usage basicGetBase_Usage() {
return base_Usage;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setBase_Usage(Usage newBase_Usage) {
Usage oldBase_Usage = base_Usage;
base_Usage = newBase_Usage;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ConstraintPackage.ARCHETYPE_DEFINITION__BASE_USAGE, oldBase_Usage, base_Usage));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean validateAOMARCHETYPEHRIDInvariantRmClassNameValidity(DiagnosticChain diagnostics, Map<Object, Object> context) {
// TODO: implement this method
// -> specify the condition that violates the invariant
// -> verify the details of the diagnostic, including severity and message
// Ensure that you remove @generated or mark it @generated NOT
if (false) {
if (diagnostics != null) {
diagnostics.add
(new BasicDiagnostic
(Diagnostic.ERROR,
ConstraintValidator.DIAGNOSTIC_SOURCE,
ConstraintValidator.ARCHETYPE_DEFINITION__AOMARCHETYPEHRID_INVARIANT_RM_CLASS_NAME_VALIDITY,
EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "validateAOMARCHETYPEHRIDInvariantRmClassNameValidity", EObjectValidator.getObjectLabel(this, context) }),
new Object [] { this }));
}
return false;
}
return true;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ConstraintPackage.ARCHETYPE_DEFINITION__BASE_USAGE:
if (resolve) return getBase_Usage();
return basicGetBase_Usage();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ConstraintPackage.ARCHETYPE_DEFINITION__BASE_USAGE:
setBase_Usage((Usage)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ConstraintPackage.ARCHETYPE_DEFINITION__BASE_USAGE:
setBase_Usage((Usage)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ConstraintPackage.ARCHETYPE_DEFINITION__BASE_USAGE:
return base_Usage != null;
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
@SuppressWarnings("unchecked")
public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException {
switch (operationID) {
case ConstraintPackage.ARCHETYPE_DEFINITION___VALIDATE_AOMARCHETYPEHRID_INVARIANT_RM_CLASS_NAME_VALIDITY__DIAGNOSTICCHAIN_MAP:
return validateAOMARCHETYPEHRIDInvariantRmClassNameValidity((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1));
}
return super.eInvoke(operationID, arguments);
}
} //ArchetypeDefinitionImpl