| /*******************************************************************************
|
| * Copyright (c) 2012, 2013 Oracle. All rights reserved.
|
| * This program and the accompanying materials are made available under the
|
| * terms of the Eclipse Public License 2.0, which accompanies this distribution
|
| * and is available at https://www.eclipse.org/legal/epl-2.0/
|
| *
|
| * SPDX-License-Identifier: EPL-2.0
|
| *
|
| * Contributors:
|
| * Oracle - initial API and implementation
|
| *******************************************************************************/ |
| package org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm;
|
|
|
| import org.eclipse.emf.common.notify.Notification;
|
| import org.eclipse.emf.ecore.EClass;
|
| import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
| import org.eclipse.emf.ecore.EObject;
|
| import org.eclipse.emf.ecore.EStructuralFeature;
|
| import org.eclipse.wst.common.internal.emf.resource.Translator;
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * A representation of the model object '<em><b>EXml Transient</b></em>'.
|
| * <!-- end-user-doc -->
|
| *
|
| * <p>
|
| * The following features are supported:
|
| * <ul>
|
| * <li>{@link org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.EXmlTransient#isXmlLocation <em>Xml Location</em>}</li>
|
| * </ul>
|
| * </p>
|
| *
|
| * @see org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.OxmPackage#getEXmlTransient()
|
| * @model kind="class"
|
| * @generated
|
| */
|
| public class EXmlTransient extends EJavaAttribute
|
| {
|
| /**
|
| * The default value of the '{@link #isXmlLocation() <em>Xml Location</em>}' attribute.
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @see #isXmlLocation()
|
| * @generated
|
| * @ordered
|
| */
|
| protected static final boolean XML_LOCATION_EDEFAULT = false;
|
| /**
|
| * The cached value of the '{@link #isXmlLocation() <em>Xml Location</em>}' attribute.
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @see #isXmlLocation()
|
| * @generated
|
| * @ordered
|
| */
|
| protected boolean xmlLocation = XML_LOCATION_EDEFAULT;
|
|
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| protected EXmlTransient()
|
| {
|
| super();
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| protected EClass eStaticClass()
|
| {
|
| return OxmPackage.Literals.EXML_TRANSIENT;
|
| }
|
|
|
|
|
| /**
|
| * Returns the value of the '<em><b>Xml Location</b></em>' attribute.
|
| * <!-- begin-user-doc -->
|
| * <p>
|
| * If the meaning of the '<em>Xml Location</em>' attribute isn't clear,
|
| * there really should be more of a description here...
|
| * </p>
|
| * <!-- end-user-doc -->
|
| * @return the value of the '<em>Xml Location</em>' attribute.
|
| * @see #setXmlLocation(boolean)
|
| * @see org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.OxmPackage#getEXmlTransient_XmlLocation()
|
| * @model
|
| * @generated
|
| */
|
| public boolean isXmlLocation()
|
| {
|
| return xmlLocation;
|
| }
|
|
|
| /**
|
| * Sets the value of the '{@link org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.EXmlTransient#isXmlLocation <em>Xml Location</em>}' attribute.
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @param value the new value of the '<em>Xml Location</em>' attribute.
|
| * @see #isXmlLocation()
|
| * @generated
|
| */
|
| public void setXmlLocation(boolean newXmlLocation)
|
| {
|
| boolean oldXmlLocation = xmlLocation;
|
| xmlLocation = newXmlLocation;
|
| if (eNotificationRequired())
|
| eNotify(new ENotificationImpl(this, Notification.SET, OxmPackage.EXML_TRANSIENT__XML_LOCATION, oldXmlLocation, xmlLocation));
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| public Object eGet(int featureID, boolean resolve, boolean coreType)
|
| {
|
| switch (featureID)
|
| {
|
| case OxmPackage.EXML_TRANSIENT__XML_LOCATION:
|
| return isXmlLocation();
|
| }
|
| return super.eGet(featureID, resolve, coreType);
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| public void eSet(int featureID, Object newValue)
|
| {
|
| switch (featureID)
|
| {
|
| case OxmPackage.EXML_TRANSIENT__XML_LOCATION:
|
| setXmlLocation((Boolean)newValue);
|
| return;
|
| }
|
| super.eSet(featureID, newValue);
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| public void eUnset(int featureID)
|
| {
|
| switch (featureID)
|
| {
|
| case OxmPackage.EXML_TRANSIENT__XML_LOCATION:
|
| setXmlLocation(XML_LOCATION_EDEFAULT);
|
| return;
|
| }
|
| super.eUnset(featureID);
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| public boolean eIsSet(int featureID)
|
| {
|
| switch (featureID)
|
| {
|
| case OxmPackage.EXML_TRANSIENT__XML_LOCATION:
|
| return xmlLocation != XML_LOCATION_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(" (xmlLocation: ");
|
| result.append(xmlLocation);
|
| result.append(')');
|
| return result.toString();
|
| }
|
|
|
|
|
| // ***** misc *****
|
|
|
| @Override
|
| public String getElementName() {
|
| return Oxm.XML_TRANSIENT;
|
| }
|
|
|
|
|
| // ***** translators *****
|
|
|
| static class XmlTransientTranslator
|
| extends AbstractJavaAttributeTranslator {
|
|
|
| XmlTransientTranslator(String domPathAndName, EStructuralFeature eStructuralFeature) {
|
| super(domPathAndName, eStructuralFeature, buildTranslatorChildren());
|
| }
|
|
|
| private static Translator[] buildTranslatorChildren() {
|
| return new Translator[] {
|
| buildJavaAttributeTranslator(),
|
| buildXmlAccessorTypeTranslator()
|
| };
|
| }
|
|
|
| @Override
|
| public EObject createEMFObject(String nodeName, String readAheadName) {
|
| return OxmFactory.eINSTANCE.createEXmlTransient();
|
| }
|
| }
|
| }
|