コード例 #1
0
        public override bool IsPrimitive(IReflector reflector, IReflectClass claxx, ClassMetadata
                                         classMetadata)
        {
            return(Handlers4.PrimitiveClassReflector(classMetadata, reflector) != null);

            return(claxx.IsPrimitive());
        }
コード例 #2
0
            public virtual IEnumerator BackingFieldPath(IReflector reflector, object expression
                                                        )
            {
                if (expression == null)
                {
                    return(null);
                }
                IReflectClass claxx = reflector.ForObject(expression);

                if (claxx == null)
                {
                    return(null);
                }
                Prototypes.IntegerConverter converter = Prototypes.IntegerConverterforClassName(reflector
                                                                                                , claxx.GetName());
                if (converter != null)
                {
                    Pair entry = (Pair)this._fieldsByIntId.Get(converter.ToInteger(expression));
                    if (entry == null)
                    {
                        return(null);
                    }
                    if (entry.first.Equals(expression))
                    {
                        return(this.AsIterator((List4)entry.second));
                    }
                    return(null);
                }
                if (claxx.IsPrimitive())
                {
                    return(null);
                }
                return(this.AsIterator((List4)this._fieldsByIdentity.Get(expression)));
            }
コード例 #3
0
 public virtual bool IsPrimitive()
 {
     if (_delegate != null)
     {
         return(_delegate.IsPrimitive());
     }
     return(_isPrimitive);
 }
コード例 #4
0
 public virtual void TestNoPrimitives()
 {
     IReflectClass[] knownClassArray = Container().KnownClasses();
     for (int knownClassIndex = 0; knownClassIndex < knownClassArray.Length; ++knownClassIndex)
     {
         IReflectClass knownClass = knownClassArray[knownClassIndex];
         Assert.IsFalse(knownClass.IsPrimitive(), knownClass.GetName());
     }
 }
コード例 #5
0
 internal virtual void Configure(IReflectClass clazz, bool isPrimitive)
 {
     _isArray = clazz.IsArray();
     if (_isArray)
     {
         IReflectArray reflectArray = Reflector().Array();
         _isNArray    = reflectArray.IsNDimensional(clazz);
         _isPrimitive = reflectArray.GetComponentType(clazz).IsPrimitive();
     }
     else
     {
         _isPrimitive = isPrimitive | clazz.IsPrimitive();
     }
 }
コード例 #6
0
                public void Apply(object field)
                {
                    if (((IReflectField)field).IsStatic())
                    {
                        return;
                    }
                    if (this._enclosing._enclosing._ignoreTransient && ((IReflectField)field).IsTransient
                            ())
                    {
                        return;
                    }
                    IReflectClass fieldType = ((IReflectField)field).GetFieldType();
                    List4         path      = new List4(parentPath, ((IReflectField)field));

                    Prototypes.IntegerConverter converter = Prototypes.IntegerConverterforClassName(claxx
                                                                                                    .Reflector(), fieldType.GetName());
                    if (converter != null)
                    {
                        int    id = ++this._enclosing.intIdGenerator;
                        object integerRepresentation = converter.FromInteger(id);
                        if (!Prototypes.TrySetField(((IReflectField)field), @object, integerRepresentation
                                                    ))
                        {
                            return;
                        }
                        this._enclosing._fieldsByIntId.Put(id, new Pair(integerRepresentation, path));
                        return;
                    }
                    if (!fieldType.IsPrimitive())
                    {
                        object identityInstance = fieldType.NewInstance();
                        if (identityInstance == null)
                        {
                            return;
                        }
                        if (!Prototypes.TrySetField(((IReflectField)field), @object, identityInstance))
                        {
                            return;
                        }
                        this._enclosing._fieldsByIdentity.Put(identityInstance, path);
                        this._enclosing.Analyze(identityInstance, claxx, depth - 1, path);
                    }
                }
コード例 #7
0
 private FieldInfo[] MapFields(IReflectField[] fields, bool shouldStoreTransientFields
                               )
 {
     if (!shouldStoreTransientFields)
     {
         fields = FilterTransientFields(fields);
     }
     FieldInfo[] fieldsMeta = new FieldInfo[fields.Length];
     for (int i = 0; i < fields.Length; ++i)
     {
         IReflectField field      = fields[i];
         bool          isArray    = field.GetFieldType().IsArray();
         IReflectClass fieldClass = isArray ? field.GetFieldType().GetComponentType() : field
                                    .GetFieldType();
         bool isPrimitive = fieldClass.IsPrimitive();
         // TODO: need to handle NArray, currently it ignores NArray and alway sets NArray flag false.
         fieldsMeta[i] = new FieldInfo(field.GetName(), GetClassMeta(fieldClass), isPrimitive
                                       , isArray, false);
     }
     return(fieldsMeta);
 }
コード例 #8
0
		public override bool IsPrimitive(IReflector reflector, IReflectClass claxx, ClassMetadata
			 classMetadata)
		{
			return Handlers4.PrimitiveClassReflector(classMetadata, reflector) != null;
			return claxx.IsPrimitive();
		}
コード例 #9
0
 public ObjectNotStorableException(IReflectClass a_class) : base(Db4objects.Db4o.Internal.Messages
                                                                 .Get(a_class.IsPrimitive() ? 59 : 45, a_class.GetName()))
 {
 }
コード例 #10
0
		public virtual bool IsPrimitive(IReflector reflector, IReflectClass claxx, ClassMetadata
			 classMetadata)
		{
			return claxx.IsPrimitive();
		}
コード例 #11
0
            private bool IsActivating(IReflectField field)
            {
                IReflectClass fieldType = field.GetFieldType();

                return(fieldType != null && !fieldType.IsPrimitive());
            }
コード例 #12
0
ファイル: ArrayVersionHelper.cs プロジェクト: danfma/db4o-net
 public virtual bool IsPrimitive(IReflector reflector, IReflectClass claxx, ClassMetadata
                                 classMetadata)
 {
     return(claxx.IsPrimitive());
 }
コード例 #13
0
		public ObjectNotStorableException(IReflectClass a_class) : base(Db4objects.Db4o.Internal.Messages
			.Get(a_class.IsPrimitive() ? 59 : 45, a_class.GetName()))
		{
		}
コード例 #14
0
		internal virtual void Configure(IReflectClass clazz, bool isPrimitive)
		{
			_isArray = clazz.IsArray();
			if (_isArray)
			{
				IReflectArray reflectArray = Reflector().Array();
				_isNArray = reflectArray.IsNDimensional(clazz);
				_isPrimitive = reflectArray.GetComponentType(clazz).IsPrimitive();
			}
			else
			{
				_isPrimitive = isPrimitive | clazz.IsPrimitive();
			}
		}