| /* |
| * Copyright (c) 2014, 2015, 2018 Eike Stepper (Loehne, Germany) 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: |
| * Eike Stepper - initial API and implementation |
| */ |
| package org.eclipse.oomph.setup.impl; |
| |
| import org.eclipse.oomph.base.impl.ModelElementImpl; |
| import org.eclipse.oomph.setup.AttributeRule; |
| import org.eclipse.oomph.setup.SetupPackage; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.common.util.URI; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Attribute Rule</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.oomph.setup.impl.AttributeRuleImpl#getAttributeURI <em>Attribute URI</em>}</li> |
| * <li>{@link org.eclipse.oomph.setup.impl.AttributeRuleImpl#getValue <em>Value</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class AttributeRuleImpl extends ModelElementImpl implements AttributeRule |
| { |
| /** |
| * The default value of the '{@link #getAttributeURI() <em>Attribute URI</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getAttributeURI() |
| * @generated |
| * @ordered |
| */ |
| protected static final URI ATTRIBUTE_URI_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getAttributeURI() <em>Attribute URI</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getAttributeURI() |
| * @generated |
| * @ordered |
| */ |
| protected URI attributeURI = ATTRIBUTE_URI_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getValue() <em>Value</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getValue() |
| * @generated |
| * @ordered |
| */ |
| protected static final String VALUE_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getValue() <em>Value</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getValue() |
| * @generated |
| * @ordered |
| */ |
| protected String value = VALUE_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected AttributeRuleImpl() |
| { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() |
| { |
| return SetupPackage.Literals.ATTRIBUTE_RULE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public URI getAttributeURI() |
| { |
| return attributeURI; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setAttributeURI(URI newAttributeURI) |
| { |
| URI oldAttributeURI = attributeURI; |
| attributeURI = newAttributeURI; |
| if (eNotificationRequired()) |
| { |
| eNotify(new ENotificationImpl(this, Notification.SET, SetupPackage.ATTRIBUTE_RULE__ATTRIBUTE_URI, oldAttributeURI, attributeURI)); |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getValue() |
| { |
| return value; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setValue(String newValue) |
| { |
| String oldValue = value; |
| value = newValue; |
| if (eNotificationRequired()) |
| { |
| eNotify(new ENotificationImpl(this, Notification.SET, SetupPackage.ATTRIBUTE_RULE__VALUE, oldValue, value)); |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) |
| { |
| switch (featureID) |
| { |
| case SetupPackage.ATTRIBUTE_RULE__ATTRIBUTE_URI: |
| return getAttributeURI(); |
| case SetupPackage.ATTRIBUTE_RULE__VALUE: |
| return getValue(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) |
| { |
| switch (featureID) |
| { |
| case SetupPackage.ATTRIBUTE_RULE__ATTRIBUTE_URI: |
| setAttributeURI((URI)newValue); |
| return; |
| case SetupPackage.ATTRIBUTE_RULE__VALUE: |
| setValue((String)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) |
| { |
| switch (featureID) |
| { |
| case SetupPackage.ATTRIBUTE_RULE__ATTRIBUTE_URI: |
| setAttributeURI(ATTRIBUTE_URI_EDEFAULT); |
| return; |
| case SetupPackage.ATTRIBUTE_RULE__VALUE: |
| setValue(VALUE_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) |
| { |
| switch (featureID) |
| { |
| case SetupPackage.ATTRIBUTE_RULE__ATTRIBUTE_URI: |
| return ATTRIBUTE_URI_EDEFAULT == null ? attributeURI != null : !ATTRIBUTE_URI_EDEFAULT.equals(attributeURI); |
| case SetupPackage.ATTRIBUTE_RULE__VALUE: |
| return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() |
| { |
| if (eIsProxy()) |
| { |
| return super.toString(); |
| } |
| |
| StringBuilder result = new StringBuilder(super.toString()); |
| result.append(" (attributeURI: "); |
| result.append(attributeURI); |
| result.append(", value: "); |
| result.append(value); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } // AttributeRuleImpl |