Example #1
0
 private string GetObjectArrayCodegen(ICodegenContext context)
 {
     return context.AddMethod(typeof(object), typeof(object[]), "array", GetType())
         .DeclareVar(typeof(object), "value",
             ArrayAtIndex(Ref("array"),
                 Constant(_propertyIndex)))
         .IfRefNullReturnNull("value")
         .IfInstanceOf("value", typeof(EventBean))
         .BlockReturn(_entryGetter.CodegenEventBeanGet(CastRef(typeof(EventBean), "value"),
             context))
         .MethodReturn(_entryGetter.CodegenUnderlyingGet(
             Cast(_entryGetter.TargetType, Ref("value")), context));
 }
 private string GetMapCodegen(ICodegenContext context)
 {
     return context.AddMethod(typeof(object), typeof(Map), "map", GetType())
         .DeclareVar(typeof(object), "value",
             ExprDotMethod(Ref("map"), "get",
                 Constant(_propertyMap)))
         .IfRefNullReturnNull("value")
         .IfInstanceOf("value", typeof(EventBean))
         .BlockReturn(_mapEntryGetter.CodegenEventBeanGet(CastRef(typeof(EventBean), "value"),
             context))
         .MethodReturn(
             _mapEntryGetter.CodegenUnderlyingGet(CastRef(_mapEntryGetter.TargetType, "value"),
                 context));
 }