| /******************************************************************************* |
| * Copyright (c) 2009, 2011 SAP AG 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: |
| * SAP AG - initial API and implementation |
| ****************************************************************************** |
| * $Id: SimpleTypeImpl.java,v 1.2 2011/03/05 21:37:36 auhl Exp $ |
| */ |
| package integration.xsd.impl; |
| |
| import integration.xsd.SimpleContent; |
| import integration.xsd.SimpleType; |
| import integration.xsd.XsdPackage; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Simple Type</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link integration.xsd.impl.SimpleTypeImpl#getContent <em>Content</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class SimpleTypeImpl extends AbstractTypeImpl implements SimpleType { |
| /** |
| * The cached value of the '{@link #getContent() <em>Content</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getContent() |
| * @generated |
| * @ordered |
| */ |
| protected SimpleContent content; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected SimpleTypeImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return XsdPackage.Literals.SIMPLE_TYPE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public SimpleContent getContent() { |
| if (content != null && content.eIsProxy()) { |
| InternalEObject oldContent = (InternalEObject)content; |
| content = (SimpleContent)eResolveProxy(oldContent); |
| if (content != oldContent) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, XsdPackage.SIMPLE_TYPE__CONTENT, oldContent, content)); |
| } |
| } |
| return content; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public SimpleContent basicGetContent() { |
| return content; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setContent(SimpleContent newContent) { |
| SimpleContent oldContent = content; |
| content = newContent; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, XsdPackage.SIMPLE_TYPE__CONTENT, oldContent, content)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case XsdPackage.SIMPLE_TYPE__CONTENT: |
| if (resolve) return getContent(); |
| return basicGetContent(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case XsdPackage.SIMPLE_TYPE__CONTENT: |
| setContent((SimpleContent)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case XsdPackage.SIMPLE_TYPE__CONTENT: |
| setContent((SimpleContent)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case XsdPackage.SIMPLE_TYPE__CONTENT: |
| return content != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //SimpleTypeImpl |