private string GetMapCodegen(ICodegenContext context)
 {
     return context.AddMethod(typeof(object), typeof(Map), "map", GetType())
         .DeclareVar(typeof(object), "value",
             ExprDotMethod(Ref("map"), "get",
                 Constant(_propertyMap)))
         .MethodReturn(LocalMethod(
             BaseNestableEventUtil.GetBeanArrayValueCodegen(context, _nestedGetter, _index),
             Ref("value")));
 }
 private CodegenMethod GetFieldCodegen(
     CodegenMethodScope codegenMethodScope,
     CodegenClassScope codegenClassScope)
 {
     return codegenMethodScope.MakeChild(typeof(object), GetType(), codegenClassScope)
         .AddParam(field.DeclaringType, "und")
         .Block
         .DeclareVar<object>("value", ExprDotName(Ref("und"), field.Name))
         .MethodReturn(
             LocalMethod(
                 BaseNestableEventUtil.GetBeanArrayValueCodegen(
                     codegenMethodScope,
                     codegenClassScope,
                     nestedGetter,
                     index),
                 Ref("value")));
 }
 private CodegenMethod GetMapCodegen(
     CodegenMethodScope codegenMethodScope,
     CodegenClassScope codegenClassScope)
 {
     return codegenMethodScope.MakeChild(typeof(object), GetType(), codegenClassScope)
         .AddParam(typeof(IDictionary<string, object>), "map")
         .Block
         .DeclareVar<object>("value", ExprDotMethod(Ref("map"), "Get", Constant(propertyMap)))
         .MethodReturn(
             LocalMethod(
                 BaseNestableEventUtil.GetBeanArrayValueCodegen(
                     codegenMethodScope,
                     codegenClassScope,
                     nestedGetter,
                     index),
                 Ref("value")));
 }
Exemple #4
0
 private CodegenMethod GetObjectArrayCodegen(
     CodegenMethodScope codegenMethodScope,
     CodegenClassScope codegenClassScope)
 {
     var method = codegenMethodScope.MakeChild(typeof(object), GetType(), codegenClassScope)
         .AddParam(typeof(object[]), "array");
     method.Block
         .DeclareVar<object>("value", ArrayAtIndex(Ref("array"), Constant(propertyIndex)))
         .MethodReturn(
             LocalMethod(
                 BaseNestableEventUtil.GetBeanArrayValueCodegen(
                     codegenMethodScope,
                     codegenClassScope,
                     nestedGetter,
                     index),
                 Ref("value")));
     return method;
 }