/******************************************************************************* * 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.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; /** * * A representation of the model object 'Xml Copy Policy'. * * 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.2 * @since 2.2 * * * *

* The following features are supported: *

*

* * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCopyPolicy() * @model kind="class" * @extends JpaEObject * @generated */ public class XmlCopyPolicy extends AbstractJpaEObject implements JpaEObject { /** * The default value of the '{@link #getClass_() Class}' attribute. * * * @see #getClass_() * @generated * @ordered */ protected static final String CLASS_EDEFAULT = null; /** * The cached value of the '{@link #getClass_() Class}' attribute. * * * @see #getClass_() * @generated * @ordered */ protected String class_ = CLASS_EDEFAULT; /** * * * @generated */ protected XmlCopyPolicy() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return EclipseLinkOrmPackage.Literals.XML_COPY_POLICY; } /** * Returns the value of the 'Class' attribute. * *

* If the meaning of the 'Class' attribute isn't clear, * there really should be more of a description here... *

* * @return the value of the 'Class' attribute. * @see #setClass(String) * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCopyPolicy_Class() * @model dataType="org.eclipse.emf.ecore.xml.type.String" * @generated */ public String getClass_() { return class_; } /** * Sets the value of the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlCopyPolicy#getClass_ Class}' attribute. * * * @param value the new value of the 'Class' attribute. * @see #getClass_() * @generated */ public void setClass(String newClass) { String oldClass = class_; class_ = newClass; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_COPY_POLICY__CLASS, oldClass, class_)); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case EclipseLinkOrmPackage.XML_COPY_POLICY__CLASS: return getClass_(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case EclipseLinkOrmPackage.XML_COPY_POLICY__CLASS: setClass((String)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case EclipseLinkOrmPackage.XML_COPY_POLICY__CLASS: setClass(CLASS_EDEFAULT); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case EclipseLinkOrmPackage.XML_COPY_POLICY__CLASS: return CLASS_EDEFAULT == null ? class_ != null : !CLASS_EDEFAULT.equals(class_); } return super.eIsSet(featureID); } /** * * * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (class: "); result.append(class_); result.append(')'); return result.toString(); } // ********** translators ********** public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) { return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren()); } private static Translator[] buildTranslatorChildren() { return new Translator[] { buildClassTranslator() }; } protected static Translator buildClassTranslator() { return new Translator(EclipseLink.COPY_POLICY__CLASS, EclipseLinkOrmPackage.eINSTANCE.getXmlCopyPolicy_Class(), Translator.DOM_ATTRIBUTE); } } // XmlCopyPolicy