Beispiel #1
0
        public virtual object BuildOneInstance(NativeObjectInfo objectInfo)
        {
            if (objectInfo.IsAtomicNativeObject())
            {
                return(BuildOneInstance((AtomicNativeObjectInfo)objectInfo));
            }
            if (objectInfo.IsCollectionObject())
            {
                CollectionObjectInfo coi = (CollectionObjectInfo)objectInfo;
                object value             = BuildCollectionInstance(coi);

                /* Manage a specific case of Set
                 * if (typeof(Java.Util.Set).IsAssignableFrom(value.GetType()) && typeof(System.Collections.ICollection).IsAssignableFrom(value.GetType()))
                 * {
                 *      Java.Util.Set s = new Java.Util.HashSet();
                 *      s.AddAll((System.Collections.ICollection)value);
                 *      value = s;
                 * }
                 */
                return(value);
            }
            if (objectInfo.IsArrayObject())
            {
                return(BuildArrayInstance((ArrayObjectInfo)objectInfo));
            }
            if (objectInfo.IsMapObject())
            {
                return(BuildMapInstance((MapObjectInfo)objectInfo));
            }
            if (objectInfo.IsNull())
            {
                return(null);
            }
            throw new ODBRuntimeException(NeoDatisError.InstanceBuilderNativeType.AddParameter(ODBType.GetNameFromId(objectInfo.GetOdbTypeId())));
        }
Beispiel #2
0
 private object BuildOneInstance(NativeObjectInfo objectInfo)
 {
     if (objectInfo.IsAtomicNativeObject())
     {
         return(BuildOneInstance((AtomicNativeObjectInfo)objectInfo));
     }
     if (objectInfo.IsArrayObject())
     {
         return(BuildArrayInstance((ArrayObjectInfo)objectInfo));
     }
     if (objectInfo.IsNull())
     {
         return(null);
     }
     throw new OdbRuntimeException(
               NDatabaseError.InstanceBuilderNativeType.AddParameter(OdbType.GetNameFromId(objectInfo.GetOdbTypeId())));
 }