| /** |
| * Copyright (c) 2011, 2016 - Lunifera GmbH (Wien), Loetz GmbH&Co.KG (Heidelberg) |
| * 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 |
| * |
| * Based on ideas from Xtext, Xtend, Xcore |
| * |
| * Contributors: |
| * Florian Pirchner - Initial implementation |
| * |
| */ |
| package org.eclipse.osbp.dsl.semantic.service.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.common.notify.NotificationChain; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.osbp.dsl.semantic.common.types.impl.LLazyResolverImpl; |
| |
| import org.eclipse.osbp.dsl.semantic.service.LValidator; |
| import org.eclipse.osbp.dsl.semantic.service.OSBPServicePackage; |
| |
| import org.eclipse.xtext.common.types.JvmTypeReference; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>LValidator</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.osbp.dsl.semantic.service.impl.LValidatorImpl#getValidatorId <em>Validator Id</em>}</li> |
| * <li>{@link org.eclipse.osbp.dsl.semantic.service.impl.LValidatorImpl#getValidatorType <em>Validator Type</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class LValidatorImpl extends LLazyResolverImpl implements LValidator { |
| /** |
| * The default value of the '{@link #getValidatorId() <em>Validator Id</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getValidatorId() |
| * @generated |
| * @ordered |
| */ |
| protected static final String VALIDATOR_ID_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getValidatorId() <em>Validator Id</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getValidatorId() |
| * @generated |
| * @ordered |
| */ |
| protected String validatorId = VALIDATOR_ID_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getValidatorType() <em>Validator Type</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getValidatorType() |
| * @generated |
| * @ordered |
| */ |
| protected JvmTypeReference validatorType; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected LValidatorImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return OSBPServicePackage.Literals.LVALIDATOR; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getValidatorId() { |
| return validatorId; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setValidatorId(String newValidatorId) { |
| String oldValidatorId = validatorId; |
| validatorId = newValidatorId; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, OSBPServicePackage.LVALIDATOR__VALIDATOR_ID, oldValidatorId, validatorId)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public JvmTypeReference getValidatorType() { |
| return validatorType; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetValidatorType(JvmTypeReference newValidatorType, NotificationChain msgs) { |
| JvmTypeReference oldValidatorType = validatorType; |
| validatorType = newValidatorType; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OSBPServicePackage.LVALIDATOR__VALIDATOR_TYPE, oldValidatorType, newValidatorType); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setValidatorType(JvmTypeReference newValidatorType) { |
| if (newValidatorType != validatorType) { |
| NotificationChain msgs = null; |
| if (validatorType != null) |
| msgs = ((InternalEObject)validatorType).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OSBPServicePackage.LVALIDATOR__VALIDATOR_TYPE, null, msgs); |
| if (newValidatorType != null) |
| msgs = ((InternalEObject)newValidatorType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OSBPServicePackage.LVALIDATOR__VALIDATOR_TYPE, null, msgs); |
| msgs = basicSetValidatorType(newValidatorType, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, OSBPServicePackage.LVALIDATOR__VALIDATOR_TYPE, newValidatorType, newValidatorType)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case OSBPServicePackage.LVALIDATOR__VALIDATOR_TYPE: |
| return basicSetValidatorType(null, msgs); |
| } |
| return super.eInverseRemove(otherEnd, featureID, msgs); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case OSBPServicePackage.LVALIDATOR__VALIDATOR_ID: |
| return getValidatorId(); |
| case OSBPServicePackage.LVALIDATOR__VALIDATOR_TYPE: |
| return getValidatorType(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case OSBPServicePackage.LVALIDATOR__VALIDATOR_ID: |
| setValidatorId((String)newValue); |
| return; |
| case OSBPServicePackage.LVALIDATOR__VALIDATOR_TYPE: |
| setValidatorType((JvmTypeReference)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case OSBPServicePackage.LVALIDATOR__VALIDATOR_ID: |
| setValidatorId(VALIDATOR_ID_EDEFAULT); |
| return; |
| case OSBPServicePackage.LVALIDATOR__VALIDATOR_TYPE: |
| setValidatorType((JvmTypeReference)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case OSBPServicePackage.LVALIDATOR__VALIDATOR_ID: |
| return VALIDATOR_ID_EDEFAULT == null ? validatorId != null : !VALIDATOR_ID_EDEFAULT.equals(validatorId); |
| case OSBPServicePackage.LVALIDATOR__VALIDATOR_TYPE: |
| return validatorType != null; |
| } |
| 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(" (validatorId: "); |
| result.append(validatorId); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //LValidatorImpl |