private MetaTypeBuilder GetType(ETypedElement ete) { if (_map.TryGetValue(ete.EType, out var mobj)) { var mtype = (MetaTypeBuilder)mobj; if (ete.UpperBound < 0 || ete.UpperBound > 1) { MetaCollectionKind kind; if (ete.Unique) { if (ete.Ordered) { kind = MetaCollectionKind.List; } else { kind = MetaCollectionKind.Set; } } else { if (ete.Ordered) { kind = MetaCollectionKind.MultiList; } else { kind = MetaCollectionKind.MultiSet; } } var mcoll = _factory.MetaCollectionType(); mcoll.InnerType = mtype; mcoll.Kind = kind; return(mcoll); } else { return(mtype); } } else if (ete.EType is EDataType edataType) { var mpt = _factory.MetaPrimitiveType(); mpt.Name = edataType.Name; _map.Add(edataType, mpt); return(mpt); } return(null); }
public bool validateETypedElement(ETypedElement 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); }
public virtual T caseETypedElement(ETypedElement theEObject) { return(default(T)); }