public virtual object GetDefaultValue() /* throws Net.Vpc.Upa.Exceptions.UPAException */ { Net.Vpc.Upa.Entity entity = entityBeanAdapter.GetEntity(); Net.Vpc.Upa.Field field = null; if (entity != null) { field = entity.FindField(GetName()); if (field == null) { entity = null; } } if (entity == null || field == null) { return(Net.Vpc.Upa.Impl.FwkConvertUtils.GetMapValue <System.Type, object>(Net.Vpc.Upa.Impl.Util.PlatformUtils.DEFAULT_VALUES_BY_TYPE, GetFieldType())); } else { return(field.GetUnspecifiedValueDecoded()); } }
public override void SetValue(object o, object @value) { if (setter == null) { throw new System.Exception("Field " + fieldName + " is readonly : no setter found"); } try { setter.Invoke(o, @value); } catch (System.Exception e) { if (e is System.Exception) { e = (System.Exception)(((System.Exception)e)).InnerException; } throw new Net.Vpc.Upa.Exceptions.UPAException(e, new Net.Vpc.Upa.Types.I18NString("UnableToSetFieldValue"), fieldName, entityBeanAdapter.GetEntity(), setter); } }