/** | |
* Copyright (c) 2009 Mia-Software. | |
* 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: | |
* Gregoire DUPE (Mia-Software) - initial API and implementation | |
* | |
* | |
* $Id$ | |
*/ | |
package org.eclipse.gmt.modisco.infra.query.jxpath.impl; | |
import org.eclipse.emf.common.notify.Notification; | |
import org.eclipse.emf.ecore.EClass; | |
import org.eclipse.emf.ecore.impl.ENotificationImpl; | |
import org.eclipse.gmt.modisco.infra.query.impl.ModelQueryImpl; | |
import org.eclipse.gmt.modisco.infra.query.jxpath.JXPathModelQuery; | |
import org.eclipse.gmt.modisco.infra.query.jxpath.JxpathPackage; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model object '<em><b>JX Path Model Query</b></em>'. | |
* <!-- end-user-doc --> | |
* <p> | |
* The following features are implemented: | |
* <ul> | |
* <li>{@link org.eclipse.gmt.modisco.infra.query.jxpath.impl.JXPathModelQueryImpl#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 JXPathModelQueryImpl extends ModelQueryImpl implements JXPathModelQuery { | |
/** | |
* 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 JXPathModelQueryImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return JxpathPackage.Literals.JX_PATH_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, JxpathPackage.JX_PATH_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 JxpathPackage.JX_PATH_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 JxpathPackage.JX_PATH_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 JxpathPackage.JX_PATH_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 JxpathPackage.JX_PATH_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: "); //$NON-NLS-1$ | |
result.append(query); | |
result.append(')'); | |
return result.toString(); | |
} | |
} //JXPathModelQueryImpl |