Search in sources :

Example 71 with EcorePackage

use of org.eclipse.emf.ecore.EcorePackage in project xtext-core by eclipse.

the class LiveContainerBuilderIntegerationTestLanguagePackageImpl method initializePackageContents.

/**
 * 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
    EcorePackage theEcorePackage = (EcorePackage) EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
    // Create type parameters
    // Set bounds for type parameters
    // Add supertypes to classes
    // Initialize classes and features; add operations and parameters
    initEClass(modelEClass, Model.class, "Model", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEAttribute(getModel_Name(), theEcorePackage.getEString(), "name", null, 0, 1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    // Create resource
    createResource(eNS_URI);
}
Also used : EcorePackage(org.eclipse.emf.ecore.EcorePackage)

Example 72 with EcorePackage

use of org.eclipse.emf.ecore.EcorePackage in project xtext-core by eclipse.

the class EClassInfoTest method testContainsCompatibleFeature_01.

@Test
public void testContainsCompatibleFeature_01() throws Exception {
    EcorePackage pack = EcorePackage.eINSTANCE;
    EClass eClass = pack.getEClass();
    EClassInfo objectUnderTest = new EClassifierInfo.EClassInfo(eClass, false, Collections.<String>emptySet(), null);
    assertEquals(true, objectUnderTest.containsCompatibleFeature("name", false, true, pack.getEString(), new StringBuilder()));
    assertEquals(false, objectUnderTest.containsCompatibleFeature("name", true, true, pack.getEString(), new StringBuilder()));
    assertEquals(false, objectUnderTest.containsCompatibleFeature("name", true, true, pack.getEAnnotation(), new StringBuilder()));
    assertEquals(false, objectUnderTest.containsCompatibleFeature("name", true, true, pack.getEShort(), new StringBuilder()));
    assertEquals(false, objectUnderTest.containsCompatibleFeature("names", false, true, pack.getEString(), new StringBuilder()));
    assertEquals(true, objectUnderTest.containsCompatibleFeature("eStructuralFeatures", true, true, pack.getEAttribute(), new StringBuilder()));
    assertEquals(true, objectUnderTest.containsCompatibleFeature("eStructuralFeatures", true, true, pack.getEReference(), new StringBuilder()));
    assertEquals(true, objectUnderTest.containsCompatibleFeature("eStructuralFeatures", true, true, pack.getEStructuralFeature(), new StringBuilder()));
    assertEquals(false, objectUnderTest.containsCompatibleFeature("eStructuralFeatures", false, true, pack.getEStructuralFeature(), new StringBuilder()));
    assertEquals(false, objectUnderTest.containsCompatibleFeature("eStructuralFeatures", true, true, pack.getEAnnotation(), new StringBuilder()));
}
Also used : EClass(org.eclipse.emf.ecore.EClass) EClassInfo(org.eclipse.xtext.xtext.ecoreInference.EClassifierInfo.EClassInfo) EcorePackage(org.eclipse.emf.ecore.EcorePackage) Test(org.junit.Test)

Example 73 with EcorePackage

use of org.eclipse.emf.ecore.EcorePackage in project xtext-core by eclipse.

the class EClassInfoTest method testContainsCompatibleFeature_02.

@Test
public void testContainsCompatibleFeature_02() throws Exception {
    EcorePackage pack = EcorePackage.eINSTANCE;
    EClass attribute = pack.getEAttribute();
    EClassInfo objectUnderTest = new EClassifierInfo.EClassInfo(attribute, false, Collections.<String>emptySet(), null);
    assertEquals(true, objectUnderTest.containsCompatibleFeature("lowerBound", false, true, pack.getEInt(), new StringBuilder()));
    assertEquals(true, objectUnderTest.containsCompatibleFeature("lowerBound", false, true, pack.getEIntegerObject(), new StringBuilder()));
    assertEquals(false, objectUnderTest.containsCompatibleFeature("lowerBound", false, true, pack.getELong(), new StringBuilder()));
}
Also used : EClass(org.eclipse.emf.ecore.EClass) EClassInfo(org.eclipse.xtext.xtext.ecoreInference.EClassifierInfo.EClassInfo) EcorePackage(org.eclipse.emf.ecore.EcorePackage) Test(org.junit.Test)

Example 74 with EcorePackage

use of org.eclipse.emf.ecore.EcorePackage in project xtext-core by eclipse.

the class EClassInfoTest method testChangeable.

public void testChangeable() {
    EcorePackage pack = EcorePackage.eINSTANCE;
    EClass eClass = pack.getEClass();
    EClassInfo objectUnderTest = new EClassifierInfo.EClassInfo(eClass, false, Collections.<String>emptySet(), null);
    EcoreFactory fac = EcoreFactory.eINSTANCE;
    EReference reference = fac.createEReference();
    reference.setName("newReference");
    reference.setEType(eClass);
    reference.setChangeable(true);
    reference.setContainment(true);
    eClass.getEStructuralFeatures().add(reference);
    assertEquals(true, objectUnderTest.containsCompatibleFeature("newReference", false, true, eClass, new StringBuilder()));
    reference.setChangeable(false);
    assertEquals(false, objectUnderTest.containsCompatibleFeature("newReference", false, true, eClass, new StringBuilder()));
}
Also used : EClass(org.eclipse.emf.ecore.EClass) EClassInfo(org.eclipse.xtext.xtext.ecoreInference.EClassifierInfo.EClassInfo) EcoreFactory(org.eclipse.emf.ecore.EcoreFactory) EcorePackage(org.eclipse.emf.ecore.EcorePackage) EReference(org.eclipse.emf.ecore.EReference)

Example 75 with EcorePackage

use of org.eclipse.emf.ecore.EcorePackage in project tbd-studio-se by Talend.

the class HCatalogPackageImpl method initializePackageContents.

/**
 * 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
    HadoopClusterPackage theHadoopClusterPackage = (HadoopClusterPackage) EPackage.Registry.INSTANCE.getEPackage(HadoopClusterPackage.eNS_URI);
    EcorePackage theEcorePackage = (EcorePackage) EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
    // Create type parameters
    // Set bounds for type parameters
    // Add supertypes to classes
    hCatalogConnectionEClass.getESuperTypes().add(theHadoopClusterPackage.getHadoopSubConnection());
    hCatalogConnectionItemEClass.getESuperTypes().add(theHadoopClusterPackage.getHadoopSubConnectionItem());
    // Initialize classes and features; add operations and parameters
    initEClass(hCatalogConnectionEClass, HCatalogConnection.class, "HCatalogConnection", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEAttribute(getHCatalogConnection_Distribution(), theEcorePackage.getEString(), "distribution", null, 0, 1, HCatalogConnection.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getHCatalogConnection_HcatVersion(), theEcorePackage.getEString(), "hcatVersion", null, 0, 1, HCatalogConnection.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getHCatalogConnection_HcatDrivers(), theEcorePackage.getEString(), "hcatDrivers", null, 0, 1, HCatalogConnection.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getHCatalogConnection_HostName(), theEcorePackage.getEString(), "hostName", "localhost", 0, 1, HCatalogConnection.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getHCatalogConnection_Port(), theEcorePackage.getEString(), "port", "50111", 0, 1, HCatalogConnection.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getHCatalogConnection_UserName(), theEcorePackage.getEString(), "userName", "anonymous", 0, 1, HCatalogConnection.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getHCatalogConnection_Password(), theEcorePackage.getEString(), "password", "", 0, 1, HCatalogConnection.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getHCatalogConnection_Database(), theEcorePackage.getEString(), "database", "default", 0, 1, HCatalogConnection.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getHCatalogConnection_EnableKerberos(), theEcorePackage.getEBoolean(), "enableKerberos", null, 0, 1, HCatalogConnection.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getHCatalogConnection_KrbPrincipal(), theEcorePackage.getEString(), "krbPrincipal", "HTTP/__hostname__", 0, 1, HCatalogConnection.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getHCatalogConnection_KrbRealm(), theEcorePackage.getEString(), "krbRealm", "EXAMPLE.COM", 0, 1, HCatalogConnection.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getHCatalogConnection_NnPrincipal(), theEcorePackage.getEString(), "nnPrincipal", "nn/_HOST@EXAMPLE.COM", 0, 1, HCatalogConnection.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getHCatalogConnection_RowSeparator(), theEcorePackage.getEString(), "rowSeparator", "", 0, 1, HCatalogConnection.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getHCatalogConnection_FieldSeparator(), theEcorePackage.getEString(), "fieldSeparator", "", 0, 1, HCatalogConnection.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEClass(hCatalogConnectionItemEClass, HCatalogConnectionItem.class, "HCatalogConnectionItem", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    // Create resource
    createResource(eNS_URI);
}
Also used : EcorePackage(org.eclipse.emf.ecore.EcorePackage) HadoopClusterPackage(org.talend.repository.model.hadoopcluster.HadoopClusterPackage)

Aggregations

EcorePackage (org.eclipse.emf.ecore.EcorePackage)148 EOperation (org.eclipse.emf.ecore.EOperation)11 XtextPackage (org.eclipse.xtext.XtextPackage)5 PropertiesPackage (org.talend.core.model.properties.PropertiesPackage)4 CorePackage (orgomg.cwm.objectmodel.core.CorePackage)4 EClass (org.eclipse.emf.ecore.EClass)3 TypeRefsPackage (org.eclipse.n4js.ts.typeRefs.TypeRefsPackage)3 TypesPackage (org.eclipse.n4js.ts.types.TypesPackage)3 EcorePerNsURIPackage (org.eclipse.xtext.metamodelreferencing.tests.ecorePerNsURI.EcorePerNsURIPackage)3 XbasePackage (org.eclipse.xtext.xbase.XbasePackage)3 EClassInfo (org.eclipse.xtext.xtext.ecoreInference.EClassifierInfo.EClassInfo)3 ConnectionPackage (org.talend.core.model.metadata.builder.connection.ConnectionPackage)3 RulesPackage (org.talend.dataquality.rules.RulesPackage)3 Map (java.util.Map)2 EGenericType (org.eclipse.emf.ecore.EGenericType)2 ETypeParameter (org.eclipse.emf.ecore.ETypeParameter)2 EcoreFactory (org.eclipse.emf.ecore.EcoreFactory)2 TypesPackage (org.eclipse.xtext.common.types.TypesPackage)2 BaseInheritanceTestPackage (org.eclipse.xtext.grammarinheritance.baseInheritanceTest.BaseInheritanceTestPackage)2 IgnoreCaseLinkingTestPackage (org.eclipse.xtext.linking.ignoreCaseLinkingTest.IgnoreCaseLinkingTestPackage)2