Пример #1
0
 public virtual bool IsDefaultValue(object instance, string field)
 {
     Net.Vpc.Upa.Impl.Util.BeanAdapterAttribute attrAdapter = GetAttrAdapter(field);
     if (attrAdapter != null)
     {
         return(attrAdapter.IsDefaultValue(instance));
     }
     return(false);
 }
Пример #2
0
 public virtual System.Collections.Generic.ISet <string> GetPropertyNames(object o, bool?includeDefaults) /* throws Net.Vpc.Upa.Exceptions.UPAException */
 {
     System.Collections.Generic.HashSet <string> set = new System.Collections.Generic.HashSet <string>();
     if (includeDefaults == null)
     {
         Net.Vpc.Upa.Impl.FwkConvertUtils.CollectionAddRange(set, GetPropertyNames());
     }
     else
     {
         foreach (string k in GetPropertyNames())
         {
             Net.Vpc.Upa.Impl.Util.BeanAdapterAttribute e = GetAttrAdapter(k);
             if (includeDefaults == e.IsDefaultValue(o))
             {
                 set.Add(k);
             }
         }
     }
     return(set);
 }
Пример #3
0
 public virtual System.Collections.Generic.IDictionary <string, object> ToMap(object o, bool?includeDefaults)  /* throws Net.Vpc.Upa.Exceptions.UPAException */
 {
     System.Collections.Generic.Dictionary <string, object> map = new System.Collections.Generic.Dictionary <string, object>();
     if (includeDefaults == null)
     {
         foreach (string k in GetPropertyNames())
         {
             Net.Vpc.Upa.Impl.Util.BeanAdapterAttribute e = GetAttrAdapter(k);
             map[k] = e.GetValue(o);
         }
     }
     else
     {
         foreach (string k in GetPropertyNames())
         {
             Net.Vpc.Upa.Impl.Util.BeanAdapterAttribute e = GetAttrAdapter(k);
             if (includeDefaults == e.IsDefaultValue(o))
             {
                 map[k] = e.GetValue(o);
             }
         }
     }
     return(map);
 }