コード例 #1
0
        public static CodegenExpression Codegen(
            SelectExprProcessorTypableMapForge forge,
            CodegenMethodScope codegenMethodScope,
            ExprForgeCodegenSymbol exprSymbol,
            CodegenClassScope codegenClassScope)
        {
            CodegenExpression mapType = codegenClassScope.AddDefaultFieldUnshared(
                true,
                typeof(EventType),
                EventTypeUtility.ResolveTypeCodegen(forge.MapType, EPStatementInitServicesConstants.REF));
            CodegenExpression beanFactory =
                codegenClassScope.AddOrGetDefaultFieldSharable(EventBeanTypedEventFactoryCodegenField.INSTANCE);

            CodegenMethod methodNode = codegenMethodScope.MakeChild(
                typeof(EventBean),
                typeof(SelectExprProcessorTypableMapEval),
                codegenClassScope);

            methodNode.Block
                .DeclareVar<IDictionary<string, object>>(
                    "values",
                    forge.innerForge.EvaluateCodegen(
                        typeof(IDictionary<string, object>),
                        methodNode,
                        exprSymbol,
                        codegenClassScope))
                .DeclareVarNoInit(typeof(IDictionary<string, object>), "map")
                .IfRefNull("values")
                .AssignRef("values", StaticMethod(typeof(Collections), "GetEmptyMap", new[] { typeof(string), typeof(object) }))
                .BlockEnd()
                .MethodReturn(ExprDotMethod(beanFactory, "AdapterForTypedMap", Ref("values"), mapType));
            return LocalMethod(methodNode);
        }
コード例 #2
0
 public SelectExprProcessorTypableMapEval(SelectExprProcessorTypableMapForge forge)
 {
     this.forge = forge;
 }