예제 #1
0
 public void Compile(DefFieldBase def)
 {
     foreach (var p in _valueSetStr.Split(',', ';'))
     {
         _datas.Add(_type.Apply(StringDataCreator.Ins, p));
     }
 }
예제 #2
0
 public virtual void PostCompile(DefFieldBase field)
 {
     foreach (var p in Processors)
     {
         p.Compile(field);
     }
 }
예제 #3
0
        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");
            }
        }
예제 #4
0
        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");
            }
        }
예제 #5
0
        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])
예제 #6
0
        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");
            }
        }
예제 #7
0
 public void Compile(DefFieldBase def)
 {
 }