public void Compile(DefFieldBase def) { foreach (var p in _valueSetStr.Split(',', ';')) { _datas.Add(_type.Apply(StringDataCreator.Ins, p)); } }
public virtual void PostCompile(DefFieldBase field) { foreach (var p in Processors) { p.Compile(field); } }
public override void PostCompile(DefFieldBase field) { base.PostCompile(field); foreach (var p in ElementType.Processors) { p.Compile(field); } if (ElementType is TBean e && !e.IsDynamic && e.Bean.HierarchyFields.Count == 0) { throw new Exception($"container element type:'{e.Bean.FullName}' can't be empty bean"); } if (ElementType is TText) { throw new Exception($"bean:{field.HostType.FullName} field:{field.Name} container element type can't be text"); } }
public override void PostCompile(DefFieldBase field) { base.PostCompile(field); foreach (var p in ElementType.Processors) { p.Compile(field); } if (ElementType is TBean beanType) { throw new Exception($"bean:{field.HostType.FullName} field:{field.Name} element type can't be bean:{beanType.Bean.FullName}"); } if (ElementType is TText) { throw new Exception($"bean:{field.HostType.FullName} field:{field.Name} container element type can't be text"); } }
public void Compile(DefFieldBase def) { void ThrowError() { throw new Exception($"结构:{ def.HostType.FullName } 字段: { def.Name} range 定义:{_str} 不合法"); } if (_str.Length <= 2) { ThrowError(); } switch (_str[0]) { case '[': _includeMinBound = true; break; case '(': _includeMinBound = false; break; default: ThrowError(); break; } switch (_str[^ 1])
public override void PostCompile(DefFieldBase field) { base.PostCompile(field); foreach (var p in KeyType.Processors) { p.Compile(field); } foreach (var p in ValueType.Processors) { p.Compile(field); } if (KeyType is TText) { throw new Exception($"bean:{field.HostType.FullName} field:{field.Name} container key type can't be text"); } if (ValueType is TText) { throw new Exception($"bean:{field.HostType.FullName} field:{field.Name} container value type can't be text"); } }
public void Compile(DefFieldBase def) { }