// Method Recognizer for Map // ------------------------------------------------------------------------ public override sealed void FillPropDescr(PropMethodsDescriptor descr, PropertyFact fact, System.Reflection.MethodInfo meth) { if (descr is MapPropMethodsDescriptor) { MapPropMethodsDescriptor d = (MapPropMethodsDescriptor) descr; doFillPropDescr(d, fact, meth); } }
public MdaFieldImpl(MdaClass ownerMdaClass, int internalFieldIndex, string fieldName, PropertiesNode tags, PropMethodsDescriptor methods) : base(fieldName, tags, ownerMdaClass) { this.internalFieldIndex = internalFieldIndex; System.Type modelClass = ownerMdaClass.getModelClass(); if (methods == null) { throw new System.ArgumentException(); } // TODO fieldType is badly set // should be set correctly using MethodRecognizer + PropertFact / PropMethodsDescriptor System.Reflection.MethodInfo getterMethod = methods.getMethod; if (getterMethod == null) { log.error("failed to find read Method for " + modelClass + "." + fieldName + " ... subsequent calls to fieldInfo.getValue(object) will not work!"); this.fieldType = typeof(object); } else { this.fieldType = getterMethod.ReturnType; } }
public override void FillPropDescr(PropMethodsDescriptor descr , PropertyFact fact, System.Reflection.MethodInfo meth ) { descr.setMethod = meth; }
public abstract void FillPropDescr(PropMethodsDescriptor descr, PropertyFact fact, System.Reflection.MethodInfo meth);
protected MdaField CreateMdaFieldImpl(MdaClassImpl parent, string propName, PropMethodsDescriptor desc, int fieldIndex) { MdaField resElt; PropertiesNode fieldTags = new DefaultPropertiesNode(); if (desc is ValuePropMethodsDescriptor) { ValuePropMethodsDescriptor d = (ValuePropMethodsDescriptor)desc; resElt = new MdaValueFieldImpl (parent, fieldIndex, propName, fieldTags, d); } else if (desc is RefByIdPropMethodsDescriptor) { RefByIdPropMethodsDescriptor d = (RefByIdPropMethodsDescriptor)desc; resElt = new MdaRefByIdFieldImpl (parent, fieldIndex, propName, fieldTags, d); } else if (desc is AggrObjRefPropMethodsDescriptor) { AggrObjRefPropMethodsDescriptor d = (AggrObjRefPropMethodsDescriptor)desc; resElt = new MdaAggrObjRefFieldImpl (parent, fieldIndex, propName, fieldTags, d); } else if (desc is ListPropMethodsDescriptor) { ListPropMethodsDescriptor d = (ListPropMethodsDescriptor)desc; resElt = new MdaListFieldImpl (parent, fieldIndex, propName, fieldTags, d); } else if (desc is SetPropMethodsDescriptor) { SetPropMethodsDescriptor d = (SetPropMethodsDescriptor)desc; resElt = new MdaSetFieldImpl (parent, fieldIndex, propName, fieldTags, d); } else if (desc is MapPropMethodsDescriptor) { MapPropMethodsDescriptor d = (MapPropMethodsDescriptor)desc; resElt = new MdaMapFieldImpl (parent, fieldIndex, propName, fieldTags, d); } else if (desc is ArrayPropMethodsDescriptor) { ArrayPropMethodsDescriptor d = (ArrayPropMethodsDescriptor)desc; resElt = new MdaArrayFieldImpl (parent, fieldIndex, propName, fieldTags, d); } else { throw new System.InvalidOperationException ("SHOULD NOT OCCUR: unrecognized PropMethodsDescriptor type"); } return resElt; }