public List<GenFeature> getKeys() { List<GenFeature> result = new ArrayList<GenFeature>(); for (EAttribute eAttribute : ((EReference)getEcoreFeature()).getEKeys()) { GenClass genClass = getTypeGenClass(); for (GenFeature genFeature : genClass.getAllGenFeatures()) { if (genFeature.getEcoreFeature() == eAttribute) { result.add(genFeature); } } } return result; }
public List<GenFeature> getKeys() { List<GenFeature> result = new ArrayList<GenFeature>(); for (EAttribute eAttribute : ((EReference)getEcoreFeature()).getEKeys()) { GenClass genClass = getTypeGenClass(); for (GenFeature genFeature : genClass.getAllGenFeatures()) { if (genFeature.getEcoreFeature() == eAttribute) { result.add(genFeature); } } } return result; }
/** * @since 2.3 * @param eObject * @param diagnostics * @param context * @return whether every key is unique. */ public boolean validate_EveryKeyUnique(EObject eObject, DiagnosticChain diagnostics, Map<Object, Object> context) { boolean result = true; EClass eClass = eObject.eClass(); for (int i = 0, size = eClass.getFeatureCount(); i < size; ++i) { EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(i); if (eStructuralFeature instanceof EReference) { EReference eReference = (EReference)eStructuralFeature; if (eReference.isMany() && !eReference.getEKeys().isEmpty()) { result &= validate_KeyUnique(eObject, eReference, diagnostics, context); if (!result && diagnostics == null) { return false; } } } } return result; }
/** * @since 2.3 * @param eObject * @param diagnostics * @param context * @return whether every key is unique. */ public boolean validate_EveryKeyUnique(EObject eObject, DiagnosticChain diagnostics, Map<Object, Object> context) { boolean result = true; EClass eClass = eObject.eClass(); for (int i = 0, size = eClass.getFeatureCount(); i < size; ++i) { EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(i); if (eStructuralFeature instanceof EReference) { EReference eReference = (EReference)eStructuralFeature; if (eReference.isMany() && !eReference.getEKeys().isEmpty()) { result &= validate_KeyUnique(eObject, eReference, diagnostics, context); if (!result && diagnostics == null) { return false; } } } } return result; }
EAttribute [] eAttributes = (EAttribute[])((BasicEList<?>)eReference.getEKeys()).data(); @SuppressWarnings("unchecked") List<EObject> values = (List<EObject>)eObject.eGet(eReference);
EAttribute [] eAttributes = (EAttribute[])((BasicEList<?>)eReference.getEKeys()).data(); @SuppressWarnings("unchecked") List<EObject> values = (List<EObject>)eObject.eGet(eReference);
EList<EAttribute> eKeys = eReference.getEKeys(); if (!eKeys.isEmpty())
EList<EAttribute> eKeys = ((EReference)eStructuralFeature).getEKeys(); if (eKeys.isEmpty())
EList<EAttribute> eKeys = eReference.getEKeys(); if (!eKeys.isEmpty())
EList<EAttribute> eKeys = ((EReference)eStructuralFeature).getEKeys(); if (eKeys.isEmpty())
eReference.getEKeys().add((EAttribute)eKey);
eReference.getEKeys().add((EAttribute)eKey);
getUserDefinedType_Type ().getEKeys ().add ( this.getTypeDefinition_Name () ); getTypeSystem_Types ().getEKeys ().add ( this.getTypeDefinition_Name () ); initEReference ( getTypeSystem_Includes (), this.getTypeSystem (), null, "includes", null, 0, -1, TypeSystem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED ); getTypeSystem_Includes ().getEKeys ().add ( this.getTypeSystem_Name () ); initEAttribute ( getTypeSystem_Name (), ecorePackage.getEString (), "name", null, 1, 1, TypeSystem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED );
getUserDefinedType_Type ().getEKeys ().add ( this.getTypeDefinition_Name () ); getTypeSystem_Types ().getEKeys ().add ( this.getTypeDefinition_Name () ); initEReference ( getTypeSystem_Includes (), this.getTypeSystem (), null, "includes", null, 0, -1, TypeSystem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED ); getTypeSystem_Includes ().getEKeys ().add ( this.getTypeSystem_Name () ); initEAttribute ( getTypeSystem_Name (), ecorePackage.getEString (), "name", null, 1, 1, TypeSystem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED );
getEndpoint_Node ().getEKeys ().add ( this.getNode_HostName () ); initEAttribute ( getEndpoint_PortNumber (), theEcorePackage.getEInt (), "portNumber", null, 1, 1, Endpoint.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$ initEReference ( getEndpoint_BoundService (), this.getServiceBinding (), null, "boundService", null, 0, 1, Endpoint.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$ initEReference ( getCommonDriver_Password (), this.getPasswordCredentials (), null, "password", null, 0, 1, CommonDriver.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$ initEReference ( getCommonDriver_Endpoints (), this.getEndpoint (), null, "endpoints", null, 0, -1, CommonDriver.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$ getCommonDriver_Endpoints ().getEKeys ().add ( this.getEndpoint_PortNumber () );
eKeys = eReference.getEKeys();
initEReference ( getCommonDeploymentMechanism_Changes (), this.getChangeEntry (), null, "changes", null, 1, -1, CommonDeploymentMechanism.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$ initEReference ( getCommonDeploymentMechanism_Maintainer (), this.getAuthor (), null, "maintainer", null, 1, 1, CommonDeploymentMechanism.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$ getCommonDeploymentMechanism_Maintainer ().getEKeys ().add ( this.getAuthor_Email () ); initEAttribute ( getCommonDeploymentMechanism_AdditionalDependencies (), ecorePackage.getEString (), "additionalDependencies", null, 0, -1, CommonDeploymentMechanism.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED ); //$NON-NLS-1$ initEAttribute ( getCommonDeploymentMechanism_StartupMechanism (), this.getStartupMechanism (), "startupMechanism", null, 0, 1, CommonDeploymentMechanism.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$ initEAttribute ( getCommonDeploymentMechanism_MultiUserScreen (), ecorePackage.getEBoolean (), "multiUserScreen", null, 0, 1, CommonDeploymentMechanism.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$ initEReference ( getCommonDeploymentMechanism_OperatingSystem (), theSetupPackage.getOperatingSystemDescriptor (), null, "operatingSystem", null, 0, 1, CommonDeploymentMechanism.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$ getCommonDeploymentMechanism_OperatingSystem ().getEKeys ().add ( theSetupPackage.getOperatingSystemDescriptor_Id () ); initEAttribute ( getCommonDeploymentMechanism_AutomaticCreate (), ecorePackage.getEBoolean (), "automaticCreate", "false", 0, 1, CommonDeploymentMechanism.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$ //$NON-NLS-2$ initEAttribute ( getCommonDeploymentMechanism_RecreateBackups (), ecorePackage.getEIntegerObject (), "recreateBackups", null, 0, 1, CommonDeploymentMechanism.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$ getChangeEntry_Author ().getEKeys ().add ( this.getAuthor_Email () ); initEAttribute ( getChangeEntry_Date (), ecorePackage.getEDate (), "date", null, 1, 1, ChangeEntry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$ initEAttribute ( getChangeEntry_Description (), ecorePackage.getEString (), "description", null, 1, 1, ChangeEntry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$
initEAttribute ( getProfile_JvmArguments (), ecorePackage.getEString (), "jvmArguments", null, 0, -1, Profile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$ initEReference ( getProfile_Start (), this.getStartBundle (), null, "start", null, 0, -1, Profile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$ getProfile_Start ().getEKeys ().add ( this.getStartBundle_Name () ); initEReference ( getProfile_Setbsl (), this.getBundleStartLevel (), null, "setbsl", null, 0, -1, Profile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$ initEReference ( getProfile_Property (), this.getSystemProperty (), null, "property", null, 0, -1, Profile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$