private string GetMapCodegen(ICodegenContext context) { return context.AddMethod(typeof(object), typeof(Map), "map", GetType()) .DeclareVar(typeof(EventBean[]), "wrapper", Cast(typeof(EventBean[]), ExprDotMethod(Ref("map"), "get", Constant(_propertyName)))) .MethodReturn(LocalMethod( BaseNestableEventUtil.GetArrayPropertyValueCodegen(context, _index, _nestedGetter), Ref("wrapper"))); }
private String GetObjectArrayCodegen(ICodegenContext context) { return(context.AddMethod(typeof(Object), typeof(Object[]), "Array", GetType()) .DeclareVar(typeof(EventBean[]), "wrapper", Cast(typeof(EventBean[]), ArrayAtIndex( Ref("array"), Constant(_propertyIndex)))) .MethodReturn(LocalMethod( BaseNestableEventUtil.GetArrayPropertyValueCodegen(context, _index, _nestedGetter), Ref("wrapper")))); }
private CodegenMethod GetObjectArrayCodegen( CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) { return codegenMethodScope.MakeChild(typeof(object), GetType(), codegenClassScope) .AddParam(typeof(object[]), "array") .Block .DeclareVar<EventBean[]>( "wrapper", Cast(typeof(EventBean[]), ArrayAtIndex(Ref("array"), Constant(propertyIndex)))) .MethodReturn( LocalMethod( BaseNestableEventUtil.GetArrayPropertyValueCodegen( codegenMethodScope, codegenClassScope, index, nestedGetter), Ref("wrapper"))); }
private CodegenMethod GetMapCodegen( CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) { return codegenMethodScope.MakeChild(typeof(object), GetType(), codegenClassScope) .AddParam(typeof(IDictionary<string, object>), "map") .Block .DeclareVar<EventBean[]>( "wrapper", Cast(typeof(EventBean[]), ExprDotMethod(Ref("map"), "Get", Constant(propertyName)))) .MethodReturn( LocalMethod( BaseNestableEventUtil.GetArrayPropertyValueCodegen( codegenMethodScope, codegenClassScope, index, nestedGetter), Ref("wrapper"))); }