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);
}
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()));
}
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()));
}
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()));
}
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);
}
Aggregations