/******************************************************************************* * Copyright (c) 2007, 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.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.v2_0.JPA2_0; import org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package; import org.eclipse.jpt.core.resource.orm.v2_0.XmlEventMethod_2_0; import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject; import org.eclipse.wst.common.internal.emf.resource.Translator; /** * * A representation of the model object 'Event Method'. * * 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. * * *

* The following features are supported: *

*

* * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEventMethod() * @model kind="class" abstract="true" * @generated */ public abstract class EventMethod extends AbstractJpaEObject implements XmlEventMethod_2_0 { /** * The default value of the '{@link #getDescription() Description}' attribute. * * * @see #getDescription() * @generated * @ordered */ protected static final String DESCRIPTION_EDEFAULT = null; /** * The cached value of the '{@link #getDescription() Description}' attribute. * * * @see #getDescription() * @generated * @ordered */ protected String description = DESCRIPTION_EDEFAULT; /** * The default value of the '{@link #getMethodName() Method Name}' attribute. * * * @see #getMethodName() * @generated * @ordered */ protected static final String METHOD_NAME_EDEFAULT = null; /** * The cached value of the '{@link #getMethodName() Method Name}' attribute. * * * @see #getMethodName() * @generated * @ordered */ protected String methodName = METHOD_NAME_EDEFAULT; /** * * * @generated */ protected EventMethod() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return OrmPackage.Literals.EVENT_METHOD; } /** * Returns the value of the 'Description' attribute. * *

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

* * @return the value of the 'Description' attribute. * @see #setDescription(String) * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEventMethod_2_0_Description() * @model dataType="org.eclipse.emf.ecore.xml.type.String" * @generated */ public String getDescription() { return description; } /** * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.EventMethod#getDescription Description}' attribute. * * * @param value the new value of the 'Description' attribute. * @see #getDescription() * @generated */ public void setDescription(String newDescription) { String oldDescription = description; description = newDescription; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.EVENT_METHOD__DESCRIPTION, oldDescription, description)); } /** * Returns the value of the 'Method Name' attribute. * *

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

* * @return the value of the 'Method Name' attribute. * @see #setMethodName(String) * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEventMethod_MethodName() * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true" * @generated */ public String getMethodName() { return methodName; } /** * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.EventMethod#getMethodName Method Name}' attribute. * * * @param value the new value of the 'Method Name' attribute. * @see #getMethodName() * @generated */ public void setMethodName(String newMethodName) { String oldMethodName = methodName; methodName = newMethodName; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.EVENT_METHOD__METHOD_NAME, oldMethodName, methodName)); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case OrmPackage.EVENT_METHOD__DESCRIPTION: return getDescription(); case OrmPackage.EVENT_METHOD__METHOD_NAME: return getMethodName(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case OrmPackage.EVENT_METHOD__DESCRIPTION: setDescription((String)newValue); return; case OrmPackage.EVENT_METHOD__METHOD_NAME: setMethodName((String)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case OrmPackage.EVENT_METHOD__DESCRIPTION: setDescription(DESCRIPTION_EDEFAULT); return; case OrmPackage.EVENT_METHOD__METHOD_NAME: setMethodName(METHOD_NAME_EDEFAULT); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case OrmPackage.EVENT_METHOD__DESCRIPTION: return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description); case OrmPackage.EVENT_METHOD__METHOD_NAME: return METHOD_NAME_EDEFAULT == null ? methodName != null : !METHOD_NAME_EDEFAULT.equals(methodName); } return super.eIsSet(featureID); } /** * * * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (description: "); result.append(description); result.append(", methodName: "); result.append(methodName); result.append(')'); return result.toString(); } // ********** translators ********** protected static Translator[] buildTranslatorChildren() { return new Translator[] { buildMethodNameTranslator(), buildDescriptionTranslator() }; } protected static Translator buildMethodNameTranslator() { return new Translator(JPA.METHOD_NAME, OrmPackage.eINSTANCE.getEventMethod_MethodName(), Translator.DOM_ATTRIBUTE); } protected static Translator buildDescriptionTranslator() { return new Translator(JPA2_0.DESCRIPTION, OrmV2_0Package.eINSTANCE.getXmlEventMethod_2_0_Description()); } }