Example #1
0
 public virtual IReflectClass GetComponentType()
 {
     if (!IsArray())
     {
         return(null);
     }
     return(_parentReflector.ForClass(_registry.ComponentType(_class)));
 }
Example #2
0
 public virtual void RegisterReflector(IReflector reflector)
 {
     _classReflector = reflector.ForClass(JavaClass());
     var clazz = PrimitiveJavaClass();
     if (clazz != null)
     {
         _primitiveClassReflector = reflector.ForClass(clazz);
     }
 }
        public virtual void RegisterReflector(IReflector reflector)
        {
            _classReflector = reflector.ForClass(JavaClass());
            Type clazz = PrimitiveJavaClass();

            if (clazz != null)
            {
                _primitiveClassReflector = reflector.ForClass(clazz);
            }
        }
Example #4
0
        /// <summary>Returns a ReflectClass instance for the specified class</summary>
        /// <param name="clazz">class</param>
        /// <returns>a ReflectClass instance for the specified class</returns>
        /// <seealso cref="Db4objects.Db4o.Reflect.IReflectClass">Db4objects.Db4o.Reflect.IReflectClass
        ///     </seealso>
        public virtual IReflectClass ForClass(Type clazz)
        {
            if (clazz == null)
            {
                return(null);
            }
            IReflectClass claxx = (IReflectClass)_classByClass.Get(clazz);

            if (claxx != null)
            {
                return(claxx);
            }
            if (!clazz.IsArray && ReflectPlatform.IsNamedClass(clazz))
            {
                claxx = ForName(ReflectPlatform.FullyQualifiedName(clazz));
                if (claxx != null)
                {
                    _classByClass.Put(clazz, claxx);
                    return(claxx);
                }
            }
            claxx = _delegate.ForClass(clazz);
            if (claxx == null)
            {
                return(null);
            }
            claxx = EnsureDelegate(claxx);
            _classByClass.Put(clazz, claxx);
            return(claxx);
        }
Example #5
0
 public virtual IReflectClass ForObject(object a_object)
 {
     if (a_object == null)
     {
         return(null);
     }
     return(_parent.ForClass(a_object.GetType()));
 }
        public virtual void TestExceptionIsPropagated()
        {
            IReflector reflector = Platform4.ReflectorForType(typeof(ReflectFieldExceptionTestCase.Item
                                                                     ));
            IReflectField field = reflector.ForClass(typeof(ReflectFieldExceptionTestCase.Item
                                                            )).GetDeclaredField("_name");

            Assert.Expect(typeof(Db4oException), typeof(ArgumentException), new _ICodeBlock_18
                              (field));
        }
Example #7
0
        /// <summary>returns a prototype object for a specific class.</summary>
        /// <remarks>returns a prototype object for a specific class.</remarks>
        public virtual object PrototypeForClass(Type clazz)
        {
            if (clazz == null)
            {
                throw new PrototypesException("Class can not be null");
            }
            IReflectClass claxx = _reflector.ForClass(clazz);

            if (claxx == null)
            {
                throw new PrototypesException("Not found in the reflector: " + clazz);
            }
            string className = claxx.GetName();

            Prototypes.Prototype prototype = (Prototypes.Prototype)_prototypes.Get(className);
            if (prototype != null)
            {
                return(prototype.Object());
            }
            prototype = new Prototypes.Prototype(this, claxx);
            _prototypes.Put(className, prototype);
            return(prototype.Object());
        }
Example #8
0
 public static IReflectClass[] ToMeta(IReflector reflector, Type[] clazz)
 {
     IReflectClass[] claxx = null;
     if (clazz != null)
     {
         claxx = new IReflectClass[clazz.Length];
         for (int i = 0; i < clazz.Length; i++)
         {
             if (clazz[i] != null)
             {
                 claxx[i] = reflector.ForClass(clazz[i]);
             }
         }
     }
     return(claxx);
 }
Example #9
0
 public static IReflectClass ReflectClassFor(IReflector reflector, object clazz)
 {
     if (clazz is IReflectClass)
     {
         return((IReflectClass)clazz);
     }
     if (clazz is Type)
     {
         return(reflector.ForClass((Type)clazz));
     }
     if (clazz is string)
     {
         return(reflector.ForName((string)clazz));
     }
     return(reflector.ForObject(clazz));
 }
Example #10
0
		public static IReflectClass ReflectClassFor(IReflector reflector, object clazz)
		{
			if (clazz is IReflectClass)
			{
				return (IReflectClass)clazz;
			}
			if (clazz is Type)
			{
				return reflector.ForClass((Type)clazz);
			}
			if (clazz is string)
			{
				return reflector.ForName((string)clazz);
			}
			return reflector.ForObject(clazz);
		}
Example #11
0
 public IReflectClass GetReturnType()
 {
     return(_reflector.ForClass(method.ReturnType));
 }
Example #12
0
 public virtual void RegisterReflector(IReflector reflector)
 {
     _classReflector = reflector.ForClass(typeof (string));
 }
Example #13
0
 public virtual IReflectClass ForFieldType(Type type)
 {
     return(_parent.ForClass(type));
 }
Example #14
0
 public virtual void RegisterReflector(IReflector reflector)
 {
     _classReflector = reflector.ForClass(typeof(string));
 }
		public virtual void RegisterReflector(IReflector reflector)
		{
			_classReflector = reflector.ForClass(_clazz);
		}
Example #16
0
 private static void AssertType(IReflector reflector, Type expected, IReflectClass actual)
 {
     Assert.AreEqual(reflector.ForClass(expected), actual);
 }
Example #17
0
 public virtual IReflectClass ForClass(Type clazz)
 {
     return(_delegate.ForClass(clazz));
 }
Example #18
0
 public IReflectClass ForClass(Type type)
 {
     Console.WriteLine("Reflector.forClass({0})", type);
     return(readReflector.ForClass(type));
 }
Example #19
0
 public virtual IReflectClass GetComponentType()
 {
     return(_reflector.ForClass(_type.GetElementType()));
 }
Example #20
0
		public static IReflectClass[] ToMeta(IReflector reflector, Type[] clazz)
		{
			IReflectClass[] claxx = null;
			if (clazz != null)
			{
				claxx = new IReflectClass[clazz.Length];
				for (int i = 0; i < clazz.Length; i++)
				{
					if (clazz[i] != null)
					{
						claxx[i] = reflector.ForClass(clazz[i]);
					}
				}
			}
			return claxx;
		}
Example #21
0
 public virtual IReflectClass GetFieldType()
 {
     return(_reflector.ForClass(_field.FieldType));
 }
Example #22
0
 public virtual void RegisterReflector(IReflector reflector)
 {
     _classReflector = reflector.ForClass(_clazz);
 }