diff options
author | mtaal | 2009-06-28 02:03:49 +0000 |
---|---|---|
committer | mtaal | 2009-06-28 02:03:49 +0000 |
commit | 38b6726953a808b7336b7b21c81b30e5aecc82ca (patch) | |
tree | d1c03ae94c39ddfdfb3c487afe301dcf771ad6a8 /examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf | |
parent | d5fd138eeb5f4e55f84c9ccf88c432f8d70ce01e (diff) | |
download | org.eclipse.emf.teneo-38b6726953a808b7336b7b21c81b30e5aecc82ca.tar.gz org.eclipse.emf.teneo-38b6726953a808b7336b7b21c81b30e5aecc82ca.tar.xz org.eclipse.emf.teneo-38b6726953a808b7336b7b21c81b30e5aecc82ca.zip |
[280480]
[281705]
Diffstat (limited to 'examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf')
18 files changed, 3556 insertions, 0 deletions
diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/AnyFactory.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/AnyFactory.java new file mode 100644 index 000000000..82e56b65b --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/AnyFactory.java @@ -0,0 +1,64 @@ +/** + * <copyright> + * </copyright> + * + * $Id: AnyFactory.java,v 1.1 2009/06/28 02:03:50 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.any; + +import org.eclipse.emf.ecore.EFactory; + +/** + * <!-- begin-user-doc --> + * The <b>Factory</b> for the model. + * It provides a create method for each non-abstract class of the model. + * <!-- end-user-doc --> + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.AnyPackage + * @generated + */ +public interface AnyFactory extends EFactory { + /** + * The singleton instance of the factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + AnyFactory eINSTANCE = org.eclipse.emf.teneo.samples.emf.annotations.any.impl.AnyFactoryImpl.init(); + + /** + * Returns a new object of class '<em>Object</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Object</em>'. + * @generated + */ + AnyObject createAnyObject(); + + /** + * Returns a new object of class '<em>Document Root</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Document Root</em>'. + * @generated + */ + DocumentRoot createDocumentRoot(); + + /** + * Returns a new object of class '<em>Global Object Type</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Global Object Type</em>'. + * @generated + */ + GlobalObjectType createGlobalObjectType(); + + /** + * Returns the package supported by this factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the package supported by this factory. + * @generated + */ + AnyPackage getAnyPackage(); + +} //AnyFactory diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/AnyObject.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/AnyObject.java new file mode 100644 index 000000000..e781773fd --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/AnyObject.java @@ -0,0 +1,250 @@ +/** + * <copyright> + * </copyright> + * + * $Id: AnyObject.java,v 1.1 2009/06/28 02:03:50 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.any; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.util.FeatureMap; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Object</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * <ul> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.any.AnyObject#getId <em>Id</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.any.AnyObject#getGlobalInt <em>Global Int</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.any.AnyObject#getGlobalString <em>Global String</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.any.AnyObject#getAnyOne <em>Any One</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.any.AnyObject#getAny <em>Any</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.any.AnyObject#getGroup <em>Group</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.any.AnyObject#getAny1 <em>Any1</em>}</li> + * </ul> + * </p> + * + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.AnyPackage#getAnyObject() + * @model extendedMetaData="name='AnyObject' kind='elementOnly'" + * @generated + */ +public interface AnyObject extends EObject { + /** + * Returns the value of the '<em><b>Id</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Id</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Id</em>' attribute. + * @see #isSetId() + * @see #unsetId() + * @see #setId(long) + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.AnyPackage#getAnyObject_Id() + * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Long" required="true" + * annotation="teneo.jpa appinfo='@Id'" + * extendedMetaData="kind='element' name='id'" + * @generated + */ + long getId(); + + /** + * Sets the value of the '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.AnyObject#getId <em>Id</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Id</em>' attribute. + * @see #isSetId() + * @see #unsetId() + * @see #getId() + * @generated + */ + void setId(long value); + + /** + * Unsets the value of the '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.AnyObject#getId <em>Id</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isSetId() + * @see #getId() + * @see #setId(long) + * @generated + */ + void unsetId(); + + /** + * Returns whether the value of the '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.AnyObject#getId <em>Id</em>}' attribute is set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return whether the value of the '<em>Id</em>' attribute is set. + * @see #unsetId() + * @see #getId() + * @see #setId(long) + * @generated + */ + boolean isSetId(); + + /** + * Returns the value of the '<em><b>Global Int</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Global Int</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Global Int</em>' attribute. + * @see #isSetGlobalInt() + * @see #unsetGlobalInt() + * @see #setGlobalInt(int) + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.AnyPackage#getAnyObject_GlobalInt() + * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Int" + * extendedMetaData="kind='element' name='globalInt' namespace='##targetNamespace'" + * @generated + */ + int getGlobalInt(); + + /** + * Sets the value of the '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.AnyObject#getGlobalInt <em>Global Int</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Global Int</em>' attribute. + * @see #isSetGlobalInt() + * @see #unsetGlobalInt() + * @see #getGlobalInt() + * @generated + */ + void setGlobalInt(int value); + + /** + * Unsets the value of the '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.AnyObject#getGlobalInt <em>Global Int</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isSetGlobalInt() + * @see #getGlobalInt() + * @see #setGlobalInt(int) + * @generated + */ + void unsetGlobalInt(); + + /** + * Returns whether the value of the '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.AnyObject#getGlobalInt <em>Global Int</em>}' attribute is set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return whether the value of the '<em>Global Int</em>' attribute is set. + * @see #unsetGlobalInt() + * @see #getGlobalInt() + * @see #setGlobalInt(int) + * @generated + */ + boolean isSetGlobalInt(); + + /** + * Returns the value of the '<em><b>Global String</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Global String</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Global String</em>' attribute. + * @see #setGlobalString(String) + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.AnyPackage#getAnyObject_GlobalString() + * @model dataType="org.eclipse.emf.ecore.xml.type.String" + * extendedMetaData="kind='element' name='globalString' namespace='##targetNamespace'" + * @generated + */ + String getGlobalString(); + + /** + * Sets the value of the '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.AnyObject#getGlobalString <em>Global String</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Global String</em>' attribute. + * @see #getGlobalString() + * @generated + */ + void setGlobalString(String value); + + /** + * Returns the value of the '<em><b>Any One</b></em>' containment reference. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Any One</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Any One</em>' containment reference. + * @see #setAnyOne(EObject) + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.AnyPackage#getAnyObject_AnyOne() + * @model containment="true" required="true" + * annotation="teneo.jpa appinfo='\n\t\t\t\t\t\t@Any( metaColumn = @Column( name =\n\t\t\t\t\t\t\"any_type\" ), fetch=FetchType.EAGER\n\t\t\t\t\t\t)\n\t\t\t\t\t\t@AnyMetaDef(idType =\n\t\t\t\t\t\t\"long\",metaType = \"string\") \n\t\t\t\t\t'" + * extendedMetaData="kind='element' name='anyOne'" + * @generated + */ + EObject getAnyOne(); + + /** + * Sets the value of the '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.AnyObject#getAnyOne <em>Any One</em>}' containment reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Any One</em>' containment reference. + * @see #getAnyOne() + * @generated + */ + void setAnyOne(EObject value); + + /** + * Returns the value of the '<em><b>Any</b></em>' attribute list. + * The list contents are of type {@link org.eclipse.emf.ecore.util.FeatureMap.Entry}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Any</em>' attribute list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Any</em>' attribute list. + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.AnyPackage#getAnyObject_Any() + * @model dataType="org.eclipse.emf.ecore.EFeatureMapEntry" required="true" many="false" + * extendedMetaData="kind='elementWildcard' wildcards='##any' name=':4' processing='lax'" + * @generated + */ + FeatureMap getAny(); + + /** + * Returns the value of the '<em><b>Group</b></em>' attribute list. + * The list contents are of type {@link org.eclipse.emf.ecore.util.FeatureMap.Entry}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Group</em>' attribute list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Group</em>' attribute list. + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.AnyPackage#getAnyObject_Group() + * @model unique="false" dataType="org.eclipse.emf.ecore.EFeatureMapEntry" many="true" + * extendedMetaData="kind='group' name='group:5'" + * @generated + */ + FeatureMap getGroup(); + + /** + * Returns the value of the '<em><b>Any1</b></em>' attribute list. + * The list contents are of type {@link org.eclipse.emf.ecore.util.FeatureMap.Entry}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Any1</em>' attribute list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Any1</em>' attribute list. + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.AnyPackage#getAnyObject_Any1() + * @model unique="false" dataType="org.eclipse.emf.ecore.EFeatureMapEntry" many="true" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='elementWildcard' wildcards='##any' name=':6' processing='lax' group='#group:5'" + * @generated + */ + FeatureMap getAny1(); + +} // AnyObject diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/AnyPackage.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/AnyPackage.java new file mode 100644 index 000000000..ad5ae1048 --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/AnyPackage.java @@ -0,0 +1,597 @@ +/** + * <copyright> + * </copyright> + * + * $Id: AnyPackage.java,v 1.1 2009/06/28 02:03:50 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.any; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +/** + * <!-- begin-user-doc --> + * The <b>Package</b> for the model. + * It contains accessors for the meta objects to represent + * <ul> + * <li>each class,</li> + * <li>each feature of each class,</li> + * <li>each enum,</li> + * <li>and each data type</li> + * </ul> + * <!-- end-user-doc --> + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.AnyFactory + * @model kind="package" + * @generated + */ +public interface AnyPackage extends EPackage { + /** + * The package name. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + String eNAME = "any"; + + /** + * The package namespace URI. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + String eNS_URI = "http://www.eclipse.org/emf/teneo/samples/emf/annotations/any"; + + /** + * The package namespace name. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + String eNS_PREFIX = "any"; + + /** + * The singleton instance of the package. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + AnyPackage eINSTANCE = org.eclipse.emf.teneo.samples.emf.annotations.any.impl.AnyPackageImpl.init(); + + /** + * The meta object id for the '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.impl.AnyObjectImpl <em>Object</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.impl.AnyObjectImpl + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.impl.AnyPackageImpl#getAnyObject() + * @generated + */ + int ANY_OBJECT = 0; + + /** + * The feature id for the '<em><b>Id</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int ANY_OBJECT__ID = 0; + + /** + * The feature id for the '<em><b>Global Int</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int ANY_OBJECT__GLOBAL_INT = 1; + + /** + * The feature id for the '<em><b>Global String</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int ANY_OBJECT__GLOBAL_STRING = 2; + + /** + * The feature id for the '<em><b>Any One</b></em>' containment reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int ANY_OBJECT__ANY_ONE = 3; + + /** + * The feature id for the '<em><b>Any</b></em>' attribute list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int ANY_OBJECT__ANY = 4; + + /** + * The feature id for the '<em><b>Group</b></em>' attribute list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int ANY_OBJECT__GROUP = 5; + + /** + * The feature id for the '<em><b>Any1</b></em>' attribute list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int ANY_OBJECT__ANY1 = 6; + + /** + * The number of structural features of the '<em>Object</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int ANY_OBJECT_FEATURE_COUNT = 7; + + + /** + * The meta object id for the '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.impl.DocumentRootImpl <em>Document Root</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.impl.DocumentRootImpl + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.impl.AnyPackageImpl#getDocumentRoot() + * @generated + */ + int DOCUMENT_ROOT = 1; + + /** + * The feature id for the '<em><b>Mixed</b></em>' attribute list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int DOCUMENT_ROOT__MIXED = 0; + + /** + * The feature id for the '<em><b>XMLNS Prefix Map</b></em>' map. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int DOCUMENT_ROOT__XMLNS_PREFIX_MAP = 1; + + /** + * The feature id for the '<em><b>XSI Schema Location</b></em>' map. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int DOCUMENT_ROOT__XSI_SCHEMA_LOCATION = 2; + + /** + * The feature id for the '<em><b>Global Int</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int DOCUMENT_ROOT__GLOBAL_INT = 3; + + /** + * The feature id for the '<em><b>Global Object</b></em>' containment reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int DOCUMENT_ROOT__GLOBAL_OBJECT = 4; + + /** + * The feature id for the '<em><b>Global String</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int DOCUMENT_ROOT__GLOBAL_STRING = 5; + + /** + * The number of structural features of the '<em>Document Root</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int DOCUMENT_ROOT_FEATURE_COUNT = 6; + + /** + * The meta object id for the '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.impl.GlobalObjectTypeImpl <em>Global Object Type</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.impl.GlobalObjectTypeImpl + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.impl.AnyPackageImpl#getGlobalObjectType() + * @generated + */ + int GLOBAL_OBJECT_TYPE = 2; + + /** + * The feature id for the '<em><b>Name</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int GLOBAL_OBJECT_TYPE__NAME = 0; + + /** + * The number of structural features of the '<em>Global Object Type</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int GLOBAL_OBJECT_TYPE_FEATURE_COUNT = 1; + + + /** + * Returns the meta object for class '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.AnyObject <em>Object</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Object</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.AnyObject + * @generated + */ + EClass getAnyObject(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.AnyObject#getId <em>Id</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Id</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.AnyObject#getId() + * @see #getAnyObject() + * @generated + */ + EAttribute getAnyObject_Id(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.AnyObject#getGlobalInt <em>Global Int</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Global Int</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.AnyObject#getGlobalInt() + * @see #getAnyObject() + * @generated + */ + EAttribute getAnyObject_GlobalInt(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.AnyObject#getGlobalString <em>Global String</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Global String</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.AnyObject#getGlobalString() + * @see #getAnyObject() + * @generated + */ + EAttribute getAnyObject_GlobalString(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.AnyObject#getAnyOne <em>Any One</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the containment reference '<em>Any One</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.AnyObject#getAnyOne() + * @see #getAnyObject() + * @generated + */ + EReference getAnyObject_AnyOne(); + + /** + * Returns the meta object for the attribute list '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.AnyObject#getAny <em>Any</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute list '<em>Any</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.AnyObject#getAny() + * @see #getAnyObject() + * @generated + */ + EAttribute getAnyObject_Any(); + + /** + * Returns the meta object for the attribute list '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.AnyObject#getGroup <em>Group</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute list '<em>Group</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.AnyObject#getGroup() + * @see #getAnyObject() + * @generated + */ + EAttribute getAnyObject_Group(); + + /** + * Returns the meta object for the attribute list '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.AnyObject#getAny1 <em>Any1</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute list '<em>Any1</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.AnyObject#getAny1() + * @see #getAnyObject() + * @generated + */ + EAttribute getAnyObject_Any1(); + + /** + * Returns the meta object for class '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.DocumentRoot <em>Document Root</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Document Root</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.DocumentRoot + * @generated + */ + EClass getDocumentRoot(); + + /** + * Returns the meta object for the attribute list '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.DocumentRoot#getMixed <em>Mixed</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute list '<em>Mixed</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.DocumentRoot#getMixed() + * @see #getDocumentRoot() + * @generated + */ + EAttribute getDocumentRoot_Mixed(); + + /** + * Returns the meta object for the map '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.DocumentRoot#getXMLNSPrefixMap <em>XMLNS Prefix Map</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the map '<em>XMLNS Prefix Map</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.DocumentRoot#getXMLNSPrefixMap() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_XMLNSPrefixMap(); + + /** + * Returns the meta object for the map '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.DocumentRoot#getXSISchemaLocation <em>XSI Schema Location</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the map '<em>XSI Schema Location</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.DocumentRoot#getXSISchemaLocation() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_XSISchemaLocation(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.DocumentRoot#getGlobalInt <em>Global Int</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Global Int</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.DocumentRoot#getGlobalInt() + * @see #getDocumentRoot() + * @generated + */ + EAttribute getDocumentRoot_GlobalInt(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.DocumentRoot#getGlobalObject <em>Global Object</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the containment reference '<em>Global Object</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.DocumentRoot#getGlobalObject() + * @see #getDocumentRoot() + * @generated + */ + EReference getDocumentRoot_GlobalObject(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.DocumentRoot#getGlobalString <em>Global String</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Global String</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.DocumentRoot#getGlobalString() + * @see #getDocumentRoot() + * @generated + */ + EAttribute getDocumentRoot_GlobalString(); + + /** + * Returns the meta object for class '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.GlobalObjectType <em>Global Object Type</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Global Object Type</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.GlobalObjectType + * @generated + */ + EClass getGlobalObjectType(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.GlobalObjectType#getName <em>Name</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Name</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.GlobalObjectType#getName() + * @see #getGlobalObjectType() + * @generated + */ + EAttribute getGlobalObjectType_Name(); + + /** + * Returns the factory that creates the instances of the model. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the factory that creates the instances of the model. + * @generated + */ + AnyFactory getAnyFactory(); + + /** + * <!-- begin-user-doc --> + * Defines literals for the meta objects that represent + * <ul> + * <li>each class,</li> + * <li>each feature of each class,</li> + * <li>each enum,</li> + * <li>and each data type</li> + * </ul> + * <!-- end-user-doc --> + * @generated + */ + interface Literals { + /** + * The meta object literal for the '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.impl.AnyObjectImpl <em>Object</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.impl.AnyObjectImpl + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.impl.AnyPackageImpl#getAnyObject() + * @generated + */ + EClass ANY_OBJECT = eINSTANCE.getAnyObject(); + + /** + * The meta object literal for the '<em><b>Id</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute ANY_OBJECT__ID = eINSTANCE.getAnyObject_Id(); + + /** + * The meta object literal for the '<em><b>Global Int</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute ANY_OBJECT__GLOBAL_INT = eINSTANCE.getAnyObject_GlobalInt(); + + /** + * The meta object literal for the '<em><b>Global String</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute ANY_OBJECT__GLOBAL_STRING = eINSTANCE.getAnyObject_GlobalString(); + + /** + * The meta object literal for the '<em><b>Any One</b></em>' containment reference feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference ANY_OBJECT__ANY_ONE = eINSTANCE.getAnyObject_AnyOne(); + + /** + * The meta object literal for the '<em><b>Any</b></em>' attribute list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute ANY_OBJECT__ANY = eINSTANCE.getAnyObject_Any(); + + /** + * The meta object literal for the '<em><b>Group</b></em>' attribute list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute ANY_OBJECT__GROUP = eINSTANCE.getAnyObject_Group(); + + /** + * The meta object literal for the '<em><b>Any1</b></em>' attribute list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute ANY_OBJECT__ANY1 = eINSTANCE.getAnyObject_Any1(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.impl.DocumentRootImpl <em>Document Root</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.impl.DocumentRootImpl + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.impl.AnyPackageImpl#getDocumentRoot() + * @generated + */ + EClass DOCUMENT_ROOT = eINSTANCE.getDocumentRoot(); + + /** + * The meta object literal for the '<em><b>Mixed</b></em>' attribute list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute DOCUMENT_ROOT__MIXED = eINSTANCE.getDocumentRoot_Mixed(); + + /** + * The meta object literal for the '<em><b>XMLNS Prefix Map</b></em>' map feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference DOCUMENT_ROOT__XMLNS_PREFIX_MAP = eINSTANCE.getDocumentRoot_XMLNSPrefixMap(); + + /** + * The meta object literal for the '<em><b>XSI Schema Location</b></em>' map feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference DOCUMENT_ROOT__XSI_SCHEMA_LOCATION = eINSTANCE.getDocumentRoot_XSISchemaLocation(); + + /** + * The meta object literal for the '<em><b>Global Int</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute DOCUMENT_ROOT__GLOBAL_INT = eINSTANCE.getDocumentRoot_GlobalInt(); + + /** + * The meta object literal for the '<em><b>Global Object</b></em>' containment reference feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference DOCUMENT_ROOT__GLOBAL_OBJECT = eINSTANCE.getDocumentRoot_GlobalObject(); + + /** + * The meta object literal for the '<em><b>Global String</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute DOCUMENT_ROOT__GLOBAL_STRING = eINSTANCE.getDocumentRoot_GlobalString(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.impl.GlobalObjectTypeImpl <em>Global Object Type</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.impl.GlobalObjectTypeImpl + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.impl.AnyPackageImpl#getGlobalObjectType() + * @generated + */ + EClass GLOBAL_OBJECT_TYPE = eINSTANCE.getGlobalObjectType(); + + /** + * The meta object literal for the '<em><b>Name</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute GLOBAL_OBJECT_TYPE__NAME = eINSTANCE.getGlobalObjectType_Name(); + + } + +} //AnyPackage diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/DocumentRoot.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/DocumentRoot.java new file mode 100644 index 000000000..f3f137220 --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/DocumentRoot.java @@ -0,0 +1,171 @@ +/** + * <copyright> + * </copyright> + * + * $Id: DocumentRoot.java,v 1.1 2009/06/28 02:03:50 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.any; + +import org.eclipse.emf.common.util.EMap; + +import org.eclipse.emf.ecore.EObject; + +import org.eclipse.emf.ecore.util.FeatureMap; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Document Root</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * <ul> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.any.DocumentRoot#getMixed <em>Mixed</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.any.DocumentRoot#getXMLNSPrefixMap <em>XMLNS Prefix Map</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.any.DocumentRoot#getXSISchemaLocation <em>XSI Schema Location</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.any.DocumentRoot#getGlobalInt <em>Global Int</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.any.DocumentRoot#getGlobalObject <em>Global Object</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.any.DocumentRoot#getGlobalString <em>Global String</em>}</li> + * </ul> + * </p> + * + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.AnyPackage#getDocumentRoot() + * @model extendedMetaData="name='' kind='mixed'" + * @generated + */ +public interface DocumentRoot extends EObject { + /** + * Returns the value of the '<em><b>Mixed</b></em>' attribute list. + * The list contents are of type {@link org.eclipse.emf.ecore.util.FeatureMap.Entry}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Mixed</em>' attribute list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Mixed</em>' attribute list. + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.AnyPackage#getDocumentRoot_Mixed() + * @model unique="false" dataType="org.eclipse.emf.ecore.EFeatureMapEntry" many="true" + * extendedMetaData="kind='elementWildcard' name=':mixed'" + * @generated + */ + FeatureMap getMixed(); + + /** + * Returns the value of the '<em><b>XMLNS Prefix Map</b></em>' map. + * The key is of type {@link java.lang.String}, + * and the value is of type {@link java.lang.String}, + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>XMLNS Prefix Map</em>' map isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>XMLNS Prefix Map</em>' map. + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.AnyPackage#getDocumentRoot_XMLNSPrefixMap() + * @model mapType="org.eclipse.emf.ecore.EStringToStringMapEntry<org.eclipse.emf.ecore.EString, org.eclipse.emf.ecore.EString>" transient="true" + * extendedMetaData="kind='attribute' name='xmlns:prefix'" + * @generated + */ + EMap<String, String> getXMLNSPrefixMap(); + + /** + * Returns the value of the '<em><b>XSI Schema Location</b></em>' map. + * The key is of type {@link java.lang.String}, + * and the value is of type {@link java.lang.String}, + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>XSI Schema Location</em>' map isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>XSI Schema Location</em>' map. + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.AnyPackage#getDocumentRoot_XSISchemaLocation() + * @model mapType="org.eclipse.emf.ecore.EStringToStringMapEntry<org.eclipse.emf.ecore.EString, org.eclipse.emf.ecore.EString>" transient="true" + * extendedMetaData="kind='attribute' name='xsi:schemaLocation'" + * @generated + */ + EMap<String, String> getXSISchemaLocation(); + + /** + * Returns the value of the '<em><b>Global Int</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Global Int</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Global Int</em>' attribute. + * @see #setGlobalInt(int) + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.AnyPackage#getDocumentRoot_GlobalInt() + * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.Int" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='globalInt' namespace='##targetNamespace'" + * @generated + */ + int getGlobalInt(); + + /** + * Sets the value of the '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.DocumentRoot#getGlobalInt <em>Global Int</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Global Int</em>' attribute. + * @see #getGlobalInt() + * @generated + */ + void setGlobalInt(int value); + + /** + * Returns the value of the '<em><b>Global Object</b></em>' containment reference. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Global Object</em>' containment reference isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Global Object</em>' containment reference. + * @see #setGlobalObject(GlobalObjectType) + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.AnyPackage#getDocumentRoot_GlobalObject() + * @model containment="true" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='globalObject' namespace='##targetNamespace'" + * @generated + */ + GlobalObjectType getGlobalObject(); + + /** + * Sets the value of the '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.DocumentRoot#getGlobalObject <em>Global Object</em>}' containment reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Global Object</em>' containment reference. + * @see #getGlobalObject() + * @generated + */ + void setGlobalObject(GlobalObjectType value); + + /** + * Returns the value of the '<em><b>Global String</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Global String</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Global String</em>' attribute. + * @see #setGlobalString(String) + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.AnyPackage#getDocumentRoot_GlobalString() + * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String" upper="-2" transient="true" volatile="true" derived="true" + * extendedMetaData="kind='element' name='globalString' namespace='##targetNamespace'" + * @generated + */ + String getGlobalString(); + + /** + * Sets the value of the '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.DocumentRoot#getGlobalString <em>Global String</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Global String</em>' attribute. + * @see #getGlobalString() + * @generated + */ + void setGlobalString(String value); + +} // DocumentRoot diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/GlobalObjectType.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/GlobalObjectType.java new file mode 100644 index 000000000..7ebd72ea6 --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/GlobalObjectType.java @@ -0,0 +1,55 @@ +/** + * <copyright> + * </copyright> + * + * $Id: GlobalObjectType.java,v 1.1 2009/06/28 02:03:50 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.any; + +import org.eclipse.emf.ecore.EObject; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Global Object Type</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * <ul> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.any.GlobalObjectType#getName <em>Name</em>}</li> + * </ul> + * </p> + * + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.AnyPackage#getGlobalObjectType() + * @model extendedMetaData="name='globalObject_._type' kind='elementOnly'" + * @generated + */ +public interface GlobalObjectType extends EObject { + /** + * Returns the value of the '<em><b>Name</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Name</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Name</em>' attribute. + * @see #setName(String) + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.AnyPackage#getGlobalObjectType_Name() + * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true" + * extendedMetaData="kind='element' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.GlobalObjectType#getName <em>Name</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Name</em>' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + +} // GlobalObjectType diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/impl/AnyFactoryImpl.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/impl/AnyFactoryImpl.java new file mode 100644 index 000000000..b4f5a82fc --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/impl/AnyFactoryImpl.java @@ -0,0 +1,121 @@ +/** + * <copyright> + * </copyright> + * + * $Id: AnyFactoryImpl.java,v 1.1 2009/06/28 02:03:49 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.any.impl; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.impl.EFactoryImpl; + +import org.eclipse.emf.ecore.plugin.EcorePlugin; + +import org.eclipse.emf.teneo.samples.emf.annotations.any.*; + +/** + * <!-- begin-user-doc --> + * An implementation of the model <b>Factory</b>. + * <!-- end-user-doc --> + * @generated + */ +public class AnyFactoryImpl extends EFactoryImpl implements AnyFactory { + /** + * Creates the default factory implementation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static AnyFactory init() { + try { + AnyFactory theAnyFactory = (AnyFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/emf/teneo/samples/emf/annotations/any"); + if (theAnyFactory != null) { + return theAnyFactory; + } + } + catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new AnyFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public AnyFactoryImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public EObject create(EClass eClass) { + switch (eClass.getClassifierID()) { + case AnyPackage.ANY_OBJECT: return createAnyObject(); + case AnyPackage.DOCUMENT_ROOT: return createDocumentRoot(); + case AnyPackage.GLOBAL_OBJECT_TYPE: return createGlobalObjectType(); + default: + throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); + } + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public AnyObject createAnyObject() { + AnyObjectImpl anyObject = new AnyObjectImpl(); + return anyObject; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public DocumentRoot createDocumentRoot() { + DocumentRootImpl documentRoot = new DocumentRootImpl(); + return documentRoot; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public GlobalObjectType createGlobalObjectType() { + GlobalObjectTypeImpl globalObjectType = new GlobalObjectTypeImpl(); + return globalObjectType; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public AnyPackage getAnyPackage() { + return (AnyPackage)getEPackage(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @deprecated + * @generated + */ + @Deprecated + public static AnyPackage getPackage() { + return AnyPackage.eINSTANCE; + } + +} //AnyFactoryImpl diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/impl/AnyObjectImpl.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/impl/AnyObjectImpl.java new file mode 100644 index 000000000..e6354745d --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/impl/AnyObjectImpl.java @@ -0,0 +1,526 @@ +/** + * <copyright> + * </copyright> + * + * $Id: AnyObjectImpl.java,v 1.1 2009/06/28 02:03:49 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.any.impl; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +import org.eclipse.emf.ecore.util.BasicFeatureMap; +import org.eclipse.emf.ecore.util.FeatureMap; +import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.emf.teneo.samples.emf.annotations.any.AnyObject; +import org.eclipse.emf.teneo.samples.emf.annotations.any.AnyPackage; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Object</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * <ul> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.any.impl.AnyObjectImpl#getId <em>Id</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.any.impl.AnyObjectImpl#getGlobalInt <em>Global Int</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.any.impl.AnyObjectImpl#getGlobalString <em>Global String</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.any.impl.AnyObjectImpl#getAnyOne <em>Any One</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.any.impl.AnyObjectImpl#getAny <em>Any</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.any.impl.AnyObjectImpl#getGroup <em>Group</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.any.impl.AnyObjectImpl#getAny1 <em>Any1</em>}</li> + * </ul> + * </p> + * + * @generated + */ +public class AnyObjectImpl extends EObjectImpl implements AnyObject { + /** + * The default value of the '{@link #getId() <em>Id</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getId() + * @generated + * @ordered + */ + protected static final long ID_EDEFAULT = 0L; + + /** + * The cached value of the '{@link #getId() <em>Id</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getId() + * @generated + * @ordered + */ + protected long id = ID_EDEFAULT; + + /** + * This is true if the Id attribute has been set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + protected boolean idESet; + + /** + * The default value of the '{@link #getGlobalInt() <em>Global Int</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getGlobalInt() + * @generated + * @ordered + */ + protected static final int GLOBAL_INT_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getGlobalInt() <em>Global Int</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getGlobalInt() + * @generated + * @ordered + */ + protected int globalInt = GLOBAL_INT_EDEFAULT; + + /** + * This is true if the Global Int attribute has been set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + protected boolean globalIntESet; + + /** + * The default value of the '{@link #getGlobalString() <em>Global String</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getGlobalString() + * @generated + * @ordered + */ + protected static final String GLOBAL_STRING_EDEFAULT = null; + + /** + * The cached value of the '{@link #getGlobalString() <em>Global String</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getGlobalString() + * @generated + * @ordered + */ + protected String globalString = GLOBAL_STRING_EDEFAULT; + + /** + * The cached value of the '{@link #getAnyOne() <em>Any One</em>}' containment reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getAnyOne() + * @generated + * @ordered + */ + protected EObject anyOne; + + /** + * The cached value of the '{@link #getAny() <em>Any</em>}' attribute list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getAny() + * @generated + * @ordered + */ + protected FeatureMap any; + + /** + * The cached value of the '{@link #getGroup() <em>Group</em>}' attribute list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getGroup() + * @generated + * @ordered + */ + protected FeatureMap group; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected AnyObjectImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return AnyPackage.Literals.ANY_OBJECT; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public long getId() { + return id; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setId(long newId) { + long oldId = id; + id = newId; + boolean oldIdESet = idESet; + idESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, AnyPackage.ANY_OBJECT__ID, oldId, id, !oldIdESet)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void unsetId() { + long oldId = id; + boolean oldIdESet = idESet; + id = ID_EDEFAULT; + idESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, AnyPackage.ANY_OBJECT__ID, oldId, ID_EDEFAULT, oldIdESet)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSetId() { + return idESet; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public int getGlobalInt() { + return globalInt; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setGlobalInt(int newGlobalInt) { + int oldGlobalInt = globalInt; + globalInt = newGlobalInt; + boolean oldGlobalIntESet = globalIntESet; + globalIntESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, AnyPackage.ANY_OBJECT__GLOBAL_INT, oldGlobalInt, globalInt, !oldGlobalIntESet)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void unsetGlobalInt() { + int oldGlobalInt = globalInt; + boolean oldGlobalIntESet = globalIntESet; + globalInt = GLOBAL_INT_EDEFAULT; + globalIntESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, AnyPackage.ANY_OBJECT__GLOBAL_INT, oldGlobalInt, GLOBAL_INT_EDEFAULT, oldGlobalIntESet)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSetGlobalInt() { + return globalIntESet; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String getGlobalString() { + return globalString; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setGlobalString(String newGlobalString) { + String oldGlobalString = globalString; + globalString = newGlobalString; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, AnyPackage.ANY_OBJECT__GLOBAL_STRING, oldGlobalString, globalString)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EObject getAnyOne() { + return anyOne; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public NotificationChain basicSetAnyOne(EObject newAnyOne, NotificationChain msgs) { + EObject oldAnyOne = anyOne; + anyOne = newAnyOne; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AnyPackage.ANY_OBJECT__ANY_ONE, oldAnyOne, newAnyOne); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setAnyOne(EObject newAnyOne) { + if (newAnyOne != anyOne) { + NotificationChain msgs = null; + if (anyOne != null) + msgs = ((InternalEObject)anyOne).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - AnyPackage.ANY_OBJECT__ANY_ONE, null, msgs); + if (newAnyOne != null) + msgs = ((InternalEObject)newAnyOne).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - AnyPackage.ANY_OBJECT__ANY_ONE, null, msgs); + msgs = basicSetAnyOne(newAnyOne, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, AnyPackage.ANY_OBJECT__ANY_ONE, newAnyOne, newAnyOne)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public FeatureMap getAny() { + if (any == null) { + any = new BasicFeatureMap(this, AnyPackage.ANY_OBJECT__ANY); + } + return any; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public FeatureMap getGroup() { + if (group == null) { + group = new BasicFeatureMap(this, AnyPackage.ANY_OBJECT__GROUP); + } + return group; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public FeatureMap getAny1() { + return (FeatureMap)getGroup().<FeatureMap.Entry>list(AnyPackage.Literals.ANY_OBJECT__ANY1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case AnyPackage.ANY_OBJECT__ANY_ONE: + return basicSetAnyOne(null, msgs); + case AnyPackage.ANY_OBJECT__ANY: + return ((InternalEList<?>)getAny()).basicRemove(otherEnd, msgs); + case AnyPackage.ANY_OBJECT__GROUP: + return ((InternalEList<?>)getGroup()).basicRemove(otherEnd, msgs); + case AnyPackage.ANY_OBJECT__ANY1: + return ((InternalEList<?>)getAny1()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case AnyPackage.ANY_OBJECT__ID: + return getId(); + case AnyPackage.ANY_OBJECT__GLOBAL_INT: + return getGlobalInt(); + case AnyPackage.ANY_OBJECT__GLOBAL_STRING: + return getGlobalString(); + case AnyPackage.ANY_OBJECT__ANY_ONE: + return getAnyOne(); + case AnyPackage.ANY_OBJECT__ANY: + if (coreType) return getAny(); + return ((FeatureMap.Internal)getAny()).getWrapper(); + case AnyPackage.ANY_OBJECT__GROUP: + if (coreType) return getGroup(); + return ((FeatureMap.Internal)getGroup()).getWrapper(); + case AnyPackage.ANY_OBJECT__ANY1: + if (coreType) return getAny1(); + return ((FeatureMap.Internal)getAny1()).getWrapper(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case AnyPackage.ANY_OBJECT__ID: + setId((Long)newValue); + return; + case AnyPackage.ANY_OBJECT__GLOBAL_INT: + setGlobalInt((Integer)newValue); + return; + case AnyPackage.ANY_OBJECT__GLOBAL_STRING: + setGlobalString((String)newValue); + return; + case AnyPackage.ANY_OBJECT__ANY_ONE: + setAnyOne((EObject)newValue); + return; + case AnyPackage.ANY_OBJECT__ANY: + ((FeatureMap.Internal)getAny()).set(newValue); + return; + case AnyPackage.ANY_OBJECT__GROUP: + ((FeatureMap.Internal)getGroup()).set(newValue); + return; + case AnyPackage.ANY_OBJECT__ANY1: + ((FeatureMap.Internal)getAny1()).set(newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case AnyPackage.ANY_OBJECT__ID: + unsetId(); + return; + case AnyPackage.ANY_OBJECT__GLOBAL_INT: + unsetGlobalInt(); + return; + case AnyPackage.ANY_OBJECT__GLOBAL_STRING: + setGlobalString(GLOBAL_STRING_EDEFAULT); + return; + case AnyPackage.ANY_OBJECT__ANY_ONE: + setAnyOne((EObject)null); + return; + case AnyPackage.ANY_OBJECT__ANY: + getAny().clear(); + return; + case AnyPackage.ANY_OBJECT__GROUP: + getGroup().clear(); + return; + case AnyPackage.ANY_OBJECT__ANY1: + getAny1().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case AnyPackage.ANY_OBJECT__ID: + return isSetId(); + case AnyPackage.ANY_OBJECT__GLOBAL_INT: + return isSetGlobalInt(); + case AnyPackage.ANY_OBJECT__GLOBAL_STRING: + return GLOBAL_STRING_EDEFAULT == null ? globalString != null : !GLOBAL_STRING_EDEFAULT.equals(globalString); + case AnyPackage.ANY_OBJECT__ANY_ONE: + return anyOne != null; + case AnyPackage.ANY_OBJECT__ANY: + return any != null && !any.isEmpty(); + case AnyPackage.ANY_OBJECT__GROUP: + return group != null && !group.isEmpty(); + case AnyPackage.ANY_OBJECT__ANY1: + return !getAny1().isEmpty(); + } + 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(" (id: "); + if (idESet) result.append(id); else result.append("<unset>"); + result.append(", globalInt: "); + if (globalIntESet) result.append(globalInt); else result.append("<unset>"); + result.append(", globalString: "); + result.append(globalString); + result.append(", any: "); + result.append(any); + result.append(", group: "); + result.append(group); + result.append(')'); + return result.toString(); + } + +} //AnyObjectImpl diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/impl/AnyPackageImpl.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/impl/AnyPackageImpl.java new file mode 100644 index 000000000..4353c6c56 --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/impl/AnyPackageImpl.java @@ -0,0 +1,548 @@ +/** + * <copyright> + * </copyright> + * + * $Id: AnyPackageImpl.java,v 1.1 2009/06/28 02:03:49 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.any.impl; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.impl.EPackageImpl; + +import org.eclipse.emf.ecore.xml.type.XMLTypePackage; + +import org.eclipse.emf.teneo.samples.emf.annotations.any.AnyFactory; +import org.eclipse.emf.teneo.samples.emf.annotations.any.AnyObject; +import org.eclipse.emf.teneo.samples.emf.annotations.any.AnyPackage; +import org.eclipse.emf.teneo.samples.emf.annotations.any.DocumentRoot; +import org.eclipse.emf.teneo.samples.emf.annotations.any.GlobalObjectType; + +/** + * <!-- begin-user-doc --> + * An implementation of the model <b>Package</b>. + * <!-- end-user-doc --> + * @generated + */ +public class AnyPackageImpl extends EPackageImpl implements AnyPackage { + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass anyObjectEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass documentRootEClass = null; + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass globalObjectTypeEClass = null; + + /** + * Creates an instance of the model <b>Package</b>, registered with + * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package + * package URI value. + * <p>Note: the correct way to create the package is via the static + * factory method {@link #init init()}, which also performs + * initialization of the package, or returns the registered package, + * if one already exists. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.ecore.EPackage.Registry + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.AnyPackage#eNS_URI + * @see #init() + * @generated + */ + private AnyPackageImpl() { + super(eNS_URI, AnyFactory.eINSTANCE); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private static boolean isInited = false; + + /** + * Creates, registers, and initializes the <b>Package</b> for this + * model, and for any others upon which it depends. Simple + * dependencies are satisfied by calling this method on all + * dependent packages before doing anything else. This method drives + * initialization for interdependent packages directly, in parallel + * with this package, itself. + * <p>Of this package and its interdependencies, all packages which + * have not yet been registered by their URI values are first created + * and registered. The packages are then initialized in two steps: + * meta-model objects for all of the packages are created before any + * are initialized, since one package's meta-model objects may refer to + * those of another. + * <p>Invocation of this method will not affect any packages that have + * already been initialized. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #eNS_URI + * @see #createPackageContents() + * @see #initializePackageContents() + * @generated + */ + public static AnyPackage init() { + if (isInited) return (AnyPackage)EPackage.Registry.INSTANCE.getEPackage(AnyPackage.eNS_URI); + + // Obtain or create and register package + AnyPackageImpl theAnyPackage = (AnyPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof AnyPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new AnyPackageImpl()); + + isInited = true; + + // Initialize simple dependencies + XMLTypePackage.eINSTANCE.eClass(); + + // Create package meta-data objects + theAnyPackage.createPackageContents(); + + // Initialize created meta-data + theAnyPackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theAnyPackage.freeze(); + + return theAnyPackage; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getAnyObject() { + return anyObjectEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getAnyObject_Id() { + return (EAttribute)anyObjectEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getAnyObject_GlobalInt() { + return (EAttribute)anyObjectEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getAnyObject_GlobalString() { + return (EAttribute)anyObjectEClass.getEStructuralFeatures().get(2); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getAnyObject_AnyOne() { + return (EReference)anyObjectEClass.getEStructuralFeatures().get(3); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getAnyObject_Any() { + return (EAttribute)anyObjectEClass.getEStructuralFeatures().get(4); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getAnyObject_Group() { + return (EAttribute)anyObjectEClass.getEStructuralFeatures().get(5); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getAnyObject_Any1() { + return (EAttribute)anyObjectEClass.getEStructuralFeatures().get(6); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getDocumentRoot() { + return documentRootEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getDocumentRoot_Mixed() { + return (EAttribute)documentRootEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getDocumentRoot_XMLNSPrefixMap() { + return (EReference)documentRootEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getDocumentRoot_XSISchemaLocation() { + return (EReference)documentRootEClass.getEStructuralFeatures().get(2); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getDocumentRoot_GlobalInt() { + return (EAttribute)documentRootEClass.getEStructuralFeatures().get(3); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getDocumentRoot_GlobalObject() { + return (EReference)documentRootEClass.getEStructuralFeatures().get(4); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getDocumentRoot_GlobalString() { + return (EAttribute)documentRootEClass.getEStructuralFeatures().get(5); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getGlobalObjectType() { + return globalObjectTypeEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getGlobalObjectType_Name() { + return (EAttribute)globalObjectTypeEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public AnyFactory getAnyFactory() { + return (AnyFactory)getEFactoryInstance(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private boolean isCreated = false; + + /** + * Creates the meta-model objects for the package. This method is + * guarded to have no affect on any invocation but its first. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void createPackageContents() { + if (isCreated) return; + isCreated = true; + + // Create classes and their features + anyObjectEClass = createEClass(ANY_OBJECT); + createEAttribute(anyObjectEClass, ANY_OBJECT__ID); + createEAttribute(anyObjectEClass, ANY_OBJECT__GLOBAL_INT); + createEAttribute(anyObjectEClass, ANY_OBJECT__GLOBAL_STRING); + createEReference(anyObjectEClass, ANY_OBJECT__ANY_ONE); + createEAttribute(anyObjectEClass, ANY_OBJECT__ANY); + createEAttribute(anyObjectEClass, ANY_OBJECT__GROUP); + createEAttribute(anyObjectEClass, ANY_OBJECT__ANY1); + + documentRootEClass = createEClass(DOCUMENT_ROOT); + createEAttribute(documentRootEClass, DOCUMENT_ROOT__MIXED); + createEReference(documentRootEClass, DOCUMENT_ROOT__XMLNS_PREFIX_MAP); + createEReference(documentRootEClass, DOCUMENT_ROOT__XSI_SCHEMA_LOCATION); + createEAttribute(documentRootEClass, DOCUMENT_ROOT__GLOBAL_INT); + createEReference(documentRootEClass, DOCUMENT_ROOT__GLOBAL_OBJECT); + createEAttribute(documentRootEClass, DOCUMENT_ROOT__GLOBAL_STRING); + + globalObjectTypeEClass = createEClass(GLOBAL_OBJECT_TYPE); + createEAttribute(globalObjectTypeEClass, GLOBAL_OBJECT_TYPE__NAME); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private boolean isInitialized = false; + + /** + * Complete the initialization of the package and its meta-model. This + * method is guarded to have no affect on any invocation but its first. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void initializePackageContents() { + if (isInitialized) return; + isInitialized = true; + + // Initialize package + setName(eNAME); + setNsPrefix(eNS_PREFIX); + setNsURI(eNS_URI); + + // Obtain other dependent packages + XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI); + + // Create type parameters + + // Set bounds for type parameters + + // Add supertypes to classes + + // Initialize classes and features; add operations and parameters + initEClass(anyObjectEClass, AnyObject.class, "AnyObject", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getAnyObject_Id(), theXMLTypePackage.getLong(), "id", null, 1, 1, AnyObject.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getAnyObject_GlobalInt(), theXMLTypePackage.getInt(), "globalInt", null, 0, 1, AnyObject.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getAnyObject_GlobalString(), theXMLTypePackage.getString(), "globalString", null, 0, 1, AnyObject.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getAnyObject_AnyOne(), ecorePackage.getEObject(), null, "anyOne", null, 1, 1, AnyObject.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getAnyObject_Any(), ecorePackage.getEFeatureMapEntry(), "any", null, 1, 1, AnyObject.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getAnyObject_Group(), ecorePackage.getEFeatureMapEntry(), "group", null, 0, -1, AnyObject.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getAnyObject_Any1(), ecorePackage.getEFeatureMapEntry(), "any1", null, 0, -1, AnyObject.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, IS_ORDERED); + + initEClass(documentRootEClass, DocumentRoot.class, "DocumentRoot", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getDocumentRoot_Mixed(), ecorePackage.getEFeatureMapEntry(), "mixed", null, 0, -1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_XMLNSPrefixMap(), ecorePackage.getEStringToStringMapEntry(), null, "xMLNSPrefixMap", null, 0, -1, null, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_XSISchemaLocation(), ecorePackage.getEStringToStringMapEntry(), null, "xSISchemaLocation", null, 0, -1, null, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getDocumentRoot_GlobalInt(), theXMLTypePackage.getInt(), "globalInt", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_GlobalObject(), this.getGlobalObjectType(), null, "globalObject", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEAttribute(getDocumentRoot_GlobalString(), theXMLTypePackage.getString(), "globalString", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, IS_ORDERED); + + initEClass(globalObjectTypeEClass, GlobalObjectType.class, "GlobalObjectType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getGlobalObjectType_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, GlobalObjectType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + // Create resource + createResource(eNS_URI); + + // Create annotations + // http:///org/eclipse/emf/ecore/util/ExtendedMetaData + createExtendedMetaDataAnnotations(); + // teneo.jpa + createTeneoAnnotations(); + } + + /** + * Initializes the annotations for <b>http:///org/eclipse/emf/ecore/util/ExtendedMetaData</b>. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void createExtendedMetaDataAnnotations() { + String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData"; + addAnnotation + (anyObjectEClass, + source, + new String[] { + "name", "AnyObject", + "kind", "elementOnly" + }); + addAnnotation + (getAnyObject_Id(), + source, + new String[] { + "kind", "element", + "name", "id" + }); + addAnnotation + (getAnyObject_GlobalInt(), + source, + new String[] { + "kind", "element", + "name", "globalInt", + "namespace", "##targetNamespace" + }); + addAnnotation + (getAnyObject_GlobalString(), + source, + new String[] { + "kind", "element", + "name", "globalString", + "namespace", "##targetNamespace" + }); + addAnnotation + (getAnyObject_AnyOne(), + source, + new String[] { + "kind", "element", + "name", "anyOne" + }); + addAnnotation + (getAnyObject_Any(), + source, + new String[] { + "kind", "elementWildcard", + "wildcards", "##any", + "name", ":4", + "processing", "lax" + }); + addAnnotation + (getAnyObject_Group(), + source, + new String[] { + "kind", "group", + "name", "group:5" + }); + addAnnotation + (getAnyObject_Any1(), + source, + new String[] { + "kind", "elementWildcard", + "wildcards", "##any", + "name", ":6", + "processing", "lax", + "group", "#group:5" + }); + addAnnotation + (documentRootEClass, + source, + new String[] { + "name", "", + "kind", "mixed" + }); + addAnnotation + (getDocumentRoot_Mixed(), + source, + new String[] { + "kind", "elementWildcard", + "name", ":mixed" + }); + addAnnotation + (getDocumentRoot_XMLNSPrefixMap(), + source, + new String[] { + "kind", "attribute", + "name", "xmlns:prefix" + }); + addAnnotation + (getDocumentRoot_XSISchemaLocation(), + source, + new String[] { + "kind", "attribute", + "name", "xsi:schemaLocation" + }); + addAnnotation + (getDocumentRoot_GlobalInt(), + source, + new String[] { + "kind", "element", + "name", "globalInt", + "namespace", "##targetNamespace" + }); + addAnnotation + (getDocumentRoot_GlobalObject(), + source, + new String[] { + "kind", "element", + "name", "globalObject", + "namespace", "##targetNamespace" + }); + addAnnotation + (getDocumentRoot_GlobalString(), + source, + new String[] { + "kind", "element", + "name", "globalString", + "namespace", "##targetNamespace" + }); + addAnnotation + (globalObjectTypeEClass, + source, + new String[] { + "name", "globalObject_._type", + "kind", "elementOnly" + }); + addAnnotation + (getGlobalObjectType_Name(), + source, + new String[] { + "kind", "element", + "name", "name" + }); + } + + /** + * Initializes the annotations for <b>teneo.jpa</b>. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void createTeneoAnnotations() { + String source = "teneo.jpa"; + addAnnotation + (getAnyObject_Id(), + source, + new String[] { + "appinfo", "@Id" + }); + addAnnotation + (getAnyObject_AnyOne(), + source, + new String[] { + "appinfo", "\n\t\t\t\t\t\t@Any( metaColumn = @Column( name =\n\t\t\t\t\t\t\"any_type\" ), fetch=FetchType.EAGER\n\t\t\t\t\t\t)\n\t\t\t\t\t\t@AnyMetaDef(idType =\n\t\t\t\t\t\t\"long\",metaType = \"string\") \n\t\t\t\t\t" + }); + } + +} //AnyPackageImpl diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/impl/DocumentRootImpl.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/impl/DocumentRootImpl.java new file mode 100644 index 000000000..2e5079c01 --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/impl/DocumentRootImpl.java @@ -0,0 +1,364 @@ +/** + * <copyright> + * </copyright> + * + * $Id: DocumentRootImpl.java,v 1.1 2009/06/28 02:03:49 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.any.impl; + +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EMap; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecore.EcorePackage; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.emf.ecore.impl.EStringToStringMapEntryImpl; + +import org.eclipse.emf.ecore.util.BasicFeatureMap; +import org.eclipse.emf.ecore.util.EcoreEMap; +import org.eclipse.emf.ecore.util.FeatureMap; +import org.eclipse.emf.ecore.util.InternalEList; + +import org.eclipse.emf.teneo.samples.emf.annotations.any.AnyPackage; +import org.eclipse.emf.teneo.samples.emf.annotations.any.DocumentRoot; +import org.eclipse.emf.teneo.samples.emf.annotations.any.GlobalObjectType; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Document Root</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * <ul> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.any.impl.DocumentRootImpl#getMixed <em>Mixed</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.any.impl.DocumentRootImpl#getXMLNSPrefixMap <em>XMLNS Prefix Map</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.any.impl.DocumentRootImpl#getXSISchemaLocation <em>XSI Schema Location</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.any.impl.DocumentRootImpl#getGlobalInt <em>Global Int</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.any.impl.DocumentRootImpl#getGlobalObject <em>Global Object</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.any.impl.DocumentRootImpl#getGlobalString <em>Global String</em>}</li> + * </ul> + * </p> + * + * @generated + */ +public class DocumentRootImpl extends EObjectImpl implements DocumentRoot { + /** + * The cached value of the '{@link #getMixed() <em>Mixed</em>}' attribute list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getMixed() + * @generated + * @ordered + */ + protected FeatureMap mixed; + + /** + * The cached value of the '{@link #getXMLNSPrefixMap() <em>XMLNS Prefix Map</em>}' map. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getXMLNSPrefixMap() + * @generated + * @ordered + */ + protected EMap<String, String> xMLNSPrefixMap; + + /** + * The cached value of the '{@link #getXSISchemaLocation() <em>XSI Schema Location</em>}' map. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getXSISchemaLocation() + * @generated + * @ordered + */ + protected EMap<String, String> xSISchemaLocation; + + /** + * The default value of the '{@link #getGlobalInt() <em>Global Int</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getGlobalInt() + * @generated + * @ordered + */ + protected static final int GLOBAL_INT_EDEFAULT = 0; + + /** + * The default value of the '{@link #getGlobalString() <em>Global String</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getGlobalString() + * @generated + * @ordered + */ + protected static final String GLOBAL_STRING_EDEFAULT = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected DocumentRootImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return AnyPackage.Literals.DOCUMENT_ROOT; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public FeatureMap getMixed() { + if (mixed == null) { + mixed = new BasicFeatureMap(this, AnyPackage.DOCUMENT_ROOT__MIXED); + } + return mixed; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EMap<String, String> getXMLNSPrefixMap() { + if (xMLNSPrefixMap == null) { + xMLNSPrefixMap = new EcoreEMap<String,String>(EcorePackage.Literals.ESTRING_TO_STRING_MAP_ENTRY, EStringToStringMapEntryImpl.class, this, AnyPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP); + } + return xMLNSPrefixMap; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EMap<String, String> getXSISchemaLocation() { + if (xSISchemaLocation == null) { + xSISchemaLocation = new EcoreEMap<String,String>(EcorePackage.Literals.ESTRING_TO_STRING_MAP_ENTRY, EStringToStringMapEntryImpl.class, this, AnyPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION); + } + return xSISchemaLocation; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public int getGlobalInt() { + return (Integer)getMixed().get(AnyPackage.Literals.DOCUMENT_ROOT__GLOBAL_INT, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setGlobalInt(int newGlobalInt) { + ((FeatureMap.Internal)getMixed()).set(AnyPackage.Literals.DOCUMENT_ROOT__GLOBAL_INT, newGlobalInt); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public GlobalObjectType getGlobalObject() { + return (GlobalObjectType)getMixed().get(AnyPackage.Literals.DOCUMENT_ROOT__GLOBAL_OBJECT, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public NotificationChain basicSetGlobalObject(GlobalObjectType newGlobalObject, NotificationChain msgs) { + return ((FeatureMap.Internal)getMixed()).basicAdd(AnyPackage.Literals.DOCUMENT_ROOT__GLOBAL_OBJECT, newGlobalObject, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setGlobalObject(GlobalObjectType newGlobalObject) { + ((FeatureMap.Internal)getMixed()).set(AnyPackage.Literals.DOCUMENT_ROOT__GLOBAL_OBJECT, newGlobalObject); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String getGlobalString() { + return (String)getMixed().get(AnyPackage.Literals.DOCUMENT_ROOT__GLOBAL_STRING, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setGlobalString(String newGlobalString) { + ((FeatureMap.Internal)getMixed()).set(AnyPackage.Literals.DOCUMENT_ROOT__GLOBAL_STRING, newGlobalString); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case AnyPackage.DOCUMENT_ROOT__MIXED: + return ((InternalEList<?>)getMixed()).basicRemove(otherEnd, msgs); + case AnyPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP: + return ((InternalEList<?>)getXMLNSPrefixMap()).basicRemove(otherEnd, msgs); + case AnyPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION: + return ((InternalEList<?>)getXSISchemaLocation()).basicRemove(otherEnd, msgs); + case AnyPackage.DOCUMENT_ROOT__GLOBAL_OBJECT: + return basicSetGlobalObject(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case AnyPackage.DOCUMENT_ROOT__MIXED: + if (coreType) return getMixed(); + return ((FeatureMap.Internal)getMixed()).getWrapper(); + case AnyPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP: + if (coreType) return getXMLNSPrefixMap(); + else return getXMLNSPrefixMap().map(); + case AnyPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION: + if (coreType) return getXSISchemaLocation(); + else return getXSISchemaLocation().map(); + case AnyPackage.DOCUMENT_ROOT__GLOBAL_INT: + return getGlobalInt(); + case AnyPackage.DOCUMENT_ROOT__GLOBAL_OBJECT: + return getGlobalObject(); + case AnyPackage.DOCUMENT_ROOT__GLOBAL_STRING: + return getGlobalString(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case AnyPackage.DOCUMENT_ROOT__MIXED: + ((FeatureMap.Internal)getMixed()).set(newValue); + return; + case AnyPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP: + ((EStructuralFeature.Setting)getXMLNSPrefixMap()).set(newValue); + return; + case AnyPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION: + ((EStructuralFeature.Setting)getXSISchemaLocation()).set(newValue); + return; + case AnyPackage.DOCUMENT_ROOT__GLOBAL_INT: + setGlobalInt((Integer)newValue); + return; + case AnyPackage.DOCUMENT_ROOT__GLOBAL_OBJECT: + setGlobalObject((GlobalObjectType)newValue); + return; + case AnyPackage.DOCUMENT_ROOT__GLOBAL_STRING: + setGlobalString((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case AnyPackage.DOCUMENT_ROOT__MIXED: + getMixed().clear(); + return; + case AnyPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP: + getXMLNSPrefixMap().clear(); + return; + case AnyPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION: + getXSISchemaLocation().clear(); + return; + case AnyPackage.DOCUMENT_ROOT__GLOBAL_INT: + setGlobalInt(GLOBAL_INT_EDEFAULT); + return; + case AnyPackage.DOCUMENT_ROOT__GLOBAL_OBJECT: + setGlobalObject((GlobalObjectType)null); + return; + case AnyPackage.DOCUMENT_ROOT__GLOBAL_STRING: + setGlobalString(GLOBAL_STRING_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case AnyPackage.DOCUMENT_ROOT__MIXED: + return mixed != null && !mixed.isEmpty(); + case AnyPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP: + return xMLNSPrefixMap != null && !xMLNSPrefixMap.isEmpty(); + case AnyPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION: + return xSISchemaLocation != null && !xSISchemaLocation.isEmpty(); + case AnyPackage.DOCUMENT_ROOT__GLOBAL_INT: + return getGlobalInt() != GLOBAL_INT_EDEFAULT; + case AnyPackage.DOCUMENT_ROOT__GLOBAL_OBJECT: + return getGlobalObject() != null; + case AnyPackage.DOCUMENT_ROOT__GLOBAL_STRING: + return GLOBAL_STRING_EDEFAULT == null ? getGlobalString() != null : !GLOBAL_STRING_EDEFAULT.equals(getGlobalString()); + } + 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(" (mixed: "); + result.append(mixed); + result.append(')'); + return result.toString(); + } + +} //DocumentRootImpl diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/impl/GlobalObjectTypeImpl.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/impl/GlobalObjectTypeImpl.java new file mode 100644 index 000000000..786b7e896 --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/impl/GlobalObjectTypeImpl.java @@ -0,0 +1,167 @@ +/** + * <copyright> + * </copyright> + * + * $Id: GlobalObjectTypeImpl.java,v 1.1 2009/06/28 02:03:49 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.any.impl; + +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.impl.EObjectImpl; + +import org.eclipse.emf.teneo.samples.emf.annotations.any.AnyPackage; +import org.eclipse.emf.teneo.samples.emf.annotations.any.GlobalObjectType; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Global Object Type</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * <ul> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.any.impl.GlobalObjectTypeImpl#getName <em>Name</em>}</li> + * </ul> + * </p> + * + * @generated + */ +public class GlobalObjectTypeImpl extends EObjectImpl implements GlobalObjectType { + /** + * The default value of the '{@link #getName() <em>Name</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() <em>Name</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getName() + * @generated + * @ordered + */ + protected String name = NAME_EDEFAULT; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected GlobalObjectTypeImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return AnyPackage.Literals.GLOBAL_OBJECT_TYPE; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String getName() { + return name; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, AnyPackage.GLOBAL_OBJECT_TYPE__NAME, oldName, name)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case AnyPackage.GLOBAL_OBJECT_TYPE__NAME: + return getName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case AnyPackage.GLOBAL_OBJECT_TYPE__NAME: + setName((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case AnyPackage.GLOBAL_OBJECT_TYPE__NAME: + setName(NAME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case AnyPackage.GLOBAL_OBJECT_TYPE__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + } + 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(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //GlobalObjectTypeImpl diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/model/any.ecore b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/model/any.ecore new file mode 100644 index 000000000..b36619aa0 --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/model/any.ecore @@ -0,0 +1,142 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ecore:EPackage xmi:version="2.0" + xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="any" + nsURI="http://www.eclipse.org/emf/teneo/samples/emf/annotations/any" nsPrefix="any"> + <eClassifiers xsi:type="ecore:EClass" name="AnyObject"> + <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData"> + <details key="name" value="AnyObject"/> + <details key="kind" value="elementOnly"/> + </eAnnotations> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Long" + unsettable="true"> + <eAnnotations source="teneo.jpa"> + <details key="appinfo" value="@Id"/> + </eAnnotations> + <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData"> + <details key="kind" value="element"/> + <details key="name" value="id"/> + </eAnnotations> + </eStructuralFeatures> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="globalInt" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Int" + unsettable="true"> + <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData"> + <details key="kind" value="element"/> + <details key="name" value="globalInt"/> + <details key="namespace" value="##targetNamespace"/> + </eAnnotations> + </eStructuralFeatures> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="globalString" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"> + <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData"> + <details key="kind" value="element"/> + <details key="name" value="globalString"/> + <details key="namespace" value="##targetNamespace"/> + </eAnnotations> + </eStructuralFeatures> + <eStructuralFeatures xsi:type="ecore:EReference" name="anyOne" lowerBound="1" + eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EObject" containment="true" + resolveProxies="false"> + <eAnnotations source="teneo.jpa"> + <details key="appinfo" value="
						@Any( metaColumn = @Column( name =
						"any_type" ), fetch=FetchType.EAGER
						)
						@AnyMetaDef(idType =
						"long",metaType = "string") 
					"/> + </eAnnotations> + <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData"> + <details key="kind" value="element"/> + <details key="name" value="anyOne"/> + </eAnnotations> + </eStructuralFeatures> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="any" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFeatureMapEntry"> + <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData"> + <details key="kind" value="elementWildcard"/> + <details key="wildcards" value="##any"/> + <details key="name" value=":4"/> + <details key="processing" value="lax"/> + </eAnnotations> + </eStructuralFeatures> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="group" unique="false" upperBound="-1" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFeatureMapEntry"> + <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData"> + <details key="kind" value="group"/> + <details key="name" value="group:5"/> + </eAnnotations> + </eStructuralFeatures> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="any1" unique="false" upperBound="-1" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFeatureMapEntry" + volatile="true" transient="true" derived="true"> + <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData"> + <details key="kind" value="elementWildcard"/> + <details key="wildcards" value="##any"/> + <details key="name" value=":6"/> + <details key="processing" value="lax"/> + <details key="group" value="#group:5"/> + </eAnnotations> + </eStructuralFeatures> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="DocumentRoot"> + <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData"> + <details key="name" value=""/> + <details key="kind" value="mixed"/> + </eAnnotations> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="mixed" unique="false" upperBound="-1" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFeatureMapEntry"> + <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData"> + <details key="kind" value="elementWildcard"/> + <details key="name" value=":mixed"/> + </eAnnotations> + </eStructuralFeatures> + <eStructuralFeatures xsi:type="ecore:EReference" name="xMLNSPrefixMap" upperBound="-1" + eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EStringToStringMapEntry" + transient="true" containment="true" resolveProxies="false"> + <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData"> + <details key="kind" value="attribute"/> + <details key="name" value="xmlns:prefix"/> + </eAnnotations> + </eStructuralFeatures> + <eStructuralFeatures xsi:type="ecore:EReference" name="xSISchemaLocation" upperBound="-1" + eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EStringToStringMapEntry" + transient="true" containment="true" resolveProxies="false"> + <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData"> + <details key="kind" value="attribute"/> + <details key="name" value="xsi:schemaLocation"/> + </eAnnotations> + </eStructuralFeatures> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="globalInt" unique="false" + upperBound="-2" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Int" + volatile="true" transient="true" derived="true"> + <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData"> + <details key="kind" value="element"/> + <details key="name" value="globalInt"/> + <details key="namespace" value="##targetNamespace"/> + </eAnnotations> + </eStructuralFeatures> + <eStructuralFeatures xsi:type="ecore:EReference" name="globalObject" upperBound="-2" + eType="#//GlobalObjectType" volatile="true" transient="true" derived="true" + containment="true" resolveProxies="false"> + <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData"> + <details key="kind" value="element"/> + <details key="name" value="globalObject"/> + <details key="namespace" value="##targetNamespace"/> + </eAnnotations> + </eStructuralFeatures> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="globalString" unique="false" + upperBound="-2" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String" + volatile="true" transient="true" derived="true"> + <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData"> + <details key="kind" value="element"/> + <details key="name" value="globalString"/> + <details key="namespace" value="##targetNamespace"/> + </eAnnotations> + </eStructuralFeatures> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="GlobalObjectType"> + <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData"> + <details key="name" value="globalObject_._type"/> + <details key="kind" value="elementOnly"/> + </eAnnotations> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"> + <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData"> + <details key="kind" value="element"/> + <details key="name" value="name"/> + </eAnnotations> + </eStructuralFeatures> + </eClassifiers> +</ecore:EPackage> diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/model/any.genmodel b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/model/any.genmodel new file mode 100644 index 000000000..d67cd00b2 --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/model/any.genmodel @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?> +<genmodel:GenModel xmi:version="2.0" + xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" + xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.eclipse.emf.teneo.samples/src" + modelPluginID="org.eclipse.emf.teneo.samples" modelName="Any" importerID="org.eclipse.xsd.ecore.importer" + complianceLevel="6.0" copyrightFields="false"> + <foreignModel>any.xsd</foreignModel> + <genPackages prefix="Any" basePackage="org.eclipse.emf.teneo.samples.emf.annotations" + resource="XML" disposableProviderFactory="true" ecorePackage="any.ecore#/"> + <genClasses ecoreClass="any.ecore#//AnyObject"> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute any.ecore#//AnyObject/id"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute any.ecore#//AnyObject/globalInt"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute any.ecore#//AnyObject/globalString"/> + <genFeatures createChild="false" ecoreFeature="ecore:EReference any.ecore#//AnyObject/anyOne"/> + <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EAttribute any.ecore#//AnyObject/any"/> + <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EAttribute any.ecore#//AnyObject/group"/> + <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EAttribute any.ecore#//AnyObject/any1"/> + </genClasses> + <genClasses ecoreClass="any.ecore#//DocumentRoot"> + <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EAttribute any.ecore#//DocumentRoot/mixed"/> + <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference any.ecore#//DocumentRoot/xMLNSPrefixMap"/> + <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference any.ecore#//DocumentRoot/xSISchemaLocation"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute any.ecore#//DocumentRoot/globalInt"/> + <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference any.ecore#//DocumentRoot/globalObject"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute any.ecore#//DocumentRoot/globalString"/> + </genClasses> + <genClasses ecoreClass="any.ecore#//GlobalObjectType"> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute any.ecore#//GlobalObjectType/name"/> + </genClasses> + </genPackages> +</genmodel:GenModel> diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/model/any.xsd b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/model/any.xsd new file mode 100755 index 000000000..a580757fb --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/model/any.xsd @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsd:schema + targetNamespace="http://www.eclipse.org/emf/teneo/samples/emf/annotations/any" + xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" + xmlns:this="http://www.eclipse.org/emf/teneo/samples/emf/annotations/any" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + + <xsd:complexType name="AnyObject"> + <xsd:sequence> + <xsd:element name="id" type="xsd:long"> + <xsd:annotation> + <xsd:appinfo source="teneo.jpa">@Id</xsd:appinfo> + </xsd:annotation> + </xsd:element> + <xsd:element ref="this:globalInt" minOccurs="0"/> + <xsd:element ref="this:globalString" minOccurs="0"/> + <xsd:element name="anyOne" type="xsd:anyType"> + <xsd:annotation> + <xsd:appinfo source="teneo.jpa"> + @Any( metaColumn = @Column( name = + "any_type" ), fetch=FetchType.EAGER + ) + @AnyMetaDef(idType = + "long",metaType = "string") + </xsd:appinfo> + </xsd:annotation> + </xsd:element> + <xsd:any namespace="##any" processContents="lax" /> + <xsd:choice maxOccurs="unbounded"> + <xsd:any namespace="##any" processContents="lax" /> + </xsd:choice> + </xsd:sequence> + </xsd:complexType> + + <xsd:element name="globalObject"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="name" type="xsd:string"/> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + + <xsd:element name="globalInt" type="xsd:int"/> + <xsd:element name="globalString" type="xsd:string"/> + +</xsd:schema> diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/util/AnyAdapterFactory.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/util/AnyAdapterFactory.java new file mode 100644 index 000000000..d74b0d90c --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/util/AnyAdapterFactory.java @@ -0,0 +1,160 @@ +/** + * <copyright> + * </copyright> + * + * $Id: AnyAdapterFactory.java,v 1.1 2009/06/28 02:03:49 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.any.util; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notifier; + +import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; + +import org.eclipse.emf.ecore.EObject; + +import org.eclipse.emf.teneo.samples.emf.annotations.any.*; + +/** + * <!-- begin-user-doc --> + * The <b>Adapter Factory</b> for the model. + * It provides an adapter <code>createXXX</code> method for each class of the model. + * <!-- end-user-doc --> + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.AnyPackage + * @generated + */ +public class AnyAdapterFactory extends AdapterFactoryImpl { + /** + * The cached model package. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected static AnyPackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public AnyAdapterFactory() { + if (modelPackage == null) { + modelPackage = AnyPackage.eINSTANCE; + } + } + + /** + * Returns whether this factory is applicable for the type of the object. + * <!-- begin-user-doc --> + * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model. + * <!-- end-user-doc --> + * @return whether this factory is applicable for the type of the object. + * @generated + */ + @Override + public boolean isFactoryForType(Object object) { + if (object == modelPackage) { + return true; + } + if (object instanceof EObject) { + return ((EObject)object).eClass().getEPackage() == modelPackage; + } + return false; + } + + /** + * The switch that delegates to the <code>createXXX</code> methods. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected AnySwitch<Adapter> modelSwitch = + new AnySwitch<Adapter>() { + @Override + public Adapter caseAnyObject(AnyObject object) { + return createAnyObjectAdapter(); + } + @Override + public Adapter caseDocumentRoot(DocumentRoot object) { + return createDocumentRootAdapter(); + } + @Override + public Adapter caseGlobalObjectType(GlobalObjectType object) { + return createGlobalObjectTypeAdapter(); + } + @Override + public Adapter defaultCase(EObject object) { + return createEObjectAdapter(); + } + }; + + /** + * Creates an adapter for the <code>target</code>. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param target the object to adapt. + * @return the adapter for the <code>target</code>. + * @generated + */ + @Override + public Adapter createAdapter(Notifier target) { + return modelSwitch.doSwitch((EObject)target); + } + + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.AnyObject <em>Object</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.AnyObject + * @generated + */ + public Adapter createAnyObjectAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.DocumentRoot <em>Document Root</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.DocumentRoot + * @generated + */ + public Adapter createDocumentRootAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.teneo.samples.emf.annotations.any.GlobalObjectType <em>Global Object Type</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.GlobalObjectType + * @generated + */ + public Adapter createGlobalObjectTypeAdapter() { + return null; + } + + /** + * Creates a new adapter for the default case. + * <!-- begin-user-doc --> + * This default implementation returns null. + * <!-- end-user-doc --> + * @return the new adapter. + * @generated + */ + public Adapter createEObjectAdapter() { + return null; + } + +} //AnyAdapterFactory diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/util/AnyResourceFactoryImpl.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/util/AnyResourceFactoryImpl.java new file mode 100644 index 000000000..dc5ac10a7 --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/util/AnyResourceFactoryImpl.java @@ -0,0 +1,56 @@ +/** + * <copyright> + * </copyright> + * + * $Id: AnyResourceFactoryImpl.java,v 1.1 2009/06/28 02:03:49 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.any.util; + +import org.eclipse.emf.common.util.URI; + +import org.eclipse.emf.ecore.resource.Resource; + +import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl; + +import org.eclipse.emf.ecore.xmi.XMLResource; + +/** + * <!-- begin-user-doc --> + * The <b>Resource Factory</b> associated with the package. + * <!-- end-user-doc --> + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.util.AnyResourceImpl + * @generated + */ +public class AnyResourceFactoryImpl extends ResourceFactoryImpl { + /** + * Creates an instance of the resource factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public AnyResourceFactoryImpl() { + super(); + } + + /** + * Creates an instance of the resource. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Resource createResource(URI uri) { + XMLResource result = new AnyResourceImpl(uri); + result.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE); + result.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE); + + result.getDefaultSaveOptions().put(XMLResource.OPTION_SCHEMA_LOCATION, Boolean.TRUE); + + result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE); + result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE); + + result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_LEXICAL_HANDLER, Boolean.TRUE); + return result; + } + +} //AnyResourceFactoryImpl diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/util/AnyResourceImpl.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/util/AnyResourceImpl.java new file mode 100644 index 000000000..49bcf55e0 --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/util/AnyResourceImpl.java @@ -0,0 +1,32 @@ +/** + * <copyright> + * </copyright> + * + * $Id: AnyResourceImpl.java,v 1.1 2009/06/28 02:03:49 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.any.util; + +import org.eclipse.emf.common.util.URI; + +import org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl; + +/** + * <!-- begin-user-doc --> + * The <b>Resource </b> associated with the package. + * <!-- end-user-doc --> + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.util.AnyResourceFactoryImpl + * @generated + */ +public class AnyResourceImpl extends XMLResourceImpl { + /** + * Creates an instance of the resource. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param uri the URI of the new resource. + * @generated + */ + public AnyResourceImpl(URI uri) { + super(uri); + } + +} //AnyResourceImpl diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/util/AnySwitch.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/util/AnySwitch.java new file mode 100644 index 000000000..d4f9d4710 --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/util/AnySwitch.java @@ -0,0 +1,172 @@ +/** + * <copyright> + * </copyright> + * + * $Id: AnySwitch.java,v 1.1 2009/06/28 02:03:49 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.any.util; + +import java.util.List; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; + +import org.eclipse.emf.teneo.samples.emf.annotations.any.*; + +/** + * <!-- begin-user-doc --> + * The <b>Switch</b> for the model's inheritance hierarchy. + * It supports the call {@link #doSwitch(EObject) doSwitch(object)} + * to invoke the <code>caseXXX</code> method for each class of the model, + * starting with the actual class of the object + * and proceeding up the inheritance hierarchy + * until a non-null result is returned, + * which is the result of the switch. + * <!-- end-user-doc --> + * @see org.eclipse.emf.teneo.samples.emf.annotations.any.AnyPackage + * @generated + */ +public class AnySwitch<T> { + /** + * The cached model package + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected static AnyPackage modelPackage; + + /** + * Creates an instance of the switch. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public AnySwitch() { + if (modelPackage == null) { + modelPackage = AnyPackage.eINSTANCE; + } + } + + /** + * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the first non-null result returned by a <code>caseXXX</code> call. + * @generated + */ + public T doSwitch(EObject theEObject) { + return doSwitch(theEObject.eClass(), theEObject); + } + + /** + * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the first non-null result returned by a <code>caseXXX</code> call. + * @generated + */ + protected T doSwitch(EClass theEClass, EObject theEObject) { + if (theEClass.eContainer() == modelPackage) { + return doSwitch(theEClass.getClassifierID(), theEObject); + } + else { + List<EClass> eSuperTypes = theEClass.getESuperTypes(); + return + eSuperTypes.isEmpty() ? + defaultCase(theEObject) : + doSwitch(eSuperTypes.get(0), theEObject); + } + } + + /** + * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the first non-null result returned by a <code>caseXXX</code> call. + * @generated + */ + protected T doSwitch(int classifierID, EObject theEObject) { + switch (classifierID) { + case AnyPackage.ANY_OBJECT: { + AnyObject anyObject = (AnyObject)theEObject; + T result = caseAnyObject(anyObject); + if (result == null) result = defaultCase(theEObject); + return result; + } + case AnyPackage.DOCUMENT_ROOT: { + DocumentRoot documentRoot = (DocumentRoot)theEObject; + T result = caseDocumentRoot(documentRoot); + if (result == null) result = defaultCase(theEObject); + return result; + } + case AnyPackage.GLOBAL_OBJECT_TYPE: { + GlobalObjectType globalObjectType = (GlobalObjectType)theEObject; + T result = caseGlobalObjectType(globalObjectType); + if (result == null) result = defaultCase(theEObject); + return result; + } + default: return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Object</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Object</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseAnyObject(AnyObject object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Document Root</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Document Root</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseDocumentRoot(DocumentRoot object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Global Object Type</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Global Object Type</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseGlobalObjectType(GlobalObjectType object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>EObject</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch, but this is the last case anyway. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>EObject</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) + * @generated + */ + public T defaultCase(EObject object) { + return null; + } + +} //AnySwitch diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/util/AnyXMLProcessor.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/util/AnyXMLProcessor.java new file mode 100644 index 000000000..43d046695 --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/any/util/AnyXMLProcessor.java @@ -0,0 +1,54 @@ +/** + * <copyright> + * </copyright> + * + * $Id: AnyXMLProcessor.java,v 1.1 2009/06/28 02:03:49 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.any.util; + +import java.util.Map; + +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.resource.Resource; + +import org.eclipse.emf.ecore.xmi.util.XMLProcessor; + +import org.eclipse.emf.teneo.samples.emf.annotations.any.AnyPackage; + +/** + * This class contains helper methods to serialize and deserialize XML documents + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ +public class AnyXMLProcessor extends XMLProcessor { + + /** + * Public constructor to instantiate the helper. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public AnyXMLProcessor() { + super((EPackage.Registry.INSTANCE)); + AnyPackage.eINSTANCE.eClass(); + } + + /** + * Register for "*" and "xml" file extensions the AnyResourceFactoryImpl factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected Map<String, Resource.Factory> getRegistrations() { + if (registrations == null) { + super.getRegistrations(); + registrations.put(XML_EXTENSION, new AnyResourceFactoryImpl()); + registrations.put(STAR_EXTENSION, new AnyResourceFactoryImpl()); + } + return registrations; + } + +} //AnyXMLProcessor |