| /******************************************************************************* |
| * Copyright (c) 2009 Oracle. 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: |
| * Oracle - initial API and implementation |
| *******************************************************************************/ |
| package org.eclipse.jpt.eclipselink1_1.core.resource.orm; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.jpt.core.resource.orm.AccessType; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * A representation of the model object '<em><b>Xml Many To Many Impl</b></em>'. |
| * <!-- end-user-doc --> |
| * |
| * |
| * @see org.eclipse.jpt.eclipselink1_1.core.resource.orm.EclipseLink1_1OrmPackage#getXmlManyToManyImpl() |
| * @model kind="class" |
| * @generated |
| */ |
| public class XmlManyToManyImpl extends org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToManyImpl implements XmlManyToMany |
| { |
| /** |
| * changed this to null and removed the generated flag so emf won't generate over it |
| * we don't want a default for enums, just null if the tag does not exist |
| */ |
| protected static final AccessType ACCESS_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getAccess() <em>Access</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getAccess() |
| * @generated |
| * @ordered |
| */ |
| protected AccessType access = ACCESS_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected XmlManyToManyImpl() |
| { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() |
| { |
| return EclipseLink1_1OrmPackage.Literals.XML_MANY_TO_MANY_IMPL; |
| } |
| |
| /** |
| * Returns the value of the '<em><b>Access</b></em>' attribute. |
| * The default value is <code>"PROPERTY"</code>. |
| * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.AccessType}. |
| * <!-- begin-user-doc --> |
| * <p> |
| * If the meaning of the '<em>Access</em>' attribute isn't clear, |
| * there really should be more of a description here... |
| * </p> |
| * <!-- end-user-doc --> |
| * @return the value of the '<em>Access</em>' attribute. |
| * @see org.eclipse.jpt.core.resource.orm.AccessType |
| * @see #setAccess(AccessType) |
| * @see org.eclipse.jpt.eclipselink1_1.core.resource.orm.EclipseLink1_1OrmPackage#getXmlAttributeMapping_Access() |
| * @model default="PROPERTY" |
| * @generated |
| */ |
| public AccessType getAccess() |
| { |
| return access; |
| } |
| |
| /** |
| * Sets the value of the '{@link org.eclipse.jpt.eclipselink1_1.core.resource.orm.XmlManyToManyImpl#getAccess <em>Access</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @param value the new value of the '<em>Access</em>' attribute. |
| * @see org.eclipse.jpt.core.resource.orm.AccessType |
| * @see #getAccess() |
| * @generated |
| */ |
| public void setAccess(AccessType newAccess) |
| { |
| AccessType oldAccess = access; |
| access = newAccess == null ? ACCESS_EDEFAULT : newAccess; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, EclipseLink1_1OrmPackage.XML_MANY_TO_MANY_IMPL__ACCESS, oldAccess, access)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) |
| { |
| switch (featureID) |
| { |
| case EclipseLink1_1OrmPackage.XML_MANY_TO_MANY_IMPL__ACCESS: |
| return getAccess(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) |
| { |
| switch (featureID) |
| { |
| case EclipseLink1_1OrmPackage.XML_MANY_TO_MANY_IMPL__ACCESS: |
| setAccess((AccessType)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) |
| { |
| switch (featureID) |
| { |
| case EclipseLink1_1OrmPackage.XML_MANY_TO_MANY_IMPL__ACCESS: |
| setAccess(ACCESS_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) |
| { |
| switch (featureID) |
| { |
| case EclipseLink1_1OrmPackage.XML_MANY_TO_MANY_IMPL__ACCESS: |
| return access != ACCESS_EDEFAULT; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) |
| { |
| if (baseClass == XmlAttributeMapping.class) |
| { |
| switch (derivedFeatureID) |
| { |
| case EclipseLink1_1OrmPackage.XML_MANY_TO_MANY_IMPL__ACCESS: return EclipseLink1_1OrmPackage.XML_ATTRIBUTE_MAPPING__ACCESS; |
| default: return -1; |
| } |
| } |
| if (baseClass == XmlManyToMany.class) |
| { |
| switch (derivedFeatureID) |
| { |
| default: return -1; |
| } |
| } |
| return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) |
| { |
| if (baseClass == XmlAttributeMapping.class) |
| { |
| switch (baseFeatureID) |
| { |
| case EclipseLink1_1OrmPackage.XML_ATTRIBUTE_MAPPING__ACCESS: return EclipseLink1_1OrmPackage.XML_MANY_TO_MANY_IMPL__ACCESS; |
| default: return -1; |
| } |
| } |
| if (baseClass == XmlManyToMany.class) |
| { |
| switch (baseFeatureID) |
| { |
| default: return -1; |
| } |
| } |
| return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() |
| { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuffer result = new StringBuffer(super.toString()); |
| result.append(" (access: "); |
| result.append(access); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } // XmlManyToManyImpl |