SimpleFramework.Xml.Core.Builder.GetInstance C# (CSharp) Метод

GetInstance() публичный Метод

public GetInstance ( Criteria criteria ) : Object
criteria Criteria /// this contains the criteria to be used ///
Результат Object
      public Object GetInstance(Criteria criteria) {
         Object[] values = list.toArray();
         for(int i = 0; i < list.size(); i++) {
            String name = list.get(i).getName();
            Variable variable = criteria.remove(name);
            Object value = variable.getValue();
            values[i] = value;
         }
         return GetInstance(values);
      }
      /// <summary>

Same methods

Builder::GetInstance ( Object list ) : Object

Usage Example

Пример #1
0
        //public Object GetInstance() {
        //   return primary.Instance;
        //}
        /// This is used to instantiate the object using a constructor that
        /// takes deserialized objects as arguments. The object that have
        /// been deserialized can be taken from the <c>Criteria</c>
        /// object which contains the deserialized values.
        /// </summary>
        /// <param name="criteria">
        /// this contains the criteria to be used
        /// </param>
        /// <returns>
        /// this returns the object that has been instantiated
        /// </returns>
        public Object GetInstance(Criteria criteria)
        {
            Builder builder = GetBuilder(criteria);

            if (builder == null)
            {
                throw new PersistenceException("Constructor not matched for %s", type);
            }
            return(builder.GetInstance(criteria));
        }