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

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

This is used to instantiate the object using a constructor that takes deserialized objects as arguments. The objects that have been deserialized are provided in declaration order so they can be passed to the constructor to instantiate the object.
public GetInstance ( Object list ) : Object
list Object /// this is the list of objects used for instantiation ///
Результат Object
      public Object GetInstance(Object[] list) {
         if(!factory.isAccessible()) {
            factory.setAccessible(true);
         }
         return factory.newInstance(list);
      }
      /// <summary>

Same methods

Builder::GetInstance ( Criteria criteria ) : 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));
        }