| /******************************************************************************* |
| * Copyright (c) 2008, 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.eclipselink.core.resource.orm; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.EStructuralFeature; |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.jpt.core.internal.utility.translators.SimpleTranslator; |
| import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject; |
| import org.eclipse.jpt.core.resource.xml.JpaEObject; |
| import org.eclipse.wst.common.internal.emf.resource.Translator; |
| |
| /** |
| * <!-- begin-user-doc --> |
| |
| * A representation of the model object '<em><b>Xml Change Tracking</b></em>'. |
| * |
| * Provisional API: This interface is part of an interim API that is still |
| * under development and expected to change significantly before reaching |
| * stability. It is available at this early stage to solicit feedback from |
| * pioneering adopters on the understanding that any code that uses this API |
| * will almost certainly be broken (repeatedly) as the API evolves. |
| * |
| * @version 2.1 |
| * @since 2.1 |
| * |
| * <!-- end-user-doc --> |
| * |
| * <p> |
| * The following features are supported: |
| * <ul> |
| * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlChangeTracking#getType <em>Type</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlChangeTracking() |
| * @model kind="class" |
| * @extends JpaEObject |
| * @generated |
| */ |
| public class XmlChangeTracking extends AbstractJpaEObject implements JpaEObject |
| { |
| /** |
| * 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 XmlChangeTrackingType TYPE_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getType() <em>Type</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getType() |
| * @generated |
| * @ordered |
| */ |
| protected XmlChangeTrackingType type = TYPE_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected XmlChangeTracking() |
| { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() |
| { |
| return EclipseLinkOrmPackage.Literals.XML_CHANGE_TRACKING; |
| } |
| |
| /** |
| * Returns the value of the '<em><b>Type</b></em>' attribute. |
| * The literals are from the enumeration {@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlChangeTrackingType}. |
| * <!-- begin-user-doc --> |
| * <p> |
| * If the meaning of the '<em>Type</em>' attribute isn't clear, |
| * there really should be more of a description here... |
| * </p> |
| * <!-- end-user-doc --> |
| * @return the value of the '<em>Type</em>' attribute. |
| * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlChangeTrackingType |
| * @see #setType(XmlChangeTrackingType) |
| * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlChangeTracking_Type() |
| * @model |
| * @generated |
| */ |
| public XmlChangeTrackingType getType() |
| { |
| return type; |
| } |
| |
| /** |
| * Sets the value of the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlChangeTracking#getType <em>Type</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @param value the new value of the '<em>Type</em>' attribute. |
| * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlChangeTrackingType |
| * @see #getType() |
| * @generated |
| */ |
| public void setType(XmlChangeTrackingType newType) |
| { |
| XmlChangeTrackingType oldType = type; |
| type = newType == null ? TYPE_EDEFAULT : newType; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CHANGE_TRACKING__TYPE, oldType, type)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) |
| { |
| switch (featureID) |
| { |
| case EclipseLinkOrmPackage.XML_CHANGE_TRACKING__TYPE: |
| return getType(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) |
| { |
| switch (featureID) |
| { |
| case EclipseLinkOrmPackage.XML_CHANGE_TRACKING__TYPE: |
| setType((XmlChangeTrackingType)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) |
| { |
| switch (featureID) |
| { |
| case EclipseLinkOrmPackage.XML_CHANGE_TRACKING__TYPE: |
| setType(TYPE_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) |
| { |
| switch (featureID) |
| { |
| case EclipseLinkOrmPackage.XML_CHANGE_TRACKING__TYPE: |
| return type != TYPE_EDEFAULT; |
| } |
| 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(" (type: "); |
| result.append(type); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| // ********** translators ********** |
| |
| public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) { |
| return new SimpleTranslator(elementName, structuralFeature, Translator.END_TAG_NO_INDENT, buildTranslatorChildren()); |
| } |
| |
| private static Translator[] buildTranslatorChildren() { |
| return new Translator[] { |
| buildTypeTranslator() |
| }; |
| } |
| |
| protected static Translator buildTypeTranslator() { |
| return new Translator(EclipseLink.TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlChangeTracking_Type(), Translator.DOM_ATTRIBUTE); |
| } |
| |
| } // XmlChangeTracking |