public DTLocalBeanCalOpsEval( DTLocalBeanCalOpsForge forge, DTLocalEvaluator inner) { this.forge = forge; this.inner = inner; }
public static CodegenExpression Codegen( DTLocalBeanCalOpsForge forge, CodegenExpression inner, Type innerType, CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) { var methodNode = codegenMethodScope .MakeChild(forge.innerReturnType, typeof(DTLocalBeanCalOpsEval), codegenClassScope) .AddParam(typeof(EventBean), "target"); CodegenExpression timestamp = Ref("timestamp"); methodNode.Block.DeclareVar( forge.getterReturnType, "timestamp", CodegenLegoCast.CastSafeFromObjectType( forge.getterReturnType, forge.getter.EventBeanGetCodegen(Ref("target"), methodNode, codegenClassScope))); if (forge.getterReturnType.CanBeNull()) { methodNode.Block.IfRefNullReturnNull("timestamp"); if (forge.getterReturnType.IsNullable()) { timestamp = Unbox(timestamp); } } methodNode.Block.MethodReturn( forge.inner.Codegen( timestamp, forge.getterReturnType, methodNode, exprSymbol, codegenClassScope)); return LocalMethod(methodNode, inner); }