| /**
|
| * Copyright (c) 2009, 2019 Mia-Software and others.
|
| * All rights reserved. This program and the accompanying materials
|
| * are made available under the terms of the Eclipse Public License v2.0
|
| * which accompanies this distribution, and is available at
|
| * http://www.eclipse.org/legal/epl-v20.html
|
| *
|
| * Contributors:
|
| * Frederic Madiot (Mia-Software) - meta-model design
|
| * Gregoire DUPE (Mia-Software) - design and implementation
|
| *
|
| *
|
| * $Id$
|
| */ |
| package org.eclipse.modisco.infra.query.impl;
|
|
|
| import org.eclipse.emf.common.notify.Notification;
|
| import org.eclipse.emf.ecore.EClass;
|
| import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
| import org.eclipse.modisco.infra.query.OCLModelQuery;
|
| import org.eclipse.modisco.infra.query.QueryPackage;
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * An implementation of the model object '<em><b>OCL Model Query</b></em>'.
|
| * <!-- end-user-doc -->
|
| * <p>
|
| * The following features are implemented:
|
| * <ul>
|
| * <li>{@link org.eclipse.modisco.infra.query.impl.OCLModelQueryImpl#getQuery <em>Query</em>}</li>
|
| * </ul>
|
| * </p>
|
| *
|
| * @generated
|
| * @deprecated replaced by EMF Facet, cf. https://bugs.eclipse.org/bugs/show_bug.cgi?id=470578
|
| */
|
| @Deprecated
|
| public class OCLModelQueryImpl extends ModelQueryImpl implements OCLModelQuery {
|
| /**
|
| * The default value of the '{@link #getQuery() <em>Query</em>}' attribute.
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @see #getQuery()
|
| * @generated
|
| * @ordered
|
| */
|
| protected static final String QUERY_EDEFAULT = null;
|
|
|
| /**
|
| * The cached value of the '{@link #getQuery() <em>Query</em>}' attribute.
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @see #getQuery()
|
| * @generated
|
| * @ordered
|
| */
|
| protected String query = QUERY_EDEFAULT;
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| protected OCLModelQueryImpl() {
|
| super();
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| protected EClass eStaticClass() {
|
| return QueryPackage.Literals.OCL_MODEL_QUERY;
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| public String getQuery() {
|
| return query;
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| public void setQuery(String newQuery) {
|
| String oldQuery = query;
|
| query = newQuery;
|
| if (eNotificationRequired())
|
| eNotify(new ENotificationImpl(this, Notification.SET, QueryPackage.OCL_MODEL_QUERY__QUERY, oldQuery, query));
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| public Object eGet(int featureID, boolean resolve, boolean coreType) {
|
| switch (featureID) {
|
| case QueryPackage.OCL_MODEL_QUERY__QUERY:
|
| return getQuery();
|
| }
|
| return super.eGet(featureID, resolve, coreType);
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| public void eSet(int featureID, Object newValue) {
|
| switch (featureID) {
|
| case QueryPackage.OCL_MODEL_QUERY__QUERY:
|
| setQuery((String)newValue);
|
| return;
|
| }
|
| super.eSet(featureID, newValue);
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| public void eUnset(int featureID) {
|
| switch (featureID) {
|
| case QueryPackage.OCL_MODEL_QUERY__QUERY:
|
| setQuery(QUERY_EDEFAULT);
|
| return;
|
| }
|
| super.eUnset(featureID);
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| public boolean eIsSet(int featureID) {
|
| switch (featureID) {
|
| case QueryPackage.OCL_MODEL_QUERY__QUERY:
|
| return QUERY_EDEFAULT == null ? query != null : !QUERY_EDEFAULT.equals(query);
|
| }
|
| return super.eIsSet(featureID);
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| public String toString() {
|
| if (eIsProxy()) return super.toString();
|
|
|
| StringBuffer result = new StringBuffer(super.toString());
|
| result.append(" (query: ");
|
| result.append(query);
|
| result.append(')');
|
| return result.toString();
|
| }
|
|
|
| } //OCLModelQueryImpl
|