protected EAttribute initEAttribute
     (EAttribute a,
     EClassifier type,
     String name,
     String defaultValue,
     int lowerBound,
     int upperBound,
     Type containerClass,
     bool isTransient,
     bool isVolatile,
     bool isChangeable,
     bool isUnsettable,
     bool isID,
     bool isUnique,
     bool isDerived,
     bool isOrdered)
 {
     initEStructuralFeature
         (a,
         type,
         name,
         defaultValue,
         lowerBound,
         upperBound,
         containerClass,
         isTransient,
         isVolatile,
         isChangeable,
         isUnsettable,
         isUnique,
         isDerived,
         isOrdered);
     a.iD = isID;
     return(a);
 }
 private void initEStructuralFeature
     (EStructuralFeature s,
     EClassifier type,
     String name,
     String defaultValue,
     int lowerBound,
     int upperBound,
     Type containerClass,
     bool isTransient,
     bool isVolatile,
     bool isChangeable,
     bool isUnsettable,
     bool isUnique,
     bool isDerived,
     bool isOrdered)
 {
     s.name = name;
     ((EStructuralFeatureImpl)s).containerClass = containerClass;
     s.transient  = isTransient;
     s.volatile_  = isVolatile;
     s.changeable = isChangeable;
     s.unsettable = isUnsettable;
     s.unique     = isUnique;
     s.derived    = isDerived;
     s.ordered    = isOrdered;
     s.lowerBound = lowerBound;
     s.upperBound = upperBound;
     s.eType      = type;
     if (defaultValue != null)
     {
         s.defaultValueLiteral = defaultValue;
     }
 }
 protected EAttribute initEAttribute
     (EAttribute a,
     EClassifier type,
     String name,
     String defaultValue,
     int lowerBound,
     int upperBound,
     bool isTransient,
     bool isVolatile,
     bool isChangeable,
     bool isUnsettable,
     bool isID,
     bool isUnique,
     bool isDerived)
 {
     return
         (initEAttribute
              (a,
              type,
              name,
              defaultValue,
              lowerBound,
              upperBound,
              isTransient,
              isVolatile,
              isChangeable,
              isUnsettable,
              isID,
              isUnique,
              isDerived,
              true));
 }
 protected EAttribute initEAttribute
     (EAttribute a,
     EClassifier type,
     String name,
     String defaultValue,
     int lowerBound,
     int upperBound,
     bool isTransient,
     bool isVolatile,
     bool isChangeable,
     bool isUnsettable,
     bool isID,
     bool isUnique,
     bool isDerived,
     bool isOrdered)
 {
     initEAttribute
         (a,
         type,
         name,
         defaultValue,
         lowerBound,
         upperBound,
         ((EClassifier)a.eContainer()).instanceClass,
         isTransient,
         isVolatile,
         isChangeable,
         isUnsettable,
         isID,
         isUnique,
         isDerived,
         isOrdered);
     return(a);
 }
 private void initEClassifier(EClassifier o, EClass metaObject, Type instanceClass, string name)
 {
     o.name = name;
     if (instanceClass != null)
     {
         //hack: Originally setInstanceClass was defined manually in the EClassifier interface. Manual changes to the interface are not allowed anymore.
         (o as EClassifierImpl).setInstanceClass(instanceClass);
     }
 }
 private void ConvertClassifier(MetaNamespaceBuilder parentNs, EClassifier eclsf)
 {
     if (eclsf is EClass ecls)
     {
         ConvertClass(parentNs, ecls);
     }
     else if (eclsf is EEnum eenm)
     {
         ConvertEnum(parentNs, eenm);
     }
     else if (eclsf is EDataType edt)
     {
         ConvertDataType(parentNs, edt);
     }
     else
     {
         _diagnostics.Add(ModelErrorCode.ERR_ModelConversionError.ToDiagnosticWithNoLocation(string.Format("Unknown EClassifier type: {0}", eclsf.GetType())));
     }
 }
        public NotificationChain basicSetEType(EClassifier newobj, NotificationChain msgs)
        {
            var oldobj = _eType;

            _eType = newobj;
            if (eNotificationRequired())
            {
                var notification = new ENotificationImpl(this, NotificationImpl.SET, EcorePackageImpl.ETYPEDELEMENT_ETYPE, oldobj, newobj);
                if (msgs == null)
                {
                    msgs = notification;
                }
                else
                {
                    msgs.add(notification);
                }
            }
            return(msgs);
        }
Beispiel #8
0
        public NotificationChain basicSetEClassifier(EClassifier newobj, NotificationChain msgs)
        {
            var oldobj = _eClassifier;

            _eClassifier = newobj;
            if (eNotificationRequired())
            {
                var notification = new ENotificationImpl(this, NotificationImpl.SET, EcorePackageImpl.EGENERICTYPE_ECLASSIFIER, oldobj, newobj);
                if (msgs == null)
                {
                    msgs = notification;
                }
                else
                {
                    msgs.add(notification);
                }
            }
            return(msgs);
        }
 protected EReference initEReference
     (EReference r,
     EClassifier type,
     EReference otherEnd,
     String name,
     String defaultValue,
     int lowerBound,
     int upperBound,
     Type containerClass,
     bool isTransient,
     bool isVolatile,
     bool isChangeable,
     bool isContainment,
     bool isResolveProxies,
     bool isUnsettable,
     bool isUnique,
     bool isDerived,
     bool isOrdered)
 {
     initEStructuralFeature
         (r,
         type,
         name,
         defaultValue,
         lowerBound,
         upperBound,
         containerClass,
         isTransient,
         isVolatile,
         isChangeable,
         isUnsettable,
         isUnique,
         isDerived,
         isOrdered);
     r.containment = isContainment;
     if (otherEnd != null)
     {
         r.eOpposite = otherEnd;
     }
     r.resolveProxies = isResolveProxies;
     return(r);
 }
        public override void eSet(int featureID, object newValue)
        {
            switch (featureID)
            {
            case EcorePackageImpl.ETYPEDELEMENT_EANNOTATIONS:
                eAnnotations.Clear();
                eAnnotations.AddRange(((List <EObject>)newValue)?.Cast <EAnnotation>());
                return;

            case EcorePackageImpl.ETYPEDELEMENT_NAME:
                name = (string)newValue;
                return;

            case EcorePackageImpl.ETYPEDELEMENT_ORDERED:
                ordered = (bool)newValue;
                return;

            case EcorePackageImpl.ETYPEDELEMENT_UNIQUE:
                unique = (bool)newValue;
                return;

            case EcorePackageImpl.ETYPEDELEMENT_LOWERBOUND:
                lowerBound = (int)newValue;
                return;

            case EcorePackageImpl.ETYPEDELEMENT_UPPERBOUND:
                upperBound = (int)newValue;
                return;

            case EcorePackageImpl.ETYPEDELEMENT_ETYPE:
                eType = (EClassifier)newValue;
                return;

            case EcorePackageImpl.ETYPEDELEMENT_EGENERICTYPE:
                eGenericType = (EGenericType)newValue;
                return;
            }
            base.eSet(featureID, newValue);
        }
        public bool validateEClassifier(EClassifier obj, DiagnosticChain diagnostics, Dictionary <object, object> context)
        {
            if (!validate_NoCircularContainment(obj, diagnostics, context))
            {
                return(false);
            }
            bool result = validate_EveryMultiplicityConforms(obj, diagnostics, context);

            if (result || diagnostics != null)
            {
                result &= validate_EveryDataValueConforms(obj, diagnostics, context);
            }
            if (result || diagnostics != null)
            {
                result &= validate_EveryReferenceIsContained(obj, diagnostics, context);
            }
            if (result || diagnostics != null)
            {
                result &= validate_EveryBidirectionalReferenceIsPaired(obj, diagnostics, context);
            }
            //if (result || diagnostics != null) result &= validate_EveryProxyResolves(obj, diagnostics, context);
            if (result || diagnostics != null)
            {
                result &= validate_UniqueID(obj, diagnostics, context);
            }
            if (result || diagnostics != null)
            {
                result &= validate_EveryKeyUnique(obj, diagnostics, context);
            }
            if (result || diagnostics != null)
            {
                result &= validate_EveryMapEntryUnique(obj, diagnostics, context);
            }

            return(result);
        }
 protected void setInstanceTypeName(EClassifier eClassifier, string instanceTypeName)
 {
     ((EClassifierImpl)eClassifier).basicSetInstanceTypeName(instanceTypeName);
 }
 protected void setGeneratedClassName(EClassifier eClassifier)
 {
     ((EClassifierImpl)eClassifier).setGeneratedInstanceClass(true);
 }
 public virtual T caseEClassifier(EClassifier theEObject)
 {
     return(default(T));
 }