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

Set a number of property values in bulk.

Does not allow unknown fields. Equivalent to Spring.Objects.ObjectWrapper.SetPropertyValues(IPropertyValues, bool) with and for arguments.

/// If an error is encountered while setting a property. /// /// On a mismatch while setting a property, insufficient permissions, etc. ///
public SetPropertyValues ( IPropertyValues pvs ) : void
pvs IPropertyValues /// The to set on the target /// object. ///
Результат void
Пример #1
0
		/// <summary> 
		/// This implementation applies the passed-in job data map as object property
		/// values, and delegates to <code>ExecuteInternal</code> afterwards.
		/// </summary>
		/// <seealso cref="ExecuteInternal" />
        public void Execute(IJobExecutionContext context)
		{
			try
			{
				ObjectWrapper bw = new ObjectWrapper(this);
				MutablePropertyValues pvs = new MutablePropertyValues();
				pvs.AddAll(context.Scheduler.Context);
				pvs.AddAll(context.MergedJobDataMap);
				bw.SetPropertyValues(pvs, true);
			}
			catch (SchedulerException ex)
			{
				throw new JobExecutionException(ex);
			}
			ExecuteInternal(context);
		}
Пример #2
0
 /// <summary> 
 /// Create the job instance, populating it with property values taken
 /// from the scheduler context, job data map and trigger data map.
 /// </summary>
 protected override object CreateJobInstance(TriggerFiredBundle bundle)
 {
     ObjectWrapper ow = new ObjectWrapper(bundle.JobDetail.JobType);
     if (IsEligibleForPropertyPopulation(ow.WrappedInstance))
     {
         MutablePropertyValues pvs = new MutablePropertyValues();
         if (schedulerContext != null)
         {
             pvs.AddAll(schedulerContext);
         }
         pvs.AddAll(bundle.JobDetail.JobDataMap);
         pvs.AddAll(bundle.Trigger.JobDataMap);
         if (ignoredUnknownProperties != null)
         {
             for (int i = 0; i < ignoredUnknownProperties.Length; i++)
             {
                 string propName = ignoredUnknownProperties[i];
                 if (pvs.Contains(propName))
                 {
                     pvs.Remove(propName);
                 }
             }
             ow.SetPropertyValues(pvs);
         }
         else
         {
             ow.SetPropertyValues(pvs, true);
         }
     }
     return ow.WrappedInstance;
 }