blob: 134224a4a79f45ace9a8ed3b62b136ff9eabf4c4 [file] [log] [blame]
/*******************************************************************************
* 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.core.jpa2.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.resource.xml.translators.SimpleTranslator;
import org.eclipse.wst.common.internal.emf.resource.Translator;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Xml Sequence Generator</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* <ul>
* <li>{@link org.eclipse.jpt.core.jpa2.resource.orm.XmlSequenceGenerator#getCatalog <em>Catalog</em>}</li>
* <li>{@link org.eclipse.jpt.core.jpa2.resource.orm.XmlSequenceGenerator#getSchema <em>Schema</em>}</li>
* </ul>
* </p>
*
* @see org.eclipse.jpt.core.jpa2.resource.orm.Orm2_0Package#getXmlSequenceGenerator()
* @model kind="class"
* @generated
*/
public class XmlSequenceGenerator extends org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator implements XmlGenerator
{
/**
* The default value of the '{@link #getDescription() <em>Description</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDescription()
* @generated
* @ordered
*/
protected static final String DESCRIPTION_EDEFAULT = null;
/**
* The cached value of the '{@link #getDescription() <em>Description</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDescription()
* @generated
* @ordered
*/
protected String description = DESCRIPTION_EDEFAULT;
/**
* The default value of the '{@link #getCatalog() <em>Catalog</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCatalog()
* @generated
* @ordered
*/
protected static final String CATALOG_EDEFAULT = null;
/**
* The cached value of the '{@link #getCatalog() <em>Catalog</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCatalog()
* @generated
* @ordered
*/
protected String catalog = CATALOG_EDEFAULT;
/**
* The default value of the '{@link #getSchema() <em>Schema</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSchema()
* @generated
* @ordered
*/
protected static final String SCHEMA_EDEFAULT = null;
/**
* The cached value of the '{@link #getSchema() <em>Schema</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSchema()
* @generated
* @ordered
*/
protected String schema = SCHEMA_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected XmlSequenceGenerator()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return Orm2_0Package.Literals.XML_SEQUENCE_GENERATOR;
}
/**
* Returns the value of the '<em><b>Description</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Description</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Description</em>' attribute.
* @see #setDescription(String)
* @see org.eclipse.jpt.core.jpa2.resource.orm.Orm2_0Package#getXmlGenerator_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.jpa2.resource.orm.XmlSequenceGenerator#getDescription <em>Description</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Description</em>' attribute.
* @see #getDescription()
* @generated
*/
public void setDescription(String newDescription)
{
String oldDescription = description;
description = newDescription;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Orm2_0Package.XML_SEQUENCE_GENERATOR__DESCRIPTION, oldDescription, description));
}
/**
* Returns the value of the '<em><b>Catalog</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Catalog</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Catalog</em>' attribute.
* @see #setCatalog(String)
* @see org.eclipse.jpt.core.jpa2.resource.orm.Orm2_0Package#getXmlSequenceGenerator_Catalog()
* @model dataType="org.eclipse.emf.ecore.xml.type.String"
* @generated
*/
public String getCatalog()
{
return catalog;
}
/**
* Sets the value of the '{@link org.eclipse.jpt.core.jpa2.resource.orm.XmlSequenceGenerator#getCatalog <em>Catalog</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Catalog</em>' attribute.
* @see #getCatalog()
* @generated
*/
public void setCatalog(String newCatalog)
{
String oldCatalog = catalog;
catalog = newCatalog;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Orm2_0Package.XML_SEQUENCE_GENERATOR__CATALOG, oldCatalog, catalog));
}
/**
* Returns the value of the '<em><b>Schema</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Schema</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Schema</em>' attribute.
* @see #setSchema(String)
* @see org.eclipse.jpt.core.jpa2.resource.orm.Orm2_0Package#getXmlSequenceGenerator_Schema()
* @model dataType="org.eclipse.emf.ecore.xml.type.String"
* @generated
*/
public String getSchema()
{
return schema;
}
/**
* Sets the value of the '{@link org.eclipse.jpt.core.jpa2.resource.orm.XmlSequenceGenerator#getSchema <em>Schema</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Schema</em>' attribute.
* @see #getSchema()
* @generated
*/
public void setSchema(String newSchema)
{
String oldSchema = schema;
schema = newSchema;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Orm2_0Package.XML_SEQUENCE_GENERATOR__SCHEMA, oldSchema, schema));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case Orm2_0Package.XML_SEQUENCE_GENERATOR__DESCRIPTION:
return getDescription();
case Orm2_0Package.XML_SEQUENCE_GENERATOR__CATALOG:
return getCatalog();
case Orm2_0Package.XML_SEQUENCE_GENERATOR__SCHEMA:
return getSchema();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case Orm2_0Package.XML_SEQUENCE_GENERATOR__DESCRIPTION:
setDescription((String)newValue);
return;
case Orm2_0Package.XML_SEQUENCE_GENERATOR__CATALOG:
setCatalog((String)newValue);
return;
case Orm2_0Package.XML_SEQUENCE_GENERATOR__SCHEMA:
setSchema((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case Orm2_0Package.XML_SEQUENCE_GENERATOR__DESCRIPTION:
setDescription(DESCRIPTION_EDEFAULT);
return;
case Orm2_0Package.XML_SEQUENCE_GENERATOR__CATALOG:
setCatalog(CATALOG_EDEFAULT);
return;
case Orm2_0Package.XML_SEQUENCE_GENERATOR__SCHEMA:
setSchema(SCHEMA_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case Orm2_0Package.XML_SEQUENCE_GENERATOR__DESCRIPTION:
return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description);
case Orm2_0Package.XML_SEQUENCE_GENERATOR__CATALOG:
return CATALOG_EDEFAULT == null ? catalog != null : !CATALOG_EDEFAULT.equals(catalog);
case Orm2_0Package.XML_SEQUENCE_GENERATOR__SCHEMA:
return SCHEMA_EDEFAULT == null ? schema != null : !SCHEMA_EDEFAULT.equals(schema);
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
{
if (baseClass == XmlGenerator.class)
{
switch (derivedFeatureID)
{
case Orm2_0Package.XML_SEQUENCE_GENERATOR__DESCRIPTION: return Orm2_0Package.XML_GENERATOR__DESCRIPTION;
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 == XmlGenerator.class)
{
switch (baseFeatureID)
{
case Orm2_0Package.XML_GENERATOR__DESCRIPTION: return Orm2_0Package.XML_SEQUENCE_GENERATOR__DESCRIPTION;
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(" (description: ");
result.append(description);
result.append(", catalog: ");
result.append(catalog);
result.append(", schema: ");
result.append(schema);
result.append(')');
return result.toString();
}
// ********** translators **********
public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
return new SimpleTranslator(
elementName,
structuralFeature,
Orm2_0Package.eINSTANCE.getXmlSequenceGenerator(),
buildTranslatorChildren());
}
private static Translator[] buildTranslatorChildren() {
return new Translator[] {
buildNameTranslator(),
buildSequenceNameTranslator(),
buildInitialValueTranslator(),
buildAllocationSizeTranslator(),
buildDescriptionTranslator(),
buildCatalogTranslator(),
buildSchemaTranslator(),
};
}
protected static Translator buildDescriptionTranslator() {
return new Translator(JPA.DESCRIPTION, Orm2_0Package.eINSTANCE.getXmlGenerator_Description());
}
protected static Translator buildCatalogTranslator() {
return new Translator(JPA.CATALOG, Orm2_0Package.eINSTANCE.getXmlSequenceGenerator_Catalog());
}
protected static Translator buildSchemaTranslator() {
return new Translator(JPA.SCHEMA, Orm2_0Package.eINSTANCE.getXmlSequenceGenerator_Schema());
}
} // XmlSequenceGenerator