Beispiel #1
0
 private string GetFragmentCodegen(ICodegenContext context)
 {
     return(context.AddMethod(typeof(object), typeof(GenericRecord), "record", this.GetType())
            .DeclareVar(
                typeof(Collection), "values",
                Cast(typeof(Collection), ExprDotMethod(Ref("record"), "Get", Constant(_posTop))))
            .DeclareVar(
                typeof(object), "value",
                StaticMethod(
                    typeof(AvroEventBeanGetterIndexed), "GetAvroIndexedValue", Ref("values"), Constant(_index)))
            .IfRefNullReturnNull("value")
            .IfRefNotTypeReturnConst("value", typeof(GenericRecord), null)
            .MethodReturn(_nested.CodegenUnderlyingFragment(Cast(typeof(GenericRecord), Ref("value")), context)));
 }